Bug 748764 - LoadlibraryEx and quoted string fix for service. r=rstrong, a=ehsan.

This commit is contained in:
Brian R. Bondy 2012-05-02 15:40:28 -04:00
parent 9dfce8b1b6
commit 3cec0d3c87
2 changed files with 4 additions and 1 deletions

View File

@ -404,6 +404,8 @@ SvcInstall(SvcInstallAction action)
return TRUE;
}
// Quote the path only if it contains spaces.
PathQuoteSpaces(newServiceBinaryPath);
// The service does not already exist so create the service as on demand
schService.own(CreateServiceW(schSCManager, SVC_NAME, SVC_DISPLAY_NAME,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,

View File

@ -326,7 +326,8 @@ ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv)
// Check to make sure the udpater.exe module has the unique updater identity.
// This is a security measure to make sure that the signed executable that
// we will run is actually an updater.
HMODULE updaterModule = LoadLibrary(argv[0]);
HMODULE updaterModule = LoadLibraryEx(argv[0], NULL,
LOAD_LIBRARY_AS_DATAFILE);
if (!updaterModule) {
LOG(("updater.exe module could not be loaded. (%d)\n", GetLastError()));
result = FALSE;