Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize fails when 'GetModuleFileName' returns a path beginning with "\\?\" #7

Open
Ummon opened this issue Apr 2, 2023 · 0 comments

Comments

@Ummon
Copy link

Ummon commented Apr 2, 2023

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';
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant