Skip to content

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

@Ummon

Description

@Ummon

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';
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions