mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
[RUNDLL32] -Load and activate the manifest of the hosted dll before loading the library.
svn path=/trunk/; revision=73799
This commit is contained in:
parent
c2c30fe940
commit
18d52d4336
1 changed files with 15 additions and 0 deletions
|
@ -346,6 +346,11 @@ int WINAPI _tWinMain(
|
||||||
int i;
|
int i;
|
||||||
size_t nStrLen;
|
size_t nStrLen;
|
||||||
|
|
||||||
|
ACTCTXW ActCtx = {sizeof(ACTCTX), ACTCTX_FLAG_RESOURCE_NAME_VALID};
|
||||||
|
HANDLE hActCtx;
|
||||||
|
ULONG_PTR cookie;
|
||||||
|
BOOL bActivated;
|
||||||
|
|
||||||
// Get command-line in argc-argv format
|
// Get command-line in argc-argv format
|
||||||
argv = CommandLineToArgv(GetCommandLine(),&argc);
|
argv = CommandLineToArgv(GetCommandLine(),&argc);
|
||||||
|
|
||||||
|
@ -381,6 +386,11 @@ int WINAPI _tWinMain(
|
||||||
else
|
else
|
||||||
lptCmdLine = _T("");
|
lptCmdLine = _T("");
|
||||||
|
|
||||||
|
ActCtx.lpSource = lptDllName;
|
||||||
|
ActCtx.lpResourceName = (LPCWSTR)123;
|
||||||
|
hActCtx = CreateActCtx(&ActCtx);
|
||||||
|
bActivated = (hActCtx != INVALID_HANDLE_VALUE ? ActivateActCtx(hActCtx, &cookie) : FALSE);
|
||||||
|
|
||||||
// Everything is all setup, so load the dll now
|
// Everything is all setup, so load the dll now
|
||||||
hDll = LoadLibrary(lptDllName);
|
hDll = LoadLibrary(lptDllName);
|
||||||
if (hDll) {
|
if (hDll) {
|
||||||
|
@ -429,6 +439,8 @@ int WINAPI _tWinMain(
|
||||||
if (!RegisterBlankClass(hInstance, hPrevInstance))
|
if (!RegisterBlankClass(hInstance, hPrevInstance))
|
||||||
{
|
{
|
||||||
FreeLibrary(hDll);
|
FreeLibrary(hDll);
|
||||||
|
if (bActivated)
|
||||||
|
DeactivateActCtx(0, cookie);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Create a window so we can pass a window handle to
|
// Create a window so we can pass a window handle to
|
||||||
|
@ -476,6 +488,9 @@ int WINAPI _tWinMain(
|
||||||
free(lptMsgBuffer);
|
free(lptMsgBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bActivated)
|
||||||
|
DeactivateActCtx(0, cookie);
|
||||||
|
|
||||||
if (argv) free(argv);
|
if (argv) free(argv);
|
||||||
return 0; /* rundll32 always returns 0! */
|
return 0; /* rundll32 always returns 0! */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue