Skip to content

Commit

Permalink
create optional shim for elevated processes (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
cracyc authored Jan 26, 2023
1 parent 20373f9 commit ab47e9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions krnl386/ne_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,13 +1359,15 @@ HANDLE WINAPI LoadModule_wine_implementation(LPCSTR name, LPVOID paramBlock, HAN
#endif
if (error == ERROR_ELEVATION_REQUIRED)
{
char exename[MAX_PATH];
int len = krnl386_get_config_string("otvdm", "ElevationShim", "", exename, sizeof(exename));
SHELLEXECUTEINFOA sei = { 0 };
sei.cbSize = sizeof(sei);
sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_CLASSNAME | SEE_MASK_WAITFORINPUTIDLE;
sei.lpFile = filename;
sei.lpParameters = p;
sei.lpFile = len ? exename : filename;
sei.lpParameters = len ? cmdline : p;
sei.nShow = startup.dwFlags ? startup.wShowWindow : SW_NORMAL;
sei.lpVerb = "open";
sei.lpVerb = "runas";
sei.lpClass = "exefile";
if (ShellExecuteExA(&sei))
*result = sei.hProcess;
Expand Down
6 changes: 5 additions & 1 deletion otvdm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@
;font name=1(enumerated)/0(not enumerated)
;MS Serif=1
;Webdings=0
;

; Run a compatibility shim for elevated processes
; isfixload will shim installshield which calls sendmessagea(HWND_BROADCAST) which can hang if there
; is a process not servicing it's message queue
;ElevationShim=isfixload.exe

0 comments on commit ab47e9a

Please sign in to comment.