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

mumble_exe: when using a versioned root, set the CWD to it. #2838

Merged
merged 1 commit into from Feb 11, 2017

Conversation

@mkrautz
Copy link
Member

commented Feb 11, 2017

Previously, we always used the directory holding mumble.exe
as the working directory.

This commit changes that to use the versioned root directory
as the working directory -- if we're using one.
When not using a versioned root directory, the old behavior
is kept intact.

This is primarily done to work around #2837,
where, when loading mumble_app.dll, the search order for ucrtbase.dll
seems to be using the "Standard Search Order for Desktop Applications"
instead of the "Alternate Search ORder for Desktop Applications", as it
should when we specify LOAD_WITH_ALTERED_SEARCH_PATH to LoadLibraryEx.

For context, see the following MSDN page:
https://msdn.microsoft.com/en-us/library/ms682586.aspx

Changing the working directory to the versioned root path allows
the Universal CRT to be correctly loaded -- via step 5 of the "Standard
Search Order for Desktop Applications" if SafeDllSearchMode is on --
despite this weird behavior from the system.

@mkrautz mkrautz requested review from Kissaki and hacst Feb 11, 2017

mumble_exe: when using a versioned root, set the CWD to it.
Previously, we always used the directory holding mumble.exe
as the working directory.

This commit changes that to use the versioned root directory
as the working directory -- if we're using one.
When not using a versioned root directory, the old behavior
is kept intact.

This is primarily done to work around #2837,
where, when loading mumble_app.dll on Windows 7, the search order
for ucrtbase.dll seems to be using the "Standard Search Order for
Desktop Applications" instead of the "Alternate Search Order for
Desktop Applications", as it should when we specify
LOAD_WITH_ALTERED_SEARCH_PATH to LoadLibraryEx.

For context, see the following MSDN page:
https://msdn.microsoft.com/en-us/library/ms682586.aspx

Changing the working directory to the versioned root path allows
the Universal CRT to be correctly loaded -- via step 5 of the "Standard
Search Order for Desktop Applications" if SafeDllSearchMode is on --
despite this weird behavior from the system.

Works around #2837

MS Connect issue:
https://connect.microsoft.com/VisualStudio/feedback/details/3121208

@mkrautz mkrautz force-pushed the mkrautz:versioned-root-cwd branch from 50a2c36 to 03cfe38 Feb 11, 2017

@mkrautz mkrautz merged commit 289d0d4 into mumble-voip:master Feb 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.