PDA

Click to See Complete Forum and Search --> : LogonUser & Impersonate user


Tryster
Jan 12th, 2001, 11:12 AM
I have a WinNT Service which is running under the System Account. As such all processes called by this service inherit these User details. My problem is that the service calls a process that uses Named Pipes and the System Account does not have network priviledges. For various reasons I cannot use the NullSessionPipes and AllowNullSessionPipes registry settings and I cannot change the User Account that the Service is running under.

I have found the LogonUser & Impersonate user API functions and decided these could be my solution. I have got the LogonUser function to work and used the returned token to call the ImpersonateUser function, which also seems to work.

My problem is that after the ImpersonateUser function is set up a call is made to a DLL and within that DLL method is an object definition which basically calls the CreateObject function to create a reference to a 16Bit OLEServer app. The problem is when it calls the DLL I get an error message from ntvdm.exe stating: "Initialisation of theDynamic Link Library C:\WINNI\System32\KERNEL32.dll failed. The process is terminating abnormally"

I know that the code is OK because I have run it after changing the Service's User Account details and it runs fine!