Juan Lang wrote:
Folks, I'm looking for advice on implementing DeviceIoControl for vnetbios. It's pretty simple, lpvInBuffer is a pointer to an NCB, the only parameter to Netbios().
Trouble is, I implemented Netbios() with some state, all maintained in netapi32.dll. I need to load netapi32.dll, and keep it open as long as the handle to vnetbios is open (if I close netapi32, the state is lost).
I could:
- use a static HANDLE to netapi32.dll in kernel
- store the handle in the server
- move all the netbios code to kernel, and use
DeviceIoControl to call it from netapi32
Anyone have any suggestions or preferences? Thanks, --Juan
why don't you, in kernel/device.c, the first time DeviceIoControl is called upon vnetbios load netapi32 (or at each call to this VxD ensure that netapi32 is loaded) this will keep netapi32 in memory (from kernel32), and don't bother closing it.
A+