Matthew Webster Posted September 23, 2005 Posted September 23, 2005 I have been trying to get the code found here working: http://pinvoke.net/default.aspx/secur32.LsaLogonUser Does anyone have any insight into this? Quote
Administrators PlausiblyDamp Posted September 23, 2005 Administrators Posted September 23, 2005 Does it give any errors? How exactly is it not working? Are you using exactly that code or has it been modified in any way? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Matthew Webster Posted September 23, 2005 Author Posted September 23, 2005 Sorry, I wholly intended to put my error in; when it came to it my mind was elsewhere... At line: 332 (in my listing) if (status != OSCalls.WinStatusCodes.STATUS_SUCCESS) throw new System.ComponentModel.Win32Exception((int)OSCalls.LsaNtStatusToWinError(status)); // ERROR HERE !!! if (profileBuffer != IntPtr.Zero) OSCalls.LsaFreeReturnBuffer(profileBuffer); } Error thrown in output window: 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded. 'BtLock': Loaded 'C:\Projects\BtLock\bin\Debug\BtLock.exe', Symbols loaded. 'BtLock.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded. An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in BtLock.exe Additional information: A logon request contained an invalid logon type value Unhandled Exception: System.ComponentModel.Win32Exception: A logon request contained an invalid logon type value at BtLock.HandleSecurityToken..ctor(String UserName, String Domain, WinLogonType LogonType) in c:\projects\btlock\unlock.cs:line 332 at BtLock.CCWinLogonUtilities.CreateIdentityS4U(NetworkCredential credential, WinLogonType logonType) in c:\projects\btlock\unlock.cs:line 432 at BtLock.Lock.Main(String[] args) in C:\Projects\BtLock\Lock.cs:line 20The program '[292] BtLock.exe' has exited with code 0 (0x0). Quote
Recommended Posts