#include <windows.h>
#include "loadlib.h"
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
Go to the source code of this file.
◆ APP_VERSION
◆ MAX_LIBS
◆ TARGET
◆ appName()
◆ dprintf()
Definition at line 48 of file loadlib.c.
49{
52
57}
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
int WINAPI lstrlenA(LPCSTR lpString)
int WINAPI wvsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR, _In_ va_list arglist)
◆ getinput()
Definition at line 59 of file loadlib.c.
60{
62
65}
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleA(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
GLenum GLuint GLenum GLsizei const GLchar * buf
Referenced by main().
◆ LoadLibraryList()
Definition at line 113 of file loadlib.c.
114{
116
117 dprintf(
"Attempting to LoadLibrary");
119 dprintf(
"A(%s) - ", *libnames);
121 } else {
123 wchar_t libnameW[500];
126 libnameW[
len] =
L'\0';
129 } else {
131 }
132 }
134 dprintf(
"\nERROR: failed to obtain handle to module %s - %x\n", *libnames,
hModule);
136 }
138
141 }
142
144 dprintf(
"ERROR: failed to free module %s - %x\n", *libnames,
hModule);
146 } else {
148 }
150}
ACPI_SIZE strlen(const char *String)
#define ERROR_INVALID_PARAMETER
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
size_t __cdecl mbstowcs(_Out_writes_opt_z_(_MaxCount) wchar_t *_Dest, _In_z_ const char *_Source, _In_ size_t _MaxCount)
DWORD LoadLibraryList(char **libnames, int counter, BOOL bUseAnsi)
DWORD ReportLastError(void)
Referenced by LoadLibraryList(), and main().
◆ main()
Definition at line 152 of file loadlib.c.
153{
155 int lib_count = 0;
158
162
166 }
167 memset(libs, 0,
sizeof(libs));
181 } else {
183 libs[lib_count] =
argv[
i];
184 ++lib_count;
185 }
186 }
187 }
188 if (lib_count) {
189 do {
192 } else {
193 for (
i = 0;
i < lib_count;
i++) {
195
196 }
197 }
199 } else {
202 do {
203 dprintf(
"\nEnter library name to attempt loading: ");
209 } else break;
211 }
214}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
long getinput(char *buf, int buflen)
const char * appName(const char *argv0)
#define STD_OUTPUT_HANDLE
◆ ReportLastError()
Definition at line 67 of file loadlib.c.
68{
75 dprintf(
"ReportLastError() %d - %s\n", dwError,
msg);
76 } else {
77 dprintf(
"ERROR: ReportLastError() %d - returned TRUE but with no msg string!\n", dwError);
78 }
79 } else {
80 dprintf(
"ReportLastError() %d - unknown error\n", dwError);
81 }
84 }
85 }
86 return dwError;
87}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Referenced by Control(), Create(), Delete(), EnumDepend(), EnumServices(), GetDisplayName(), GetKeyName(), LoadLibraryList(), QueryConfig(), QueryDescription(), QueryFailure(), QueryService(), SdSet(), SdShow(), SetConfig(), SetDescription(), SetFailure(), and Start().
◆ usage()
Definition at line 99 of file loadlib.c.
100{
101 dprintf(
"USAGE: %s libname [libname ...] [unicode]|[ansi] [loop][recurse]\n",
appName);
102 dprintf(
"\tWhere libname(s) is one or more libraries to load.\n");
103 dprintf(
"\t[unicode] - perform tests using UNICODE api calls\n");
104 dprintf(
"\t[ansi] - perform tests using ANSI api calls\n");
106 dprintf(
"\t[loop] - run test process in continuous loop\n");
107 dprintf(
"\t[recurse] - load libraries recursively rather than sequentually\n");
108 dprintf(
"\t[debug] - enable debug mode (unused)\n");
109 dprintf(
"\t[verbose] - enable verbose output (unused)\n");
110 return 0;
111}
◆ bUseAnsi
◆ debug_flagged
◆ InputHandle
◆ loop_flagged
◆ OutputHandle
◆ recursive_flagged
◆ verbose_flagged