source: s10k/CommonLibs/plog/WinApi.h@ 1191

Last change on this file since 1191 was 1073, checked in by s10k, 7 years ago

added XML Tools latest version (2.0d) and s10k's common libs

File size: 4.5 KB
Line 
1#pragma once
2
3#ifdef _WIN32
4namespace plog
5{
6 typedef unsigned long DWORD;
7 typedef unsigned short WORD;
8 typedef unsigned int UINT;
9 typedef int BOOL;
10 typedef long LSTATUS;
11 typedef char* LPSTR;
12 typedef wchar_t* LPWSTR;
13 typedef const char* LPCSTR;
14 typedef const wchar_t* LPCWSTR;
15 typedef void* HANDLE;
16 typedef void* HKEY;
17 typedef size_t ULONG_PTR;
18
19 struct CRITICAL_SECTION
20 {
21 void* DebugInfo;
22 long LockCount;
23 long RecursionCount;
24 HANDLE OwningThread;
25 HANDLE LockSemaphore;
26 ULONG_PTR SpinCount;
27 };
28
29 struct COORD
30 {
31 short X;
32 short Y;
33 };
34
35 struct SMALL_RECT
36 {
37 short Left;
38 short Top;
39 short Right;
40 short Bottom;
41 };
42
43 struct CONSOLE_SCREEN_BUFFER_INFO
44 {
45 COORD dwSize;
46 COORD dwCursorPosition;
47 WORD wAttributes;
48 SMALL_RECT srWindow;
49 COORD dwMaximumWindowSize;
50 };
51
52 namespace codePage
53 {
54 const UINT kActive = 0;
55 const UINT kUTF8 = 65001;
56 }
57
58 namespace eventLog
59 {
60 const WORD kErrorType = 0x0001;
61 const WORD kWarningType = 0x0002;
62 const WORD kInformationType = 0x0004;
63 }
64
65 namespace hkey
66 {
67 const HKEY kLocalMachine = reinterpret_cast<HKEY>(static_cast<ULONG_PTR>(0x80000002));
68 }
69
70 namespace regSam
71 {
72 const DWORD kQueryValue = 0x0001;
73 const DWORD kSetValue = 0x0002;
74 }
75
76 namespace regType
77 {
78 const DWORD kExpandSz = 2;
79 const DWORD kDword = 4;
80 }
81
82 namespace stdHandle
83 {
84 const DWORD kOutput = static_cast<DWORD>(-11);
85 }
86
87 namespace foreground
88 {
89 const WORD kBlue = 0x0001;
90 const WORD kGreen = 0x0002;
91 const WORD kRed = 0x0004;
92 const WORD kIntensity = 0x0008;
93 }
94
95 namespace background
96 {
97 const WORD kBlue = 0x0010;
98 const WORD kGreen = 0x0020;
99 const WORD kRed = 0x0040;
100 const WORD kIntensity = 0x0080;
101 }
102
103 extern "C"
104 {
105 __declspec(dllimport) int __stdcall MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);
106 __declspec(dllimport) int __stdcall WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, BOOL* lpUsedDefaultChar);
107
108 __declspec(dllimport) DWORD __stdcall GetCurrentThreadId();
109
110 __declspec(dllimport) BOOL __stdcall MoveFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName);
111
112 __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection);
113 __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection);
114 __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection);
115 __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection);
116
117 __declspec(dllimport) HANDLE __stdcall RegisterEventSourceW(LPCWSTR lpUNCServerName, LPCWSTR lpSourceName);
118 __declspec(dllimport) BOOL __stdcall DeregisterEventSource(HANDLE hEventLog);
119 __declspec(dllimport) BOOL __stdcall ReportEventW(HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, void* lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR* lpStrings, void* lpRawData);
120
121 __declspec(dllimport) LSTATUS __stdcall RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, DWORD samDesired, void* lpSecurityAttributes, HKEY* phkResult, DWORD* lpdwDisposition);
122 __declspec(dllimport) LSTATUS __stdcall RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const void* lpData, DWORD cbData);
123 __declspec(dllimport) LSTATUS __stdcall RegCloseKey(HKEY hKey);
124 __declspec(dllimport) LSTATUS __stdcall RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, DWORD samDesired, HKEY* phkResult);
125 __declspec(dllimport) LSTATUS __stdcall RegDeleteKeyW(HKEY hKey, LPCWSTR lpSubKey);
126
127 __declspec(dllimport) HANDLE __stdcall GetStdHandle(DWORD nStdHandle);
128
129 __declspec(dllimport) BOOL __stdcall GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, CONSOLE_SCREEN_BUFFER_INFO* lpConsoleScreenBufferInfo);
130 __declspec(dllimport) BOOL __stdcall SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes);
131
132 __declspec(dllimport) void __stdcall OutputDebugStringW(LPCWSTR lpOutputString);
133 }
134}
135#endif // _WIN32
Note: See TracBrowser for help on using the repository browser.