win32exception

access denied trying extracting an archive on the windows user temp folder

I'm trying to run a command-line process (which is extraction of a .7z archive) on a file that lies in a temporary folder on the windows user temp directory (C:\Documents and Settings\User\Local Settings\Temp), using Process in my c# app. I think the process return error that happens because of "access denied" because I can see a win32E...

Win32Exception Not enough storage is available to process this command

Through my automated crash collection for MaxTo I got the following crash report: V8.12.0.0 - System.ComponentModel.Win32Exception - :Void UpdateLayered():0 Version: MaxTo8.12.0.0 Exception: System.ComponentModel.Win32Exception Error message: Not enough storage is available to process this command Stack trace: at System.Windows.Forms...

Throwing a Win32Exception

I've been writing a lot of code recently that involves interop with the Win32 API and have been starting to wonder what's the best way to deal with native (unmanaged) errors that are caused by calls to Windows API functions. Currently, the calls to native functions look something like this: // NativeFunction returns true when successfu...

Win32Exception: The directory name is invalid

I'm trying to run a process as a different user that has Administrator privilege in 2 different computers running Vista and their UAC enabled but in one of them I get a Win32Exception that says "The directory name is invalid" Can anyone tell me what is wrong with my code? var myFile = "D:\\SomeFolder\\MyExecutable.exe"; var workingFold...

System.ComponentModel.Win32Exception: The operation completed successfully

I am getting this exception sometimes while running my Windows Forms app for a long time: System.ComponentModel.Win32Exception: The operation completed successfully at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits) at System.Drawing.BufferedGraphi...

C#: Eventlog, impersonation and Access Denied Win32Exception

Hi, I am using a dedicated account (with SDDL policy) to write event log entries to a custom event log. For this I use WindowsImpersonationContext and obtain a token with LogonUser: WindowsIdentity impersonationIdentity = new WindowsIdentity(ptr); WindowsImpersonationContext impersonationContext = impersonationIdentity.Impe...

HRESULT exceptions

Is there any lists where the error codes are explained. Eks: HRESULT: 0x81070215 does not tell me enything about what when wrong? ...

Why does .NET not clear errors internally?

I am running the following scenerio: SafeFileHandle handle = Win32API.CreateFile((deviceName + "\\" + pipeName), DesiredAccess.GENERIC_WRITE | DesiredAccess.GENERIC_READ, ShareMode.FILE_SHARE_WRITE | ShareMode.FILE_SHARE_READ, IntPtr.Zero, ...

Win32Exception @ ServiceHost.Open() for WCF service...

I am working on writing BDD specifications for a broad set of WCF service infrastructure I am writing. I have noticed that each specification I write that involves a call to ServiceHost.Open(), that line takes a good 2 - 6 seconds to execute (the time keeps growing as I add more and more specs). I noticed that when this method is called,...

PrintDocument.Print() throws a Win32Exception

Hi, I'm getting a strange exception from the following code: var printDialog = new PrintDialog(); printDialog.ShowDialog(); var printDocument = new PrintDocument { DefaultPageSettings = { Landscape = true, PrinterSettings = new PrinterSettings { PrinterName = printDialog.PrintQueue.Name } } }; var updateRe...

Exception on printing: The device is not ready

I have a report document created by Microsoft Reporting but instead of using its viewer to show the document and print it, I used PrintDocument class to print it directly without showing user any windows. It worked perfectly until I installed a thermal printer and disabled its Spooler. Now once in a while i receive a Win32Exception ind...

No application is associated with the specified file exception

UnhandledException: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at System.Dia...

Unhandled Win32 exception

At runtime, when myApp.exe crashes i receive "Unhandled Win32 exception" but how would i know which exception was occurred? where did something went wrong? ...

Access denied while getting process path

Hello, I am trying to get process path by pid but I'm getting Win32Exception (access id denied). The code looks like this: string path = Process.GetProcessById(pid).MainModule.FileName I have tried using OpenProcess with GetModuleFileNameEx but OpenProcess is returning 0. I even tried enabling SeDebugPrivilege according to C# – How ...