ReactOS 0.4.16-dev-329-g9223134
user_lib.h
Go to the documentation of this file.
1
2// 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
32typedef enum _JS_DEVICE_TYPE {
33 OTHER = 0,
47 BUSY
49
50extern TCHAR* MediaTypeStrings[];
51
53typedef enum _JS_SERVICE_STATE {
59
60void * __cdecl mymemchr (
61 const void * buf,
62 int chr,
63 size_t cnt
64 );
65
66char * __cdecl mystrrchr (
67 const char * string,
68 int ch
69 );
70
71char * __cdecl mystrchr (
72 const char * string,
73 int ch
74 );
75
76int __cdecl Exist (
78 );
79
82 HWND hWnd,
83 LPCSTR pszFormat,
84 LPCSTR pszTitle,
85 UINT fuStyle,
86 ...
87 );
88
89// simple win32 registry api wrappers
90BOOL RegisterString (LPSTR pszKey, LPSTR pszValue, LPSTR pszData,BOOLEAN MultiSz,DWORD size);
91BOOL
93 LPSTR pszKey,
94 LPSTR pszValue,
95 LPSTR pszData,
96 DWORD dwBufSize
97 );
98BOOL RegDelString (LPSTR pszKey, LPSTR pszValue);
99BOOL RegisterDword (LPSTR pszKey, LPSTR pszValue, DWORD dwData);
100BOOL
102 LPSTR pszKey,
103 LPSTR pszValue,
104 LPDWORD pszData
105 );
106
107
111 );
112
113BOOL
115 BOOL ReInstall
116 );
117
118BOOL
120 LPTSTR pszPrivilege,
122 );
123
125
126#define DW_GLOBAL_QUIT_EVENT_NAME L"Global\\DwQuitEvent"
127#define DW_QUIT_EVENT_NAME L"DwQuitEvent"
128
129HANDLE
131 PWCHAR EventName
132 );
133
134ULONG
142 IN BOOLEAN OverrideVerify,
143 IN PVOID Dummy
144 );
145
146PCHAR
149 );
150
151BOOL
153 PCHAR Path,
154 PCHAR OptName,
155 PULONG OptVal
156 );
157
158BOOL
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
171ULONG
173 PCHAR Drive,
174 PCHAR OptName,
175 PULONG OptVal,
176 ULONG CheckDepth
177 );
178
179HANDLE
182 );
183
184ULONG
186 WCHAR a
187 );
188
189DWORD
190WINAPI
192 LPVOID lpParameter
193 );
194
195#endif // __USER_LIB_H__
unsigned char BOOLEAN
PRTL_UNICODE_STRING_BUFFER Path
#define __cdecl
Definition: accygwin.h:79
HWND hWnd
Definition: settings.c:17
static WCHAR ServiceName[]
Definition: browser.c:19
PWCHAR Drive
Definition: chkdsk.c:73
static const WCHAR szDeviceName[]
Definition: provider.c:56
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
static HANDLE ULONG_PTR dwData
Definition: file.c:35
unsigned int UINT
Definition: ndis.h:50
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t * LPDWORD
Definition: typedefs.h:59
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
BOOL IsWow64(VOID)
Definition: user_lib.cpp:579
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
HANDLE CreatePublicEvent(PWCHAR EventName)
Definition: user_lib.cpp:596
_JS_DEVICE_TYPE
CD/DVD-RW device types.
Definition: user_lib.h:32
@ CDR
Definition: user_lib.h:34
@ CDRW
Definition: user_lib.h:35
@ DDCDR
Definition: user_lib.h:43
@ DVDRW
Definition: user_lib.h:39
@ DVDR
Definition: user_lib.h:38
@ BDROM
Definition: user_lib.h:45
@ BUSY
Definition: user_lib.h:47
@ BDRE
Definition: user_lib.h:46
@ DVDPR
Definition: user_lib.h:40
@ DDCDRW
Definition: user_lib.h:44
@ DVDPRW
Definition: user_lib.h:41
@ OTHER
Definition: user_lib.h:33
@ DDCDROM
Definition: user_lib.h:42
@ DVDROM
Definition: user_lib.h:36
@ DVDRAM
Definition: user_lib.h:37
char *__cdecl mystrrchr(const char *string, int ch)
Definition: user_lib.cpp:59
ULONG MyMessageBox(HINSTANCE hInst, HWND hWnd, LPCSTR pszFormat, LPCSTR pszTitle, UINT fuStyle,...)
Definition: user_lib.cpp:110
BOOL GetRegUlong(LPSTR pszKey, LPSTR pszValue, LPDWORD pszData)
Definition: user_lib.cpp:425
int __cdecl Exist(PCHAR path)
Definition: user_lib.cpp:94
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
PCHAR UDFGetDeviceName(PCHAR szDeviceName)
Definition: user_lib.cpp:656
TCHAR * MediaTypeStrings[]
Definition: user_lib.cpp:25
enum _JS_DEVICE_TYPE JS_DEVICE_TYPE
CD/DVD-RW device types.
DWORD WINAPI LauncherRoutine2(LPVOID lpParameter)
Start app with desired parameters.
Definition: user_lib.cpp:821
BOOL SetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
Definition: user_lib.cpp:723
void *__cdecl mymemchr(const void *buf, int chr, size_t cnt)
Definition: user_lib.cpp:45
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
BOOL RegDelString(LPSTR pszKey, LPSTR pszValue)
Definition: user_lib.cpp:294
ULONG UDFGetOptUlongInherited(PCHAR Drive, PCHAR OptName, PULONG OptVal, ULONG CheckDepth)
Definition: user_lib.cpp:747
BOOL CheckCdrwFilter(BOOL ReInstall)
Definition: user_lib.cpp:200
BOOL RegisterDword(LPSTR pszKey, LPSTR pszValue, DWORD dwData)
Definition: user_lib.cpp:377
enum _JS_SERVICE_STATE JS_SERVICE_STATE
Service state constants.
_JS_SERVICE_STATE
Service state constants.
Definition: user_lib.h:53
@ JS_SERVICE_RUNNING
Service is running.
Definition: user_lib.h:55
@ JS_SERVICE_NOT_PRESENT
Service not installed.
Definition: user_lib.h:54
@ JS_SERVICE_NOT_RUNNING
Service installed, but not running.
Definition: user_lib.h:56
@ JS_ERROR_STATUS
Errror while taking service status.
Definition: user_lib.h:57
HANDLE OpenOurVolume(PCHAR szDeviceName)
Definition: user_lib.cpp:780
JS_SERVICE_STATE ServiceInfo(LPCTSTR ServiceName)
Return service status by service name.
Definition: user_lib.cpp:157
BOOL GetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
Definition: user_lib.cpp:693
char *__cdecl mystrchr(const char *string, int ch)
Definition: user_lib.cpp:77
ULONG drv_letter_to_index(WCHAR a)
Definition: user_lib.cpp:805
BOOL RegisterString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size)
Definition: user_lib.cpp:244
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_In_ BOOL bEnable
Definition: winddi.h:3426
#define WINAPI
Definition: msvc.h:6
char TCHAR
Definition: xmlstorage.h:189
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192