WinRing0
WinRing0 copied to clipboard
Initialize fails when 'GetModuleFileName' returns a path beginning with "\\?\"
Function: Initialize
Depending of the shell you are using, GetModuleFileName
may returns a path beginning with "\?"1. For example:
\\?\C:\Users\greg\Projects\
In this case, the function IsOnNetworkDrive
will return 'true' and thus DWORD Initialize()
will return 'OLS_DLL_DRIVER_NOT_FOUND'.
This happens with nushell2
I wrote a quick hack (I'm not a c expert) right before wsprintf(gDriverPath, _T("%s\\%s"), dir, gDriverFileName);
:
if ((ptr = _tcsstr(dir, "\\\\?\\")) != NULL)
{
int l = _tcslen(dir) - 4;
memmove(dir, dir + 4, l);
dir[l] = '\0';
}