ReactOS  0.4.14-dev-297-g23e575c
user_lib.h
Go to the documentation of this file.
1 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3 // All rights reserved
4 // This file was released under the GPLv2 on June 2015.
6 
7 /*************************************************************************
8 *
9 * File: user_lib.h
10 *
11 * Module: User-mode library header
12 *
13 * Description: common useful user-mode functions
14 *
15 * Author: Ivan
16 *
17 *************************************************************************/
18 
19 
20 #ifndef __USER_LIB_H__
21 #define __USER_LIB_H__
22 
23 #if defined DBG || defined PRINT_ALWAYS
24 #define ODS(sz) OutputDebugString(sz)
25 #else
26 #define ODS(sz) {}
27 #endif
28 
29 #define arraylen(a) (sizeof(a)/sizeof(a[0]))
30 
32 typedef enum _JS_DEVICE_TYPE {
33  OTHER = 0,
34  CDR,
49 
50 extern TCHAR* MediaTypeStrings[];
51 
53 typedef enum _JS_SERVICE_STATE {
59 
60 void * __cdecl mymemchr (
61  const void * buf,
62  int chr,
63  size_t cnt
64  );
65 
66 char * __cdecl mystrrchr (
67  const char * string,
68  int ch
69  );
70 
71 char * __cdecl mystrchr (
72  const char * string,
73  int ch
74  );
75 
76 int __cdecl Exist (
77  PCHAR path
78  );
79 
82  HWND hWnd,
83  LPCSTR pszFormat,
84  LPCSTR pszTitle,
85  UINT fuStyle,
86  ...
87  );
88 
89 // simple win32 registry api wrappers
90 BOOL RegisterString (LPSTR pszKey, LPSTR pszValue, LPSTR pszData,BOOLEAN MultiSz,DWORD size);
91 BOOL
93  LPSTR pszKey,
94  LPSTR pszValue,
95  LPSTR pszData,
96  DWORD dwBufSize
97  );
98 BOOL RegDelString (LPSTR pszKey, LPSTR pszValue);
99 BOOL RegisterDword (LPSTR pszKey, LPSTR pszValue, DWORD dwData);
100 BOOL
101 GetRegUlong (
102  LPSTR pszKey,
103  LPSTR pszValue,
104  LPDWORD pszData
105  );
106 
107 
111  );
112 
113 BOOL
115  BOOL ReInstall
116  );
117 
118 BOOL
119 Privilege(
120  LPTSTR pszPrivilege,
121  BOOL bEnable
122  );
123 
124 BOOL IsWow64(VOID);
125 
126 #define DW_GLOBAL_QUIT_EVENT_NAME L"Global\\DwQuitEvent"
127 #define DW_QUIT_EVENT_NAME L"DwQuitEvent"
128 
129 HANDLE
131  PWCHAR EventName
132  );
133 
134 ULONG
142  IN BOOLEAN OverrideVerify,
143  IN PVOID Dummy
144  );
145 
146 PCHAR
149  );
150 
151 BOOL
153  PCHAR Path,
154  PCHAR OptName,
155  PULONG OptVal
156  );
157 
158 BOOL
160  PCHAR Path,
161  PCHAR OptName,
162  PULONG OptVal
163  );
164 
165 #define UDF_OPTION_GLOBAL 1
166 #define UDF_OPTION_MEDIASPEC 10
167 #define UDF_OPTION_DEVSPEC 2
168 #define UDF_OPTION_DISKSPEC 3
169 #define UDF_OPTION_MAX_DEPTH 0xffffffff
170 
171 ULONG
173  PCHAR Drive,
174  PCHAR OptName,
175  PULONG OptVal,
176  ULONG CheckDepth
177  );
178 
179 HANDLE
182  );
183 
184 ULONG
186  WCHAR a
187  );
188 
189 DWORD
190 WINAPI
193  );
194 
195 #endif // __USER_LIB_H__
signed char * PCHAR
Definition: retypes.h:7
Definition: user_lib.h:39
#define IN
Definition: typedefs.h:38
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
Definition: user_lib.h:34
#define __cdecl
Definition: accygwin.h:79
Definition: user_lib.h:38
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
ULONG UDFGetOptUlongInherited(PCHAR Drive, PCHAR OptName, PULONG OptVal, ULONG CheckDepth)
Definition: user_lib.cpp:747
HWND hWnd
Definition: settings.c:17
_JS_SERVICE_STATE
Service state constants.
Definition: user_lib.h:53
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
static HANDLE ULONG_PTR dwData
Definition: file.c:35
BOOL RegisterString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size)
Definition: user_lib.cpp:244
BOOL RegisterDword(LPSTR pszKey, LPSTR pszValue, DWORD dwData)
Definition: user_lib.cpp:377
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
Errror while taking service status.
Definition: user_lib.h:57
CHAR * LPTSTR
Definition: xmlstorage.h:192
CHAR InputBuffer[80]
Definition: conmgr.c:33
BOOL RegDelString(LPSTR pszKey, LPSTR pszValue)
Definition: user_lib.cpp:294
int __cdecl Exist(PCHAR path)
Definition: user_lib.cpp:94
ULONG UDFPhSendIOCTL(IN ULONG IoControlCode, IN HANDLE DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, OUT PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN OverrideVerify, IN PVOID Dummy)
Send Device IO Controls to undelaying level via handle.
Definition: user_lib.cpp:628
char *__cdecl mystrchr(const char *string, int ch)
Definition: user_lib.cpp:77
unsigned int BOOL
Definition: ntddk_ex.h:94
void *__cdecl mymemchr(const void *buf, int chr, size_t cnt)
Definition: user_lib.cpp:45
JS_SERVICE_STATE ServiceInfo(LPCTSTR ServiceName)
Return service status by service name.
Definition: user_lib.cpp:157
PWCHAR Drive
Definition: chkdsk.c:73
BOOL GetRegUlong(LPSTR pszKey, LPSTR pszValue, LPDWORD pszData)
Service is running.
Definition: user_lib.h:55
unsigned char BOOLEAN
PCHAR UDFGetDeviceName(PCHAR szDeviceName)
Definition: user_lib.cpp:656
enum _JS_SERVICE_STATE JS_SERVICE_STATE
Service state constants.
Definition: user_lib.h:45
BOOL GetRegString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, DWORD dwBufSize)
Get string from registry by Key path and Value name.
Definition: user_lib.cpp:338
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
const char * LPCSTR
Definition: xmlstorage.h:183
HANDLE CreatePublicEvent(PWCHAR EventName)
Definition: user_lib.cpp:596
Definition: user_lib.h:43
char TCHAR
Definition: xmlstorage.h:189
GLsizeiptr size
Definition: glext.h:5919
LPTSTR ServiceName
Definition: ServiceMain.c:15
char *__cdecl mystrrchr(const char *string, int ch)
Definition: user_lib.cpp:59
ULONG drv_letter_to_index(WCHAR a)
Definition: user_lib.cpp:805
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
TCHAR * MediaTypeStrings[]
Definition: user_lib.cpp:25
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
LPVOID lpParameter
Definition: kernel32.h:241
Definition: user_lib.h:35
static const WCHAR szDeviceName[]
Definition: provider.c:56
int chr(char *serport)
Definition: gdblib.c:152
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
Service installed, but not running.
Definition: user_lib.h:56
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
Definition: user_lib.h:46
HINSTANCE hInst
Definition: dxdiag.c:13
PRTL_UNICODE_STRING_BUFFER Path
_In_ BOOL bEnable
Definition: winddi.h:3426
DWORD WINAPI LauncherRoutine2(LPVOID lpParameter)
Start app with desired parameters.
Definition: user_lib.cpp:821
HANDLE OpenOurVolume(PCHAR szDeviceName)
Definition: user_lib.cpp:780
ULONG MyMessageBox(HINSTANCE hInst, HWND hWnd, LPCSTR pszFormat, LPCSTR pszTitle, UINT fuStyle,...)
Definition: user_lib.cpp:110
Definition: services.c:325
_JS_DEVICE_TYPE
CD/DVD-RW device types.
Definition: user_lib.h:32
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
BOOL IsWow64(VOID)
Definition: user_lib.cpp:579
Definition: user_lib.h:47
#define OUT
Definition: typedefs.h:39
Service not installed.
Definition: user_lib.h:54
BOOL SetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
Definition: user_lib.cpp:723
uint32_t * LPDWORD
Definition: typedefs.h:57
unsigned int ULONG
Definition: retypes.h:1
BOOL CheckCdrwFilter(BOOL ReInstall)
Definition: user_lib.cpp:200
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
Definition: user_lib.h:33
enum _JS_DEVICE_TYPE JS_DEVICE_TYPE
CD/DVD-RW device types.
BOOL GetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
Definition: user_lib.cpp:693
Definition: user_lib.h:40