ReactOS  0.4.14-dev-337-gf981a68
user_lib.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ODS(sz)   {}
 
#define arraylen(a)   (sizeof(a)/sizeof(a[0]))
 
#define DW_GLOBAL_QUIT_EVENT_NAME   L"Global\\DwQuitEvent"
 
#define DW_QUIT_EVENT_NAME   L"DwQuitEvent"
 
#define UDF_OPTION_GLOBAL   1
 
#define UDF_OPTION_MEDIASPEC   10
 
#define UDF_OPTION_DEVSPEC   2
 
#define UDF_OPTION_DISKSPEC   3
 
#define UDF_OPTION_MAX_DEPTH   0xffffffff
 

Typedefs

typedef enum _JS_DEVICE_TYPE JS_DEVICE_TYPE
 CD/DVD-RW device types. More...
 
typedef enum _JS_SERVICE_STATE JS_SERVICE_STATE
 Service state constants. More...
 

Enumerations

enum  _JS_DEVICE_TYPE {
  OTHER = 0, CDR, CDRW, DVDROM,
  DVDRAM, DVDR, DVDRW, DVDPR,
  DVDPRW, DDCDROM, DDCDR, DDCDRW,
  BDROM, BDRE, BUSY
}
 CD/DVD-RW device types. More...
 
enum  _JS_SERVICE_STATE { JS_SERVICE_NOT_PRESENT, JS_SERVICE_RUNNING, JS_SERVICE_NOT_RUNNING, JS_ERROR_STATUS }
 Service state constants. More...
 

Functions

void *__cdecl mymemchr (const void *buf, int chr, size_t cnt)
 
char *__cdecl mystrrchr (const char *string, int ch)
 
char *__cdecl mystrchr (const char *string, int ch)
 
int __cdecl Exist (PCHAR path)
 
ULONG MyMessageBox (HINSTANCE hInst, HWND hWnd, LPCSTR pszFormat, LPCSTR pszTitle, UINT fuStyle,...)
 
BOOL RegisterString (LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size)
 
BOOL GetRegString (LPSTR pszKey, LPSTR pszValue, LPSTR pszData, DWORD dwBufSize)
 Get string from registry by Key path and Value name. More...
 
BOOL RegDelString (LPSTR pszKey, LPSTR pszValue)
 
BOOL RegisterDword (LPSTR pszKey, LPSTR pszValue, DWORD dwData)
 
BOOL GetRegUlong (LPSTR pszKey, LPSTR pszValue, LPDWORD pszData)
 
JS_SERVICE_STATE ServiceInfo (LPCTSTR ServiceName)
 Return service status by service name. More...
 
BOOL CheckCdrwFilter (BOOL ReInstall)
 
BOOL Privilege (LPTSTR pszPrivilege, BOOL bEnable)
 
BOOL IsWow64 (VOID)
 
HANDLE CreatePublicEvent (PWCHAR EventName)
 
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. More...
 
PCHAR UDFGetDeviceName (PCHAR szDeviceName)
 
BOOL GetOptUlong (PCHAR Path, PCHAR OptName, PULONG OptVal)
 
BOOL SetOptUlong (PCHAR Path, PCHAR OptName, PULONG OptVal)
 
ULONG UDFGetOptUlongInherited (PCHAR Drive, PCHAR OptName, PULONG OptVal, ULONG CheckDepth)
 
HANDLE OpenOurVolume (PCHAR szDeviceName)
 
ULONG drv_letter_to_index (WCHAR a)
 
DWORD WINAPI LauncherRoutine2 (LPVOID lpParameter)
 Start app with desired parameters. More...
 

Variables

TCHARMediaTypeStrings []
 

Macro Definition Documentation

◆ arraylen

#define arraylen (   a)    (sizeof(a)/sizeof(a[0]))

Definition at line 29 of file user_lib.h.

◆ DW_GLOBAL_QUIT_EVENT_NAME

#define DW_GLOBAL_QUIT_EVENT_NAME   L"Global\\DwQuitEvent"

Definition at line 126 of file user_lib.h.

◆ DW_QUIT_EVENT_NAME

#define DW_QUIT_EVENT_NAME   L"DwQuitEvent"

Definition at line 127 of file user_lib.h.

◆ ODS

#define ODS (   sz)    {}

Definition at line 26 of file user_lib.h.

◆ UDF_OPTION_DEVSPEC

#define UDF_OPTION_DEVSPEC   2

Definition at line 167 of file user_lib.h.

◆ UDF_OPTION_DISKSPEC

#define UDF_OPTION_DISKSPEC   3

Definition at line 168 of file user_lib.h.

◆ UDF_OPTION_GLOBAL

#define UDF_OPTION_GLOBAL   1

Definition at line 165 of file user_lib.h.

◆ UDF_OPTION_MAX_DEPTH

#define UDF_OPTION_MAX_DEPTH   0xffffffff

Definition at line 169 of file user_lib.h.

◆ UDF_OPTION_MEDIASPEC

#define UDF_OPTION_MEDIASPEC   10

Definition at line 166 of file user_lib.h.

Typedef Documentation

◆ JS_DEVICE_TYPE

CD/DVD-RW device types.

◆ JS_SERVICE_STATE

Service state constants.

Enumeration Type Documentation

◆ _JS_DEVICE_TYPE

CD/DVD-RW device types.

Enumerator
OTHER 
CDR 
CDRW 
DVDROM 
DVDRAM 
DVDR 
DVDRW 
DVDPR 
DVDPRW 
DDCDROM 
DDCDR 
DDCDRW 
BDROM 
BDRE 
BUSY 

Definition at line 32 of file user_lib.h.

32  {
33  OTHER = 0,
34  CDR,
35  CDRW,
36  DVDROM,
37  DVDRAM,
38  DVDR,
39  DVDRW,
40  DVDPR,
41  DVDPRW,
42  DDCDROM,
43  DDCDR,
44  DDCDRW,
45  BDROM,
46  BDRE,
47  BUSY
Definition: user_lib.h:39
Definition: user_lib.h:34
Definition: user_lib.h:38
Definition: user_lib.h:45
Definition: user_lib.h:43
Definition: user_lib.h:35
Definition: user_lib.h:46
Definition: user_lib.h:47
Definition: user_lib.h:33
enum _JS_DEVICE_TYPE JS_DEVICE_TYPE
CD/DVD-RW device types.
Definition: user_lib.h:40

◆ _JS_SERVICE_STATE

Service state constants.

Enumerator
JS_SERVICE_NOT_PRESENT 

Service not installed.

JS_SERVICE_RUNNING 

Service is running.

JS_SERVICE_NOT_RUNNING 

Service installed, but not running.

JS_ERROR_STATUS 

Errror while taking service status.

Definition at line 53 of file user_lib.h.

53  {
Errror while taking service status.
Definition: user_lib.h:57
Service is running.
Definition: user_lib.h:55
enum _JS_SERVICE_STATE JS_SERVICE_STATE
Service state constants.
Service installed, but not running.
Definition: user_lib.h:56
Service not installed.
Definition: user_lib.h:54

Function Documentation

◆ CheckCdrwFilter()

BOOL CheckCdrwFilter ( BOOL  ReInstall)

Definition at line 200 of file user_lib.cpp.

203 {
204  char CdromUpperFilters[1024];
205  bool found = false;
206 
207  if (LOBYTE(LOWORD(GetVersion())) < 5) {
208  return true;
209  }
210 
211  if (GetRegString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],arraylen(CdromUpperFilters))) {
212  char *token = &CdromUpperFilters[0];
213 
214  while (*token) {
215  if (!strcmp(token,CDRW_SERVICE)) {
216  found = true;
217  break;
218  }
219  token += strlen(token)+1;
220  }
221  if (!found) {
223  *(token+sizeof(CDRW_SERVICE)) = '\0';
224  *(token+sizeof(CDRW_SERVICE)+1) = '\0';
225  if(ReInstall) {
226  RegisterString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],TRUE,token-&CdromUpperFilters[0]+sizeof(CDRW_SERVICE)+1);
227  found = true;
228  }
229  }
230  } else {
231  memcpy(CdromUpperFilters,CDRW_SERVICE,sizeof(CDRW_SERVICE));
232  CdromUpperFilters[sizeof(CDRW_SERVICE)] = '\0';
233  CdromUpperFilters[sizeof(CDRW_SERVICE)+1] = '\0';
234  if(ReInstall) {
235  RegisterString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],TRUE,sizeof(CDRW_SERVICE)+1);
236  found = true;
237  }
238  }
239  return found;
240 
241 } // end CheckCdrwFilter()
#define TRUE
Definition: types.h:120
#define LOBYTE(W)
Definition: jmemdos.c:487
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
BOOL RegisterString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size)
Definition: user_lib.cpp:244
#define arraylen(a)
Definition: user_lib.h:29
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
#define REG_UPPER_FILTER_NAME
Definition: udf_reg.h:29
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 token
Definition: glfuncs.h:210
#define CDROM_CLASS_PATH
Definition: udf_reg.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
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
#define CDRW_SERVICE
Definition: udf_reg.h:14
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define LOWORD(l)
Definition: pedump.c:82

◆ CreatePublicEvent()

HANDLE CreatePublicEvent ( PWCHAR  EventName)

Definition at line 596 of file user_lib.cpp.

599 {
600  SECURITY_DESCRIPTOR sdPublic;
601  SECURITY_ATTRIBUTES saPublic;
602 
604  &sdPublic,
606  );
607 
609  &sdPublic,
610  TRUE,
611  NULL,
612  FALSE
613  );
614 
615  saPublic.nLength = sizeof(saPublic);
616  saPublic.lpSecurityDescriptor = &sdPublic;
617 
618  return CreateEventW(
619  &saPublic,
620  TRUE,
621  FALSE,
622  EventName);
623 
624 } // end CreatePublicEvent()
#define TRUE
Definition: types.h:120
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
Definition: security.c:808
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
smooth NULL
Definition: ftsmooth.c:416
LPVOID lpSecurityDescriptor
Definition: compat.h:181
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
Definition: sec.c:262

Referenced by FmtAcquireDrive_().

◆ drv_letter_to_index()

ULONG drv_letter_to_index ( WCHAR  a)

Definition at line 805 of file user_lib.cpp.

808 {
809  if(a >= 'a' && a <= 'z') {
810  return a - 'a';
811  }
812  if(a >= 'A' && a <= 'Z') {
813  return a - 'A';
814  }
815  return -1;
816 } // end drv_letter_to_index()
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ Exist()

int __cdecl Exist ( PCHAR  path)

Definition at line 94 of file user_lib.cpp.

97 {
98  DWORD attr;
99 
101  if (attr == 0xffffffff) {
102  return 0;
103  }
104 
105  return 1;
106 
107 } // end Exist()
CHAR * LPTSTR
Definition: xmlstorage.h:192
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: cookie.c:170
__u8 attr
Definition: mkdosfs.c:359
#define GetFileAttributes
Definition: winbase.h:3639
Definition: services.c:325

◆ GetOptUlong()

BOOL GetOptUlong ( PCHAR  Path,
PCHAR  OptName,
PULONG  OptVal 
)

Definition at line 693 of file user_lib.cpp.

698 {
699  if(!Path) {
700  return FALSE;
701  }
702  if(Path[0] && Path[1] == ':') {
703  CHAR SettingFile[MAX_PATH];
704  CHAR Setting[16];
705 
706  sprintf(SettingFile, "%s\\%s", Path, UDF_CONFIG_STREAM_NAME);
707  GetPrivateProfileString("DiskSettings", OptName, "d", &Setting[0], 10, SettingFile);
708  Setting[15]=0;
709  if (Setting[0] != 'd') {
710  if(Setting[0] == '0' && Setting[1] == 'x') {
711  sscanf(Setting+2, "%x", OptVal);
712  } else {
713  sscanf(Setting, "%d", OptVal);
714  }
715  return TRUE;
716  }
717  return FALSE;
718  }
719  return GetRegUlong(Path, OptName, OptVal);
720 } // end GetOptUlong()
#define TRUE
Definition: types.h:120
char CHAR
Definition: xmlstorage.h:175
BOOL GetRegUlong(LPSTR pszKey, LPSTR pszValue, PULONG pszData)
Definition: user_lib.cpp:425
#define sprintf(buf, format,...)
Definition: sprintf.c:55
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define MAX_PATH
Definition: compat.h:26
PRTL_UNICODE_STRING_BUFFER Path
#define GetPrivateProfileString
Definition: winbase.h:3659
#define UDF_CONFIG_STREAM_NAME
Definition: udfpubl.h:81

Referenced by UDFGetOptUlongInherited().

◆ GetRegString()

BOOL GetRegString ( LPSTR  pszKey,
LPSTR  pszValue,
LPSTR  pszData,
DWORD  dwBufSize 
)

Get string from registry by Key path and Value name.

Definition at line 338 of file user_lib.cpp.

344 {
345 
346  HKEY hKey;
347  DWORD dwDataSize = dwBufSize;
348  DWORD dwValueType = REG_SZ;
349 
350  if(!dwBufSize)
351  return FALSE;
352 
353  RegOpenKeyEx(
354  HKEY_LOCAL_MACHINE, // handle of open key
355  pszKey, // address of name of subkey to open
356  0, // reserved
357  KEY_QUERY_VALUE, // security access mask
358  &hKey // address of handle of open key
359  );
360 
362  hKey, // handle of key to query
363  pszValue, // address of name of value to query
364  0, // reserved
365  &dwValueType, // address of buffer for value type
366  (BYTE *)pszData, // address of data buffer
367  &dwDataSize // address of data buffer size
368  )) return FALSE;
369 
370  if (pszData[dwDataSize-1] != '\0')
371  pszData[dwDataSize-1] = '\0';
372 
373  return TRUE;
374 } // end GetRegString()
#define RegQueryValueEx
Definition: winreg.h:524
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define RegOpenKeyEx
Definition: winreg.h:520
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by CheckCdrwFilter(), and LauncherRoutine2().

◆ GetRegUlong()

BOOL GetRegUlong ( LPSTR  pszKey,
LPSTR  pszValue,
LPDWORD  pszData 
)

◆ IsWow64()

BOOL IsWow64 ( VOID  )

Definition at line 579 of file user_lib.cpp.

580 {
581  BOOL bIsWow64 = FALSE;
582  LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"),"IsWow64Process");
583 
584  if (NULL != fnIsWow64Process)
585  {
586  if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
587  {
588  return FALSE;
589  }
590  }
591  return bIsWow64;
592 } // end IsWow64()
BOOL(WINAPI * LPFN_ISWOW64PROCESS)(HANDLE, PBOOL)
Definition: user_lib.cpp:576
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
#define GetModuleHandle
Definition: winbase.h:3651
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by Is64BitSystem().

◆ LauncherRoutine2()

DWORD WINAPI LauncherRoutine2 ( LPVOID  lpParameter)

Start app with desired parameters.

Definition at line 821 of file user_lib.cpp.

824 {
825  PCHAR ParamStr = (PCHAR)lpParameter;
826  STARTUPINFO proc_startup_info;
827  PROCESS_INFORMATION proc_info;
828  CHAR szLaunchPath[MAX_PATH],ErrMes[50];
829  INT index;
830  ULONG MkUdfRetCode;
831  CHAR szTemp[256];
832 
833  GetRegString(UDF_KEY,"ToolsPath",szLaunchPath, sizeof(szLaunchPath));
834  SetCurrentDirectory(szLaunchPath);
835 
836  strcat(szLaunchPath,"\\");
837  //strcat(szLaunchPath,UDFFMT);
838  strcat(szLaunchPath,ParamStr);
839 
840  //strcpy(MkUdfStatus,"");
841 
842 #ifndef TESTMODE
843  proc_startup_info.cb = sizeof(proc_startup_info);
844  proc_startup_info.lpReserved = 0;
845  proc_startup_info.lpReserved2 = 0;
846  proc_startup_info.cbReserved2 = 0;
847  proc_startup_info.lpDesktop = 0;
848  proc_startup_info.lpTitle = 0;
849  proc_startup_info.dwFlags = 0;
850 
851  proc_startup_info.hStdInput = NULL;
852  proc_startup_info.hStdOutput = NULL;
853  proc_startup_info.hStdError = NULL;
854 
856  0,0, &proc_startup_info, &proc_info)) {
857 
858  //hFmtProc[i] = proc_info.hProcess;
859  WaitForSingleObject(proc_info.hProcess, -1);
860  GetExitCodeProcess(proc_info.hProcess, &MkUdfRetCode);
861  index=0;
862 /*
863  while (mkudf_err_msg[index].err_code != 0xffffffff){
864  if (mkudf_err_msg[index].err_code == MkUdfRetCode) break;
865  index++;
866  }
867 */
868  //strcpy(MkUdfStatus,mkudf_err_msg[index].err_msg);
869 
870  CloseHandle(proc_info.hThread);
871  CloseHandle(proc_info.hProcess);
872  } else {
873  strcpy(ErrMes,"Stop: Cannot launch ");
874  strcat(ErrMes,szLaunchPath);
875  sprintf(szTemp," error %d",GetLastError());
876  strcat(ErrMes,szTemp);
877  MessageBox(NULL,ErrMes,"UDFFormat",MB_OK | MB_ICONHAND);
878 
879  }
880 #else
881  MessageBox(NULL,szLaunchPath,"Message",MB_OK);
882  Sleep(500);
883  MkUdfRetCode = MKUDF_OK;
884 // MkUdfRetCode = MKUDF_FORMAT_REQUIRED;
885 // MkUdfRetCode = MKUDF_CANT_BLANK;
886 
887  index = 0;
888  while (mkudf_err_msg[index].err_code != 0xffffffff){
889  if (mkudf_err_msg[index].err_code == MkUdfRetCode) break;
890  index++;
891  }
892  //strcpy(MkUdfStatus,mkudf_err_msg[index].err_msg);
893 
894 #endif
895  return MkUdfRetCode;
896 } // end LauncherRoutine2()
#define MKUDF_OK
Definition: udferr_usr.h:12
#define MB_ICONHAND
Definition: winuser.h:782
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
LPSTR lpTitle
Definition: winbase.h:806
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define UDF_KEY
Definition: udf_reg.h:16
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
char CHAR
Definition: xmlstorage.h:175
struct err_msg_item mkudf_err_msg[]
Definition: udferr_usr.cpp:8
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD dwFlags
Definition: winbase.h:814
#define NORMAL_PRIORITY_CLASS
Definition: winbase.h:181
int32_t INT
Definition: typedefs.h:56
#define CREATE_NO_WINDOW
Definition: winbase.h:195
#define sprintf(buf, format,...)
Definition: sprintf.c:55
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
PBYTE lpReserved2
Definition: winbase.h:817
LPSTR lpReserved
Definition: winbase.h:804
GLuint index
Definition: glext.h:6031
#define PCHAR
Definition: match.c:90
DWORD cb
Definition: winbase.h:803
#define MAX_PATH
Definition: compat.h:26
HANDLE hStdOutput
Definition: winbase.h:819
#define index(s, c)
Definition: various.h:29
LPVOID lpParameter
Definition: kernel32.h:241
#define MessageBox
Definition: winuser.h:5723
#define CreateProcess
Definition: winbase.h:3582
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
LPSTR lpDesktop
Definition: winbase.h:805
WORD cbReserved2
Definition: winbase.h:816
HANDLE hStdInput
Definition: winbase.h:818
#define MB_OK
Definition: winuser.h:784
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
HANDLE hStdError
Definition: winbase.h:820
#define SetCurrentDirectory
Definition: winbase.h:3727

◆ mymemchr()

void* __cdecl mymemchr ( const void buf,
int  chr,
size_t  cnt 
)

Definition at line 45 of file user_lib.cpp.

50 {
51  while ( cnt && (*(unsigned char *)buf != (unsigned char)chr) ) {
52  buf = (unsigned char *)buf + 1;
53  cnt--;
54  }
55 
56  return(cnt ? (void *)buf : NULL);
57 } // end mymemchr()
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
smooth NULL
Definition: ftsmooth.c:416
int chr(char *serport)
Definition: gdblib.c:152

◆ MyMessageBox()

ULONG MyMessageBox ( HINSTANCE  hInst,
HWND  hWnd,
LPCSTR  pszFormat,
LPCSTR  pszTitle,
UINT  fuStyle,
  ... 
)

Definition at line 110 of file user_lib.cpp.

118 {
119  CHAR szTitle[80];
120  CHAR szFormat[1024];
121  LPSTR pszMessage;
122  BOOL fOk;
123  int result;
124  va_list ArgList;
125 
126  if (!HIWORD(pszTitle)) {
127  LoadString(hInst, LOWORD(pszTitle), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
128  pszTitle = szTitle;
129  }
130 
131  if (!HIWORD(pszFormat)) {
132  // Allow this to be a resource ID
133  LoadString(hInst, LOWORD(pszFormat), szFormat, sizeof(szFormat)/sizeof(szFormat[0]));
134  pszFormat = szFormat;
135  }
136 
137  va_start(ArgList, fuStyle);
140  pszFormat, 0, 0, (LPTSTR)&pszMessage, 0, &ArgList);
141 
142  va_end(ArgList);
143 
144  if (fOk && pszMessage) {
145  result = MessageBox(hWnd, pszMessage, pszTitle, fuStyle | MB_SETFOREGROUND);
146  LocalFree(pszMessage);
147  } else {
148  return -1;
149  }
150 
151  return result;
152 } // end MyMessageBox()
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
char CHAR
Definition: xmlstorage.h:175
HWND hWnd
Definition: settings.c:17
char * LPSTR
Definition: xmlstorage.h:182
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define va_end(ap)
Definition: acmsvcex.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
char * va_list
Definition: acmsvcex.h:78
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define FormatMessage
Definition: winbase.h:3619
#define MessageBox
Definition: winuser.h:5723
HINSTANCE hInst
Definition: dxdiag.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define HIWORD(l)
Definition: typedefs.h:246
#define MB_SETFOREGROUND
Definition: winuser.h:808
GLuint64EXT * result
Definition: glext.h:11304
#define LOWORD(l)
Definition: pedump.c:82
#define LoadString
Definition: winuser.h:5720

◆ mystrchr()

char* __cdecl mystrchr ( const char string,
int  ch 
)

Definition at line 77 of file user_lib.cpp.

81 {
82  while (*string != (char)ch && *string != '\0' ) {
83  string++;
84  }
85 
86  if (*string == (char)ch) {
87  return( (char *)string );
88  }
89 
90  return(NULL);
91 } // end mystrchr()
smooth NULL
Definition: ftsmooth.c:416

◆ mystrrchr()

char* __cdecl mystrrchr ( const char string,
int  ch 
)

Definition at line 59 of file user_lib.cpp.

63 {
64  char *start = (char *)string;
65 
66  while (*string++) {;}
67 
68  while (--string != start && *string != (char)ch) {;}
69 
70  if (*string == (char)ch) {
71  return( (char *)string );
72  }
73 
74  return(NULL);
75 } // end mystrrchr()
smooth NULL
Definition: ftsmooth.c:416
char string[160]
Definition: util.h:11
GLuint start
Definition: gl.h:1545

◆ OpenOurVolume()

HANDLE OpenOurVolume ( PCHAR  szDeviceName)

Definition at line 780 of file user_lib.cpp.

783 {
784  HANDLE hDevice;
785 
786  // Open device volume
789  NULL,
790  OPEN_EXISTING,
792 
793  if (hDevice == ((HANDLE)-1)) {
796  NULL,
797  OPEN_EXISTING,
799 
800  }
801  return hDevice;
802 } // end OpenOurVolume()
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_SHARE_READ
Definition: compat.h:125
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
static const WCHAR szDeviceName[]
Definition: provider.c:56
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904

Referenced by CheckCDType().

◆ Privilege()

BOOL Privilege ( LPTSTR  pszPrivilege,
BOOL  bEnable 
)

Definition at line 531 of file user_lib.cpp.

535 {
536 
537  HANDLE hToken;
539 
540  //
541  // obtain the token, first check the thread and then the process
542  //
544  if (GetLastError() == ERROR_NO_TOKEN) {
546  return FALSE;
547  }
548  else return FALSE;
549  }
550 
551  //
552  // get the luid for the privilege
553  //
554  if (!LookupPrivilegeValue(NULL, pszPrivilege, &tp.Privileges[0].Luid))
555  return FALSE;
556 
557  tp.PrivilegeCount = 1;
558 
559  if (bEnable)
560  tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
561  else
562  tp.Privileges[0].Attributes = 0;
563 
564  //
565  // enable or disable the privilege
566  //
567  if (!AdjustTokenPrivileges(hToken, FALSE, &tp, 0, (PTOKEN_PRIVILEGES)NULL, 0))
568  return FALSE;
569 
570  if (!CloseHandle(hToken))
571  return FALSE;
572 
573  return TRUE;
574 } // end Privilege()
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define LookupPrivilegeValue
Definition: winbase.h:3694
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
HANDLE WINAPI GetCurrentThread(VOID)
Definition: proc.c:1148
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2855
#define TOKEN_QUERY
Definition: setypes.h:874
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
#define ERROR_NO_TOKEN
Definition: winerror.h:587
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
Definition: security.c:338
_In_ BOOL bEnable
Definition: winddi.h:3426
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876

Referenced by BasepIsRealtimeAllowed(), Ext2InvalidateVolumes(), FFSInvalidateVolumes(), HasPrivilege(), LsapAddPrivilegeToTokenPrivileges(), my_open(), NtOpenObjectAuditAlarm(), NtPrivilegeCheck(), NtPrivilegedServiceAuditAlarm(), RfsdInvalidateVolumes(), RtlAcquirePrivilege(), RtlAdjustPrivilege(), SePrivilegePolicyCheck(), SepSinglePrivilegeCheck(), SeReleaseLuidAndAttributesArray(), SetInformationJobObject(), SetLocalTime(), SetProcessWorkingSetSizeEx(), SetSystemTime(), SmpAcquirePrivilege(), test_AccessCheck(), test_impersonation_level(), and test_pack_PRIVILEGE_SET().

◆ RegDelString()

BOOL RegDelString ( LPSTR  pszKey,
LPSTR  pszValue 
)

Definition at line 294 of file user_lib.cpp.

298 {
299 
300  HKEY hKey;
301  DWORD dwDisposition;
302 
303  // Create the key, if it exists it will be opened
304  if (ERROR_SUCCESS !=
306  HKEY_LOCAL_MACHINE, // handle of an open key
307  pszKey, // address of subkey name
308  0, // reserved
309  NULL, // address of class string
310  REG_OPTION_NON_VOLATILE, // special options flag
311  KEY_ALL_ACCESS, // desired security access
312  NULL, // address of key security structure
313  &hKey, // address of buffer for opened handle
314  &dwDisposition)) // address of disposition value buffer
315  {
316  return FALSE;
317  }
318 
319  // Write the value and it's data to the key
320  if (ERROR_SUCCESS !=
322  hKey, // handle of key to set value for
323  pszValue))
324  {
325 
326  RegCloseKey(hKey);
327  return FALSE;
328  }
329 
330  // Close the key
331  RegCloseKey(hKey);
332 
333  return TRUE;
334 } // end RegDelString()
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define RegDeleteValue
Definition: winreg.h:508
unsigned long DWORD
Definition: ntddk_ex.h:95
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define RegCreateKeyEx
Definition: winreg.h:501
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ RegisterDword()

BOOL RegisterDword ( LPSTR  pszKey,
LPSTR  pszValue,
DWORD  dwData 
)

Definition at line 377 of file user_lib.cpp.

382 {
383 
384  HKEY hKey;
385  DWORD dwDisposition;
386 
387  // Create the key, if it exists it will be opened
388  if (ERROR_SUCCESS !=
390  HKEY_LOCAL_MACHINE, // handle of an open key
391  pszKey, // address of subkey name
392  0, // reserved
393  NULL, // address of class string
394  REG_OPTION_NON_VOLATILE, // special options flag
395  KEY_ALL_ACCESS, // desired security access
396  NULL, // address of key security structure
397  &hKey, // address of buffer for opened handle
398  &dwDisposition)) // address of disposition value buffer
399  {
400  return FALSE;
401  }
402 
403  // Write the value and it's data to the key
404  if (ERROR_SUCCESS !=
406  hKey, // handle of key to set value for
407  pszValue, // address of value to set
408  0, // reserved
409  REG_DWORD, // flag for value type
410  (CONST BYTE *)&dwData, // address of value data
411  4 )) // size of value data
412  {
413 
414  RegCloseKey(hKey);
415  return FALSE;
416  }
417 
418  // Close the key
419  RegCloseKey(hKey);
420 
421  return TRUE;
422 } // end RegisterDword()
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
static HANDLE ULONG_PTR dwData
Definition: file.c:35
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_DWORD
Definition: sdbapi.c:596
#define CONST
Definition: pedump.c:81
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ RegisterString()

BOOL RegisterString ( LPSTR  pszKey,
LPSTR  pszValue,
LPSTR  pszData,
BOOLEAN  MultiSz,
DWORD  size 
)

Definition at line 244 of file user_lib.cpp.

251 {
252 
253  HKEY hKey;
254  DWORD dwDisposition;
255 
256  // Create the key, if it exists it will be opened
257  if (ERROR_SUCCESS !=
259  HKEY_LOCAL_MACHINE, // handle of an open key
260  pszKey, // address of subkey name
261  0, // reserved
262  NULL, // address of class string
263  REG_OPTION_NON_VOLATILE, // special options flag
264  KEY_ALL_ACCESS, // desired security access
265  NULL, // address of key security structure
266  &hKey, // address of buffer for opened handle
267  &dwDisposition)) // address of disposition value buffer
268  {
269  return FALSE;
270  }
271 
272  // Write the value and it's data to the key
273  if (ERROR_SUCCESS !=
275  hKey, // handle of key to set value for
276  pszValue, // address of value to set
277  0, // reserved
278  MultiSz ? REG_MULTI_SZ : REG_SZ, // flag for value type
279  (CONST BYTE *)pszData, // address of value data
280  MultiSz ? size : strlen(pszData) )) // size of value data
281  {
282 
283  RegCloseKey(hKey);
284  return FALSE;
285  }
286 
287  // Close the key
288  RegCloseKey(hKey);
289 
290  return TRUE;
291 } // end RegisterString()
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define REG_MULTI_SZ
Definition: nt_native.h:1501
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned char BYTE
Definition: mem.h:68
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define CONST
Definition: pedump.c:81
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by CheckCdrwFilter().

◆ ServiceInfo()

JS_SERVICE_STATE ServiceInfo ( LPCTSTR  ServiceName)

Return service status by service name.

Definition at line 157 of file user_lib.cpp.

160 {
161  SC_HANDLE schService;
162  DWORD RC;
164  JS_SERVICE_STATE return_value;
165  SC_HANDLE schSCManager;
166 
167  schSCManager = OpenSCManager(
168  NULL, // machine (NULL == local)
169  NULL, // database (NULL == default)
170  SC_MANAGER_ALL_ACCESS // access required
171  );
172  if (!schSCManager) {
173  schSCManager = OpenSCManager(
174  NULL, // machine (NULL == local)
175  NULL, // database (NULL == default)
176  SC_MANAGER_CONNECT // access required
177  );
178  }
179  if (!schSCManager)
180  return JS_ERROR_STATUS;
181  schService = OpenService(schSCManager, ServiceName, SERVICE_QUERY_STATUS);
182  if (!schService) {
183  RC = GetLastError();
184  CloseServiceHandle(schSCManager);
186  else return JS_ERROR_STATUS;
187  }
188  QueryServiceStatus(schService, &ssStatus);
190  return_value = JS_SERVICE_RUNNING;
191  } else {
192  return_value = JS_SERVICE_NOT_RUNNING;
193  }
194  CloseServiceHandle(schService);
195  CloseServiceHandle(schSCManager);
196  return return_value;
197 } // end ServiceInfo()
DWORD dwCurrentState
Definition: winsvc.h:100
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Errror while taking service status.
Definition: user_lib.h:57
#define OpenService
Definition: winsvc.h:576
#define SERVICE_RUNNING
Definition: winsvc.h:24
Service is running.
Definition: user_lib.h:55
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
enum _JS_SERVICE_STATE JS_SERVICE_STATE
Service state constants.
#define SERVICE_QUERY_STATUS
Definition: winsvc.h:55
#define OpenSCManager
Definition: winsvc.h:575
LPTSTR ServiceName
Definition: ServiceMain.c:15
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:2788
Service installed, but not running.
Definition: user_lib.h:56
#define SC_MANAGER_ALL_ACCESS
Definition: winsvc.h:13
#define ERROR_SERVICE_DOES_NOT_EXIST
Definition: winerror.h:611
Service not installed.
Definition: user_lib.h:54
SERVICE_STATUS ssStatus
Definition: service.c:34

Referenced by Create(), and SetConfig().

◆ SetOptUlong()

BOOL SetOptUlong ( PCHAR  Path,
PCHAR  OptName,
PULONG  OptVal 
)

Definition at line 723 of file user_lib.cpp.

728 {
729  if(!Path) {
730  return FALSE;
731  }
732  if(Path[0] && Path[1] == ':') {
733  CHAR SettingFile[MAX_PATH];
734  CHAR Setting[16];
735  if(Path[2] != '\\') {
736  sprintf(SettingFile, "%s\\%s", Path, UDF_CONFIG_STREAM_NAME);
737  } else {
738  sprintf(SettingFile, "%s%s", Path, UDF_CONFIG_STREAM_NAME);
739  }
740  sprintf(Setting, "%d\n", (*OptVal));
741  return WritePrivateProfileString("DiskSettings", OptName, Setting, SettingFile);
742  }
743  return SetRegUlong(Path, OptName, OptVal);
744 } // end SetOptUlong()
char CHAR
Definition: xmlstorage.h:175
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define MAX_PATH
Definition: compat.h:26
PRTL_UNICODE_STRING_BUFFER Path
#define UDF_CONFIG_STREAM_NAME
Definition: udfpubl.h:81
BOOL SetRegUlong(LPSTR pszKey, LPSTR pszValue, PULONG pszData)
Definition: user_lib.cpp:465
#define WritePrivateProfileString
Definition: winbase.h:3747

◆ UDFGetDeviceName()

PCHAR UDFGetDeviceName ( PCHAR  szDeviceName)

Definition at line 656 of file user_lib.cpp.

659 {
660  HANDLE hDevice;
662  ULONG RC;
663 
664  ODS(" UDFGetDeviceName\r\n");
667  NULL,
670 
671  if (hDevice == ((HANDLE)-1)) {
673  return (PCHAR)&RealDeviceName;
674  }
675 
677  &DeviceName,(MAX_PATH+1)*sizeof(WCHAR),
678  &DeviceName,(MAX_PATH+1)*sizeof(WCHAR), FALSE,NULL);
679 
680  if(RC == 1) {
682  RealDeviceName[(USHORT)DeviceName[0]/sizeof(USHORT)] = '\0';
683  } else {
685  }
686 
687  CloseHandle(hDevice);
688 
689  return (PCHAR)(strrchr(RealDeviceName, '\\')+1);
690 } // end UDFGetDeviceName()
signed char * PCHAR
Definition: retypes.h:7
#define CloseHandle
Definition: compat.h:406
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
#define IOCTL_CDRW_GET_DEVICE_NAME
Definition: cdrw_usr.h:121
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define FILE_SHARE_READ
Definition: compat.h:125
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ODS(sz)
Definition: user_lib.h:26
#define MAX_PATH
Definition: compat.h:26
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
static const WCHAR szDeviceName[]
Definition: provider.c:56
CHAR RealDeviceName[MAX_PATH+1]
Definition: user_lib.cpp:653
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:904
unsigned short USHORT
Definition: pedump.c:61
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)

Referenced by UDFGetOptUlongInherited().

◆ UDFGetOptUlongInherited()

ULONG UDFGetOptUlongInherited ( PCHAR  Drive,
PCHAR  OptName,
PULONG  OptVal,
ULONG  CheckDepth 
)

Definition at line 747 of file user_lib.cpp.

753 {
754  CHAR LocalPath[1024];
755  ULONG retval = 0;
756 
757  ODS(" UDFGetOptUlongInherited\r\n");
758 
759  if(GetOptUlong(UDF_SERVICE_PARAM_PATH, OptName, OptVal)) {
760  retval = UDF_OPTION_GLOBAL;
761  }
762  if(CheckDepth <= UDF_OPTION_GLOBAL) {
763  return retval;
764  }
765  strcpy(LocalPath,UDF_SERVICE_PARAM_PATH);
766  strcat(LocalPath,"\\");
767  strcat(LocalPath,UDFGetDeviceName(Drive));
768  if(GetOptUlong(LocalPath, OptName, OptVal)) {
769  retval = UDF_OPTION_DEVSPEC;
770  }
771  if(CheckDepth <= UDF_OPTION_DEVSPEC) {
772  return retval;
773  }
774  if(GetOptUlong(Drive, OptName, OptVal))
775  retval = UDF_OPTION_DISKSPEC;
776  return retval;
777 } // end UDFGetOptUlongInherited()
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
char CHAR
Definition: xmlstorage.h:175
#define UDF_SERVICE_PARAM_PATH
Definition: udf_reg.h:22
BOOL GetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
Definition: user_lib.cpp:693
#define UDF_OPTION_DEVSPEC
Definition: user_lib.h:167
PWCHAR Drive
Definition: chkdsk.c:73
#define UDF_OPTION_GLOBAL
Definition: user_lib.h:165
#define ODS(sz)
Definition: user_lib.h:26
PCHAR UDFGetDeviceName(PCHAR szDeviceName)
Definition: user_lib.cpp:656
#define UDF_OPTION_DISKSPEC
Definition: user_lib.h:168
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
unsigned int ULONG
Definition: retypes.h:1

◆ UDFPhSendIOCTL()

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 at line 628 of file user_lib.cpp.

638 {
639  ULONG real_read;
640  ULONG ret;
641  LONG offh=0;
645  &real_read,NULL);
646 
647  if (!RC) {
648  ret = GetLastError();
649  }
650  return RC ? 1 : -1;
651 } // end UDFPhSendIOCTL()
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
CHAR InputBuffer[80]
Definition: conmgr.c:33
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
int ret
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
unsigned int ULONG
Definition: retypes.h:1

Referenced by UDFGetDeviceName().

Variable Documentation

◆ MediaTypeStrings

TCHAR* MediaTypeStrings[]

Definition at line 25 of file user_lib.cpp.

Referenced by InitDeviceList().