summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
116dfc5)
svn path=/trunk/; revision=75359
- * Copyright 2015-2017 Mark Jansen
+ * Copyright 2015-2017 Mark Jansen (mark.jansen@reactos.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
TAGID ShimRef;
if (SdbTagRefToTagID(hsdb, Data[n], &pdb, &ShimRef))
{
TAGID ShimRef;
if (SdbTagRefToTagID(hsdb, Data[n], &pdb, &ShimRef))
{
- LPCWSTR ShimName, DllName;
+ LPCWSTR ShimName, DllName, CommandLine = NULL;
TAGID ShimTag;
WCHAR FullNameBuffer[MAX_PATH];
UNICODE_STRING UnicodeDllName;
PVOID BaseAddress;
PSHIMMODULE pShimInfo = NULL;
TAGID ShimTag;
WCHAR FullNameBuffer[MAX_PATH];
UNICODE_STRING UnicodeDllName;
PVOID BaseAddress;
PSHIMMODULE pShimInfo = NULL;
- const char* szCommandLine = "";
+ ANSI_STRING AnsiCommandLine = RTL_CONSTANT_STRING("");
PHOOKAPIEX pHookApi;
DWORD dwHookCount;
PHOOKAPIEX pHookApi;
DWORD dwHookCount;
+ CommandLine = SeiGetStringPtr(pdb, ShimRef, TAG_COMMAND_LINE);
+ if (CommandLine && *CommandLine)
+ {
+ RtlInitUnicodeString(&UnicodeDllName, CommandLine);
+ if (NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiCommandLine, &UnicodeDllName, TRUE)))
+ {
+ SHIMENG_INFO("COMMAND LINE %s for %S", AnsiCommandLine.Buffer, ShimName);
+ }
+ else
+ {
+ AnsiCommandLine.Buffer = "";
+ CommandLine = NULL;
+ }
+ }
+
ShimTag = SeiGetDWORD(pdb, ShimRef, TAG_SHIM_TAGID);
if (!ShimTag)
{
ShimTag = SeiGetDWORD(pdb, ShimRef, TAG_SHIM_TAGID);
if (!ShimTag)
{
- /* TODO:
- SeiGetShimCommandLine();
- [SeiInit] COMMAND_LINE VirtualRegistry(WINNT;VistaRTMLie) from AcLayers.DLL
- */
-
RtlInitUnicodeString(&UnicodeDllName, FullNameBuffer);
if (NT_SUCCESS(LdrGetDllHandle(NULL, NULL, &UnicodeDllName, &BaseAddress)))
{
RtlInitUnicodeString(&UnicodeDllName, FullNameBuffer);
if (NT_SUCCESS(LdrGetDllHandle(NULL, NULL, &UnicodeDllName, &BaseAddress)))
{
SHIMENG_INFO("Shim DLL 0x%p \"%wZ\" loaded\n", BaseAddress, &UnicodeDllName);
SHIMENG_INFO("Using SHIM \"%S!%S\"\n", DllName, ShimName);
SHIMENG_INFO("Shim DLL 0x%p \"%wZ\" loaded\n", BaseAddress, &UnicodeDllName);
SHIMENG_INFO("Using SHIM \"%S!%S\"\n", DllName, ShimName);
-
- pHookApi = pShimInfo->pGetHookAPIs(szCommandLine, ShimName, &dwHookCount);
+ pHookApi = pShimInfo->pGetHookAPIs(AnsiCommandLine.Buffer, ShimName, &dwHookCount);
SHIMENG_INFO("GetHookAPIs returns %d hooks for DLL \"%wZ\" SHIM \"%S\"\n", dwHookCount, &UnicodeDllName, ShimName);
if (dwHookCount)
SeiAppendHookInfo(pShimInfo, pHookApi, dwHookCount);
SHIMENG_INFO("GetHookAPIs returns %d hooks for DLL \"%wZ\" SHIM \"%S\"\n", dwHookCount, &UnicodeDllName, ShimName);
if (dwHookCount)
SeiAppendHookInfo(pShimInfo, pHookApi, dwHookCount);
+ if (CommandLine && *CommandLine)
+ RtlFreeAnsiString(&AnsiCommandLine);
+
dwTotalHooks += dwHookCount;
/*SeiBuildInclExclList*/
}
dwTotalHooks += dwHookCount;
/*SeiBuildInclExclList*/
}