#include "xml2sdb.h"
#include "sdbpapi.h"
#include "sdbstringtable.h"
#include <time.h>
#include <stdio.h>
#include <stdarg.h>
Go to the source code of this file.
|
LPVOID WINAPI | SdbpAlloc (SIZE_T size) |
|
LPVOID WINAPI | SdbpReAlloc (LPVOID mem, SIZE_T size, SIZE_T oldSize) |
|
void WINAPI | SdbpFree (LPVOID mem) |
|
DWORD | SdbpStrlen (PCWSTR string) |
|
DWORD WINAPI | SdbpStrsize (PCWSTR string) |
|
PDB WINAPI | SdbpCreate (LPCWSTR path, PATH_TYPE type, BOOL write) |
|
void WINAPI | SdbpFlush (PDB pdb) |
|
void WINAPI | SdbCloseDatabase (PDB pdb) |
|
BOOL WINAPI | SdbpCheckTagType (TAG tag, WORD type) |
|
BOOL WINAPI | SdbpReadData (PDB pdb, PVOID dest, DWORD offset, DWORD num) |
|
TAG WINAPI | SdbGetTagFromTagID (PDB pdb, TAGID tagid) |
|
BOOL WINAPI | SdbpCheckTagIDType (PDB pdb, TAGID tagid, WORD type) |
|
BOOL WINAPIV | ShimDbgPrint (SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR Format,...) |
|
VOID NTAPI | RtlSecondsSince1970ToTime (IN ULONG SecondsSince1970, OUT PLARGE_INTEGER Time) |
|
bool | xml_2_db (const char *xml, const WCHAR *sdb) |
|
static bool | run_one (std::string &input, std::string &output) |
|
static std::string | get_strarg (int argc, char *argv[], int &i) |
|
static void | update_loglevel (int argc, char *argv[], int &i) |
|
int | main (int argc, char *argv[]) |
|
◆ TICKSPERSEC
◆ TICKSTO1970
#define TICKSTO1970 0x019db1ded53e8000i64 |
◆ get_strarg()
static std::string get_strarg |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
int & |
i |
|
) |
| |
|
static |
Definition at line 188 of file main.cpp.
189{
191 return std::string(
argv[
i] + 2);
192
195 return std::string();
197}
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
Referenced by main(), and update_loglevel().
◆ main()
Definition at line 205 of file main.cpp.
206{
207 std::string
input, output;
209
211 {
213 continue;
214
216 {
217 case 'i':
219 break;
220 case 'o':
222 break;
223 case 'l':
225 break;
226 }
227 if (
input.empty() || output.empty())
228 continue;
229
231 {
232 printf(
"Failed converting '%s' to '%s'\n",
input.c_str(), output.c_str());
233 return 1;
234 }
235 }
236 return 0;
237}
GLenum GLenum GLenum input
void __cdecl srand(_In_ unsigned int _Seed)
static void update_loglevel(int argc, char *argv[], int &i)
static std::string get_strarg(int argc, char *argv[], int &i)
static bool run_one(std::string &input, std::string &output)
◆ RtlSecondsSince1970ToTime()
Definition at line 167 of file main.cpp.
169{
171}
static PLARGE_INTEGER Time
◆ run_one()
static bool run_one |
( |
std::string & |
input, |
|
|
std::string & |
output |
|
) |
| |
|
static |
Definition at line 179 of file main.cpp.
180{
181 sdbstring outputW(output.begin(), output.end());
183 return false;
185 return true;
186}
bool xml_2_db(const char *xml, const WCHAR *sdb)
std::basic_string< WCHAR > sdbstring
Referenced by main().
◆ SdbCloseDatabase()
◆ SdbGetTagFromTagID()
Searches shim database for the tag associated with specified tagid.
- Parameters
-
[in] | pdb | Handle to the shim database. |
[in] | tagid | The TAGID of the tag. |
- Returns
- Success: The tag associated with specified tagid, Failure: TAG_NULL.
Definition at line 114 of file main.cpp.
115{
120}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
BOOL WINAPI SdbpReadData(PDB pdb, PVOID dest, DWORD offset, DWORD num)
Referenced by SdbpCheckTagIDType(), and SdbpMatchFileAttributes().
◆ SdbpAlloc()
Definition at line 19 of file main.cpp.
20{
21 return ::calloc(1,
size);
22}
◆ SdbpCheckTagIDType()
Definition at line 122 of file main.cpp.
123{
128}
GLuint GLuint GLsizei GLenum type
BOOL WINAPI SdbpCheckTagType(TAG tag, WORD type)
TAG WINAPI SdbGetTagFromTagID(PDB pdb, TAGID tagid)
◆ SdbpCheckTagType()
◆ SdbpCreate()
Definition at line 52 of file main.cpp.
53{
57
61
65
67}
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
DWORD SdbpStrlen(PCWSTR string)
◆ SdbpFlush()
Definition at line 69 of file main.cpp.
70{
72
74}
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
◆ SdbpFree()
◆ SdbpReadData()
◆ SdbpReAlloc()
Definition at line 24 of file main.cpp.
25{
27 if (newMem &&
size > oldSize)
28 {
30 }
31 return newMem;
32}
◆ SdbpStrlen()
◆ SdbpStrsize()
◆ ShimDbgPrint()
Outputs diagnostic info.
- Parameters
-
[in] | Level | The level to log this message with, choose any of [SHIM_ERR, SHIM_WARN, SHIM_INFO]. |
[in] | FunctionName | The function this log should be attributed to. |
[in] | Format | The format string. |
| ... | Variable arguments providing additional information. |
- Returns
- Success: TRUE Failure: FALSE.
Definition at line 130 of file main.cpp.
131{
133 const char* LevelStr;
134
137
139 {
141 LevelStr = "Err ";
142 break;
144 LevelStr = "Warn";
145 break;
147 LevelStr = "Info";
148 break;
149 default:
150 LevelStr = "User";
151 break;
152 }
158}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
_Check_return_opt_ _CRTIMP int __cdecl vprintf(_In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
#define SHIM_INFO(fmt,...)
#define SHIM_WARN(fmt,...)
#define SHIM_ERR(fmt,...)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
◆ update_loglevel()
Definition at line 199 of file main.cpp.
200{
203}
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
Referenced by main().
◆ xml_2_db()
Definition at line 765 of file xml2sdb.cpp.
766{
769 {
771 }
772 return false;
773}
bool fromXml(const char *fileName)
Referenced by run_one().
◆ g_ShimDebugLevel