Questions tagged [netapi32]

27 questions
0
votes
1 answer

Get Username of an Accesed File

I would like to get the username of an accessed file (add, delete, rename,...). actually I use filesystemwatcher to monitor the file access and I have activated object access on an directory to get userinformation via eventlogs. This solution is not…
user1008764
  • 390
  • 1
  • 3
  • 7
0
votes
0 answers

c# netapi32 netuseadd console app OK winform NG

I use the declaration below in a console app & a winforms app. Both are 3.5 framework. [DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern NET_API_STATUS NetUseAdd( LPWSTR…
ninety
  • 19
  • 6
0
votes
1 answer

How to correctly build code for gcc with netapi32?

I just try build this example for GCC. But I got several problems. My system is: Win10 msys64 with ucrt64…
Archy
  • 3
  • 1
0
votes
0 answers

NetGroupGetUsers only ever returns NERR_GroupNotFound (2220)

I am trying to call the Winapi function NetGroupGetUsers: The NetGroupGetUsers function retrieves a list of the members in a particular global group in the security database, which is the security accounts manager (SAM) database or, in the case of…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
0
votes
1 answer

.net multiple databases with single dbcontext and repository

I'm trying to implement a way to have multiple databases (identical databases, all have same tables etc.) but I need them to be separate thus multiple DBs. Is there a way to have a single DBContext and repository pattern that can interact with all…
0
votes
0 answers

NetFileEnum is being inconsistent, occasionally returns no data

I am working on a C++ application that detects changes happening on a shared folder (using ReadDirectoryChangesW) and call NetFileEnum on that modified file/folder. This way, I know the possible candidates modifying file/folder. According to…
Praveen
  • 73
  • 2
  • 5
0
votes
1 answer

Call unmanaged code from c#. Getting data using IntPtr

I have a strange problem with application that I'm currently writing. I'm pretty sure i haven't changed anything within the below code recently, but somehow it stopped working. To the point. I'm using: [DllImport("NetApi32.dll", SetLastError =…
0
votes
1 answer

Access denied while using NetServerEnum from NetApi32

I am trying to use the NetServerEnum function from the NetApi32 dll, but all I am getting is the error code 5: "Access was denied.". Below is my call to the external dll function. NetError nEr; SERVER_TYPE type = SERVER_TYPE.SV_TYPE_WORKSTATION |…
Mark
  • 158
  • 8
0
votes
0 answers

Receive Call with TAPI3 in delphi

When I program tapi3 in delphi 7 using the code below, I can make a outgoing call, but I can't catch any events. Has anybody face the same problem ? unit Unit10; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,…
0
votes
1 answer

JNA - DsGetDcNameA

I am new to JNA, I want to convert DsGetDcName method to JNA. DWORD DsGetDcName( __in LPCTSTR ComputerName, __in LPCTSTR DomainName, __in GUID *DomainGuid, __in LPCTSTR SiteName, __in ULONG Flags, __out PDOMAIN_CONTROLLER_INFO…
0
votes
1 answer

NetServerEnum create Worker Threads who won't close

While trying to solve a previously asked SO question of mine, I've find that even without my threads, the problem occurs. what I have now , is a really simple single-threaded code , that calls - NetServerEnum() . when returned, it calls…
0
votes
2 answers

Trouble accessing functions of NetAPI32 wrapped in WCF that create users

I have created a project which is basically described as a consumable service to create or edit users on a remote computer. The idea is to connect to a server and add a user. The structure of the project is as follows: WCF Service: to expose…
hamish
1
2