20#ifndef __USER_LIB_CPP__
21#define __USER_LIB_CPP__
51 while ( cnt && (*(
unsigned char *)
buf != (
unsigned char)chr) ) {
52 buf = (
unsigned char *)
buf + 1;
56 return(cnt ? (
void *)
buf :
NULL);
64 char *
start = (
char *)
string;
68 while (--
string !=
start && *
string != (
char)ch) {;}
70 if (*
string == (
char)ch) {
82 while (*
string != (
char)ch && *
string !=
'\0' ) {
86 if (*
string == (
char)ch) {
87 return( (
char *)
string );
101 if (
attr == 0xffffffff) {
134 pszFormat = szFormat;
140 pszFormat, 0, 0, (
LPTSTR)&pszMessage, 0, &ArgList);
144 if (fOk && pszMessage) {
161 SC_HANDLE schService;
165 SC_HANDLE schSCManager;
204 char CdromUpperFilters[1024];
212 char *
token = &CdromUpperFilters[0];
347 DWORD dwDataSize = dwBufSize;
370 if (pszData[dwDataSize-1] !=
'\0')
371 pszData[dwDataSize-1] =
'\0';
433 DWORD dwDataSize = 4;
435 ULONG origValue = *pszData;
444 (*pszData) = origValue;
456 (*pszData) = origValue;
473 DWORD dwDataSize = 4;
557 tp.PrivilegeCount = 1;
562 tp.Privileges[0].Attributes = 0;
584 if (
NULL != fnIsWow64Process)
615 saPublic.
nLength =
sizeof(saPublic);
664 ODS(
" UDFGetDeviceName\r\n");
671 if (hDevice == ((
HANDLE)-1)) {
709 if (Setting[0] !=
'd') {
710 if(Setting[0] ==
'0' && Setting[1] ==
'x') {
711 sscanf(Setting+2,
"%x", OptVal);
713 sscanf(Setting,
"%d", OptVal);
735 if(
Path[2] !=
'\\') {
740 sprintf(Setting,
"%d\n", (*OptVal));
754 CHAR LocalPath[1024];
757 ODS(
" UDFGetOptUlongInherited\r\n");
793 if (hDevice == ((
HANDLE)-1)) {
809 if(
a >=
'a' &&
a <=
'z') {
812 if(
a >=
'A' &&
a <=
'Z') {
836 strcat(szLaunchPath,
"\\");
838 strcat(szLaunchPath,ParamStr);
843 proc_startup_info.
cb =
sizeof(proc_startup_info);
856 0,0, &proc_startup_info, &proc_info)) {
873 strcpy(ErrMes,
"Stop: Cannot launch ");
874 strcat(ErrMes,szLaunchPath);
PRTL_UNICODE_STRING_BUFFER Path
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static WCHAR ServiceName[]
#define RegCloseKey(hKey)
#define IOCTL_CDRW_GET_DEVICE_NAME
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)
static const WCHAR szDeviceName[]
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
#define GetProcAddress(x, y)
#define GetCurrentProcess()
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLboolean GLboolean GLboolean a
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)
TCHAR szTitle[MAX_LOADSTRING]
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static HANDLE ULONG_PTR dwData
#define REG_OPTION_NON_VOLATILE
DWORD WINAPI GetVersion()
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
LPVOID lpSecurityDescriptor
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
#define REG_UPPER_FILTER_NAME
#define UDF_SERVICE_PARAM_PATH
struct err_msg_item mkudf_err_msg[]
#define UDF_CONFIG_STREAM_NAME
BOOL SetRegUlong(LPSTR pszKey, LPSTR pszValue, PULONG pszData)
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.
HANDLE CreatePublicEvent(PWCHAR EventName)
char *__cdecl mystrrchr(const char *string, int ch)
ULONG MyMessageBox(HINSTANCE hInst, HWND hWnd, LPCSTR pszFormat, LPCSTR pszTitle, UINT fuStyle,...)
CHAR RealDeviceName[MAX_PATH+1]
BOOL GetRegUlong(LPSTR pszKey, LPSTR pszValue, PULONG pszData)
int __cdecl Exist(PCHAR path)
BOOL GetRegString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, DWORD dwBufSize)
Get string from registry by Key path and Value name.
PCHAR UDFGetDeviceName(PCHAR szDeviceName)
TCHAR * MediaTypeStrings[]
DWORD WINAPI LauncherRoutine2(LPVOID lpParameter)
Start app with desired parameters.
BOOL(WINAPI * LPFN_ISWOW64PROCESS)(HANDLE, PBOOL)
BOOL SetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
void *__cdecl mymemchr(const void *buf, int chr, size_t cnt)
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
BOOL RegDelString(LPSTR pszKey, LPSTR pszValue)
ULONG UDFGetOptUlongInherited(PCHAR Drive, PCHAR OptName, PULONG OptVal, ULONG CheckDepth)
BOOL CheckCdrwFilter(BOOL ReInstall)
BOOL RegisterDword(LPSTR pszKey, LPSTR pszValue, DWORD dwData)
HANDLE OpenOurVolume(PCHAR szDeviceName)
JS_SERVICE_STATE ServiceInfo(LPCTSTR ServiceName)
Return service status by service name.
BOOL GetOptUlong(PCHAR Path, PCHAR OptName, PULONG OptVal)
char *__cdecl mystrchr(const char *string, int ch)
ULONG drv_letter_to_index(WCHAR a)
BOOL RegisterString(LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size)
#define UDF_OPTION_GLOBAL
#define UDF_OPTION_DISKSPEC
#define UDF_OPTION_DEVSPEC
enum _JS_SERVICE_STATE JS_SERVICE_STATE
Service state constants.
@ JS_SERVICE_RUNNING
Service is running.
@ JS_SERVICE_NOT_PRESENT
Service not installed.
@ JS_SERVICE_NOT_RUNNING
Service installed, but not running.
@ JS_ERROR_STATUS
Errror while taking service status.
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
#define NORMAL_PRIORITY_CLASS
#define LookupPrivilegeValue
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_STRING
HANDLE WINAPI GetCurrentThread(void)
#define GetFileAttributes
#define SetCurrentDirectory
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define WritePrivateProfileString
#define GetPrivateProfileString
#define ERROR_SERVICE_DOES_NOT_EXIST
#define HKEY_LOCAL_MACHINE
#define SERVICE_QUERY_STATUS
#define SC_MANAGER_CONNECT
#define SC_MANAGER_ALL_ACCESS
#define TOKEN_ADJUST_PRIVILEGES
#define SECURITY_DESCRIPTOR_REVISION
#define SE_PRIVILEGE_ENABLED