formatting

This commit is contained in:
Mr. eXoDia 2014-07-25 22:37:28 +02:00
parent d6cb3e584b
commit b350775721
3 changed files with 27 additions and 26 deletions

View File

@ -120,7 +120,7 @@ __declspec(dllexport) void* TITCALL HandlerGetHandleNameW(HANDLE hProcess, DWORD
} }
} }
pHandle++; pHandle++;
} }
if(!NameFound) if(!NameFound)

View File

@ -252,7 +252,8 @@ typedef struct _PROCESS_BASIC_INFORMATION
} PROCESS_BASIC_INFORMATION; } PROCESS_BASIC_INFORMATION;
typedef PROCESS_BASIC_INFORMATION *PPROCESS_BASIC_INFORMATION; typedef PROCESS_BASIC_INFORMATION *PPROCESS_BASIC_INFORMATION;
typedef struct _THREAD_BASIC_INFORMATION { typedef struct _THREAD_BASIC_INFORMATION
{
NTSTATUS ExitStatus; NTSTATUS ExitStatus;
PVOID TebBaseAddress; PVOID TebBaseAddress;
CLIENT_ID ClientId; CLIENT_ID ClientId;

View File

@ -1,24 +1,24 @@
#include <windows.h> #include <windows.h>
wchar_t szLibraryPath[512]; wchar_t szLibraryPath[512];
int main() int main()
{ {
memset(szLibraryPath, 0, sizeof(szLibraryPath)); memset(szLibraryPath, 0, sizeof(szLibraryPath));
wchar_t szName[256]=L""; wchar_t szName[256]=L"";
wsprintfW(szName, L"Global\\szLibraryName%X", (unsigned int)GetCurrentProcessId()); wsprintfW(szName, L"Global\\szLibraryName%X", (unsigned int)GetCurrentProcessId());
HANDLE hMapFile=OpenFileMappingW(FILE_MAP_READ, false, szName); HANDLE hMapFile=OpenFileMappingW(FILE_MAP_READ, false, szName);
if(hMapFile) if(hMapFile)
{ {
const wchar_t* szLibraryPathMapping=(const wchar_t*)MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, sizeof(szLibraryPath)); const wchar_t* szLibraryPathMapping=(const wchar_t*)MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, sizeof(szLibraryPath));
if(szLibraryPathMapping) if(szLibraryPathMapping)
{ {
lstrcpyW(szLibraryPath, szLibraryPathMapping); lstrcpyW(szLibraryPath, szLibraryPathMapping);
UnmapViewOfFile(szLibraryPathMapping); UnmapViewOfFile(szLibraryPathMapping);
} }
CloseHandle(hMapFile); CloseHandle(hMapFile);
} }
if(szLibraryPath[0]) if(szLibraryPath[0])
return (LoadLibraryW(szLibraryPath)!=NULL); return (LoadLibraryW(szLibraryPath)!=NULL);
return 0; return 0;
} }