netapi32

NetServerEnum create Worker Threads who won't close

别等时光非礼了梦想. 提交于 2020-01-01 19:52:27
问题 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 NetApiBufferFree() and return from main, which supposed to end the process. at that point, my thread truly ends, but the process won't exit , as there are 4 threads opened (not by me): 1 * ntdll.dll!TplsTimerSet+0x7c0 (stack is at ntdll.dll

How do I manage Windows User Accounts in Go?

邮差的信 提交于 2019-12-21 20:14:36
问题 I need to be able to manage Windows Local User Accounts from a Go application and it appears that without using CGo, there are no native bindings. My initial search led me to people saying it was best to use "exec.Command" to run the "net user" command, but that seems messy and unreliable when it comes to parsing the response codes. I've found the functions to handle this type of thing are in the netapi32.dll library, but with Go not natively supporting the Windows header files, it doesn't

Get Username of an Accesed File

半腔热情 提交于 2019-12-18 09:48:05
问题 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 perfect, because there are a lot of file events and the eventlog messages are not so detailed. there is just one eventd id for write data. this it is used for add file, rename , move,... every write data. Additionally I had to crosscheck that the

NetServerEnum block when thread is terminated externaly

☆樱花仙子☆ 提交于 2019-12-11 13:04:35
问题 (Working in Win32 api , in C environment with VS2010) I have a two thread app. The first thread forks the second and waits for a given interval - 'TIMEOUT', and then calls TerminateThread() on it. Meanwhile, second thread calls NetServerEnum() . It appears that when timeout is reached , whether NetServerEnum returned successfully or not, the first thread get deadlocked. I've already noticed that NetServerEnum creates worker threads of it's own. I ultimately end up with one of those threads in

How do I manage Windows User Accounts in Go?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 14:55:53
I need to be able to manage Windows Local User Accounts from a Go application and it appears that without using CGo, there are no native bindings. My initial search led me to people saying it was best to use "exec.Command" to run the "net user" command, but that seems messy and unreliable when it comes to parsing the response codes. I've found the functions to handle this type of thing are in the netapi32.dll library, but with Go not natively supporting the Windows header files, it doesn't appear easy to call those functions. Taking an example from https://github.com/golang/sys/tree/master