mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[ROSAPPS] Remove 'chklib' utility
This commit is contained in:
parent
271a54282e
commit
f1519ec1b6
4 changed files with 0 additions and 211 deletions
|
@ -1,4 +1,3 @@
|
|||
add_subdirectory(chklib)
|
||||
add_subdirectory(ctm)
|
||||
add_subdirectory(fontsub)
|
||||
add_subdirectory(gettype)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
add_executable(chklib chklib.c chklib.rc)
|
||||
set_module_type(chklib win32cui)
|
||||
target_link_libraries(chklib win32err)
|
||||
add_importlibs(chklib msvcrt kernel32)
|
||||
add_cd_file(TARGET chklib DESTINATION reactos/system32 FOR all)
|
|
@ -1,199 +0,0 @@
|
|||
/*
|
||||
* chklib.c
|
||||
*
|
||||
* Copyright (C) 1998, 1999 Emanuele Aliberti.
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
*
|
||||
* This software is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this software; see the file COPYING. If
|
||||
* not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
* Cambridge, MA 02139, USA.
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
* Check a PE DLL for loading and get an exported symbol's address
|
||||
* (relocated).
|
||||
*
|
||||
*/
|
||||
//#define UNICODE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
#include "../win32err.h"
|
||||
|
||||
#ifdef DISPLAY_VERSION
|
||||
static
|
||||
void
|
||||
DisplayVersion(
|
||||
HANDLE dll,
|
||||
PCHAR ModuleName
|
||||
)
|
||||
{
|
||||
DWORD Zero;
|
||||
DWORD Size;
|
||||
PVOID vi = NULL;
|
||||
|
||||
assert(ModuleName);
|
||||
Size = GetFileVersionInfoSize(
|
||||
ModuleName,
|
||||
& Zero
|
||||
);
|
||||
if (Size == 0)
|
||||
{
|
||||
PrintWin32Error(
|
||||
L"GetFileVersionInfoSize",
|
||||
GetLastError()
|
||||
);
|
||||
return;
|
||||
}
|
||||
vi = (PVOID) LocalAlloc(LMEM_ZEROINIT,Size);
|
||||
if (!vi) return;
|
||||
assert(dll != INVALID_HANDLE_VALUE);
|
||||
if (0 == GetFileVersionInfo(
|
||||
ModuleName,
|
||||
(DWORD) dll,
|
||||
Size,
|
||||
vi
|
||||
)
|
||||
) {
|
||||
PrintWin32Error(
|
||||
L"GetFileVersionInfo",
|
||||
GetLastError()
|
||||
);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
VerQueryValue(
|
||||
vi,
|
||||
L"\\StringFileInfo\\040904E4\\FileDescription",
|
||||
& lpBuffer,
|
||||
& dwBytes
|
||||
);
|
||||
*/
|
||||
LocalFree(vi);
|
||||
}
|
||||
#endif /* def DISPLAY_VERSION */
|
||||
|
||||
|
||||
static
|
||||
void
|
||||
DisplayEntryPoint(
|
||||
const HANDLE dll,
|
||||
LPCSTR SymbolName
|
||||
)
|
||||
{
|
||||
FARPROC EntryPoint;
|
||||
|
||||
printf(
|
||||
"[%s]\n",
|
||||
SymbolName
|
||||
);
|
||||
EntryPoint = GetProcAddress(
|
||||
dll,
|
||||
SymbolName
|
||||
);
|
||||
if (!EntryPoint)
|
||||
{
|
||||
PrintWin32Error(
|
||||
L"GetProcAddress",
|
||||
GetLastError()
|
||||
);
|
||||
return;
|
||||
}
|
||||
printf(
|
||||
"0x%p %s\n",
|
||||
EntryPoint,
|
||||
SymbolName
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* --- MAIN --- */
|
||||
|
||||
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char * argv []
|
||||
)
|
||||
{
|
||||
HINSTANCE dll;
|
||||
TCHAR ModuleName [_MAX_PATH];
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf(
|
||||
stderr,
|
||||
"\
|
||||
ReactOS System Tools\n\
|
||||
Check a Dynamic Link Library (DLL) for loading\n\
|
||||
Copyright (c) 1998, 1999 Emanuele Aliberti\n\n\
|
||||
usage: %s module [symbol [, ...]]\n",
|
||||
argv[0]
|
||||
);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
dll = LoadLibraryA(argv[1]);
|
||||
if (!dll)
|
||||
{
|
||||
UINT LastError;
|
||||
|
||||
LastError = GetLastError();
|
||||
PrintWin32Error(L"LoadLibrary",LastError);
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s: loading %s failed (%d).\n",
|
||||
argv[0],
|
||||
argv[1],
|
||||
LastError
|
||||
);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
GetModuleFileName(
|
||||
(HANDLE) dll,
|
||||
ModuleName,
|
||||
sizeof ModuleName
|
||||
);
|
||||
printf(
|
||||
"%s loaded.\n",
|
||||
ModuleName
|
||||
);
|
||||
#ifdef DISPLAY_VERSION
|
||||
DisplayVersion(dll,ModuleName);
|
||||
#endif
|
||||
if (argc > 2)
|
||||
{
|
||||
int CurrentSymbol;
|
||||
|
||||
for ( CurrentSymbol = 2;
|
||||
(CurrentSymbol < argc);
|
||||
++CurrentSymbol
|
||||
)
|
||||
{
|
||||
DisplayEntryPoint( dll, argv[CurrentSymbol] );
|
||||
}
|
||||
}
|
||||
FreeLibrary(dll);
|
||||
printf(
|
||||
"%s unloaded.\n",
|
||||
ModuleName
|
||||
);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Tool to check a dynamic library for a symbol\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "chklib\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "chklib.exe\0"
|
||||
#include <reactos/version.rc>
|
Loading…
Reference in a new issue