Changeset 1153 for trunk/eraser6
- Timestamp:
- 7/1/2009 11:31:34 AM (4 years ago)
- Location:
- trunk/eraser6
- Files:
-
- 2 edited
-
Eraser/Program.cs (modified) (1 diff)
-
ShellExt/CtxMenu.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser/Program.cs
r1137 r1153 93 93 94 94 return 0; 95 } 96 catch (UnauthorizedAccessException) 97 { 98 return 5; //ERROR_ACCESS_DENIED 95 99 } 96 100 catch (Win32Exception e) -
trunk/eraser6/ShellExt/CtxMenu.cpp
r1148 r1153 846 846 DWORD exitCode = 0; 847 847 848 if (GetExitCodeProcess(processInfo.hProcess, &exitCode) && exitCode) 849 { 850 char buffer[8192]; 851 DWORD lastRead = 0; 852 std::wstring output; 853 854 while (ReadFile(readPipe, buffer, sizeof(buffer), &lastRead, NULL) && lastRead != 0) 848 if (GetExitCodeProcess(processInfo.hProcess, &exitCode)) 849 if (exitCode == ERROR_ACCESS_DENIED) 855 850 { 856 size_t lastConvert = 0; 857 wchar_t wBuffer[8192]; 858 if (!mbstowcs_s(&lastConvert, wBuffer, sizeof(wBuffer) / sizeof(wBuffer[0]), 859 buffer, lastRead)) 851 //The spawned instance could not connect with the master instance 852 //because it is running as an administrator. Spawn the new instance 853 //again, this time as an administrator 854 RunEraser(action, parameters, true, parent, show); 855 } 856 else if (exitCode) 857 { 858 char buffer[8192]; 859 DWORD lastRead = 0; 860 std::wstring output; 861 862 while (ReadFile(readPipe, buffer, sizeof(buffer), &lastRead, NULL) && lastRead != 0) 860 863 { 861 output += std::wstring(wBuffer, lastConvert); 864 size_t lastConvert = 0; 865 wchar_t wBuffer[8192]; 866 if (!mbstowcs_s(&lastConvert, wBuffer, sizeof(wBuffer) / sizeof(wBuffer[0]), 867 buffer, lastRead)) 868 { 869 output += std::wstring(wBuffer, lastConvert); 870 } 862 871 } 872 873 //Show the error message. 874 throw output; 863 875 } 864 865 //Show the error message.866 throw output;867 }868 876 } 869 877 }
Note: See TracChangeset
for help on using the changeset viewer.
