¡@

Home 

c# Programming Glossary: marshal.getlastwin32error

Detect if running as Administrator with or without elevated privileges?

http://stackoverflow.com/questions/1220213/detect-if-running-as-administrator-with-or-without-elevated-privileges

Could not get process token. Win32 Error Code Marshal.GetLastWin32Error TOKEN_ELEVATION_TYPE elevationResult TOKEN_ELEVATION_TYPE.TokenElevationTypeDefault..

Win32 API function to programmatically enable/disable device

http://stackoverflow.com/questions/1438371/win32-api-function-to-programmatically-enable-disable-device

index sb sb.Capacity out requiredSize if result false Marshal.GetLastWin32Error ERROR_INSUFFICIENT_BUFFER sb.Capacity requiredSize result.. handle ref diData if result false int err Marshal.GetLastWin32Error if err int SetupApiError.NotDisableable throw new ArgumentException..

Get timestamp from Authenticode Signed files in .NET

http://stackoverflow.com/questions/3281057/get-timestamp-from-authenticode-signed-files-in-net

ref cryptMsg ref context throw new Win32Exception Marshal.GetLastWin32Error expecting contentType 10 CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED.. 0 IntPtr.Zero ref cbData throw new Win32Exception Marshal.GetLastWin32Error var vData new byte cbData Get the encoded message. if WinCrypt.CryptMsgGetParam.. 0 vData ref cbData throw new Win32Exception Marshal.GetLastWin32Error var signedCms new SignedCms signedCms.Decode vData foreach..

Kill child process when parent process is killed

http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed

Exception string.Format Unable to set information. Error 0 Marshal.GetLastWin32Error #region IDisposable Members public void Dispose Dispose true..

Using Process.Start() to start a process as a different user from within a Windows Service

http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo

out token if result int winError Marshal.GetLastWin32Error string commandLine null #region security attributes SECURITY_ATTRIBUTES.. ref sd true IntPtr.Zero false if result int winError Marshal.GetLastWin32Error primaryToken new IntPtr result DuplicateTokenEx token 0 ref.. out primaryToken if result int winError Marshal.GetLastWin32Error processAttributes.SecurityDescriptor ptr processAttributes.Length..

How do I disable a system device programatically?

http://stackoverflow.com/questions/4097000/how-do-i-disable-a-system-device-programatically

info i out devdata if no items match filter throw if Marshal.GetLastWin32Error ERROR_NO_MORE_ITEMS CheckError No device found matching filter... string message int lasterror 1 int code lasterror 1 Marshal.GetLastWin32Error lasterror if code 0 throw new ApplicationException String.Format.. Marshal.Copy buffer lbuffer 0 int outsize int errcode Marshal.GetLastWin32Error if errcode ERROR_INVALID_DATA return null CheckError SetupDiGetDeviceProperty..

Changing text color in C# Console Application

http://stackoverflow.com/questions/7937256/changing-text-color-in-c-sharp-console-application

7 if hConsoleOutput INVALID_HANDLE_VALUE return Marshal.GetLastWin32Error bool brc GetConsoleScreenBufferInfoEx hConsoleOutput ref csbe.. hConsoleOutput ref csbe if brc return Marshal.GetLastWin32Error switch color case ConsoleColor.Black csbe.black new COLORREF.. hConsoleOutput ref csbe if brc return Marshal.GetLastWin32Error return 0 public static int SetScreenColors Color foregroundColor..