Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900////////////////////////////////////////////////////////////////////// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine// All rights reserved// This file was released under the GPLv2 on June 2015.////////////////////////////////////////////////////////////////////
/*************************************************************************** File: user_lib.cpp** Module: User-mode library** Description: common useful user-mode functions** Author: Ivan**************************************************************************/
#ifndef __USER_LIB_CPP__#define __USER_LIB_CPP__
#include "user_lib.h"
TCHAR* MediaTypeStrings[] ={ "CD-ROM" , "CD-R" , "CD-RW" , "DVD-ROM" , "DVD-RAM" , "DVD-R" , "DVD-RW" , "DVD+R" , "DVD+RW" , "DD CD-ROM" , "DD CD-R" , "DD CD-RW" , "BD-ROM" , "BD-RE" , "[BUSY]" , "Unknown"};
void * __cdecl mymemchr ( const void * buf, int chr, size_t cnt ){ while ( cnt && (*(unsigned char *)buf != (unsigned char)chr) ) { buf = (unsigned char *)buf + 1; cnt--; }
return(cnt ? (void *)buf : NULL);} // end mymemchr()
char * __cdecl mystrrchr( const char * string, int ch ){ char *start = (char *)string;
while (*string++) {;}
while (--string != start && *string != (char)ch) {;}
if (*string == (char)ch) { return( (char *)string ); }
return(NULL);} // end mystrrchr()
char * __cdecl mystrchr( const char * string, int ch ){ while (*string != (char)ch && *string != '\0' ) { string++; }
if (*string == (char)ch) { return( (char *)string ); }
return(NULL);} // end mystrchr()
int __cdecl Exist ( PCHAR path ){ DWORD attr;
attr = GetFileAttributes((LPTSTR)path); if (attr == 0xffffffff) { return 0; }
return 1;
} // end Exist()
ULONGMyMessageBox( HINSTANCE hInst, HWND hWnd, LPCSTR pszFormat, LPCSTR pszTitle, UINT fuStyle, ... ){ CHAR szTitle[80]; CHAR szFormat[1024]; LPSTR pszMessage; BOOL fOk; int result; va_list ArgList;
if (!HIWORD(pszTitle)) { LoadString(hInst, LOWORD(pszTitle), szTitle, sizeof(szTitle)/sizeof(szTitle[0])); pszTitle = szTitle; }
if (!HIWORD(pszFormat)) { // Allow this to be a resource ID LoadString(hInst, LOWORD(pszFormat), szFormat, sizeof(szFormat)/sizeof(szFormat[0])); pszFormat = szFormat; }
va_start(ArgList, fuStyle); fOk = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING, pszFormat, 0, 0, (LPTSTR)&pszMessage, 0, &ArgList);
va_end(ArgList);
if (fOk && pszMessage) { result = MessageBox(hWnd, pszMessage, pszTitle, fuStyle | MB_SETFOREGROUND); LocalFree(pszMessage); } else { return -1; }
return result;} // end MyMessageBox()
/// Return service status by service name.JS_SERVICE_STATEServiceInfo( LPCTSTR ServiceName ){ SC_HANDLE schService; DWORD RC; SERVICE_STATUS ssStatus; JS_SERVICE_STATE return_value; SC_HANDLE schSCManager;
schSCManager = OpenSCManager( NULL, // machine (NULL == local) NULL, // database (NULL == default) SC_MANAGER_ALL_ACCESS // access required ); if (!schSCManager) { schSCManager = OpenSCManager( NULL, // machine (NULL == local) NULL, // database (NULL == default) SC_MANAGER_CONNECT // access required ); } if (!schSCManager) return JS_ERROR_STATUS; schService = OpenService(schSCManager, ServiceName, SERVICE_QUERY_STATUS); if (!schService) { RC = GetLastError(); CloseServiceHandle(schSCManager); if (RC == ERROR_SERVICE_DOES_NOT_EXIST) return JS_SERVICE_NOT_PRESENT; else return JS_ERROR_STATUS; } QueryServiceStatus(schService, &ssStatus); if(ssStatus.dwCurrentState == SERVICE_RUNNING) { return_value = JS_SERVICE_RUNNING; } else { return_value = JS_SERVICE_NOT_RUNNING; } CloseServiceHandle(schService); CloseServiceHandle(schSCManager); return return_value;} // end ServiceInfo()
BOOLCheckCdrwFilter( BOOL ReInstall ){ char CdromUpperFilters[1024]; bool found = false;
if (LOBYTE(LOWORD(GetVersion())) < 5) { return true; }
if (GetRegString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],arraylen(CdromUpperFilters))) { char *token = &CdromUpperFilters[0];
while (*token) { if (!strcmp(token,CDRW_SERVICE)) { found = true; break; } token += strlen(token)+1; } if (!found) { memcpy(token,CDRW_SERVICE,sizeof(CDRW_SERVICE)); *(token+sizeof(CDRW_SERVICE)) = '\0'; *(token+sizeof(CDRW_SERVICE)+1) = '\0'; if(ReInstall) { RegisterString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],TRUE,token-&CdromUpperFilters[0]+sizeof(CDRW_SERVICE)+1); found = true; } } } else { memcpy(CdromUpperFilters,CDRW_SERVICE,sizeof(CDRW_SERVICE)); CdromUpperFilters[sizeof(CDRW_SERVICE)] = '\0'; CdromUpperFilters[sizeof(CDRW_SERVICE)+1] = '\0'; if(ReInstall) { RegisterString(CDROM_CLASS_PATH,REG_UPPER_FILTER_NAME,&CdromUpperFilters[0],TRUE,sizeof(CDRW_SERVICE)+1); found = true; } } return found;
} // end CheckCdrwFilter()
BOOLRegisterString( LPSTR pszKey, LPSTR pszValue, LPSTR pszData, BOOLEAN MultiSz, DWORD size ){
HKEY hKey; DWORD dwDisposition;
// Create the key, if it exists it will be opened if (ERROR_SUCCESS != RegCreateKeyEx( HKEY_LOCAL_MACHINE, // handle of an open key pszKey, // address of subkey name 0, // reserved NULL, // address of class string REG_OPTION_NON_VOLATILE, // special options flag KEY_ALL_ACCESS, // desired security access NULL, // address of key security structure &hKey, // address of buffer for opened handle &dwDisposition)) // address of disposition value buffer { return FALSE; }
// Write the value and it's data to the key if (ERROR_SUCCESS != RegSetValueEx( hKey, // handle of key to set value for pszValue, // address of value to set 0, // reserved MultiSz ? REG_MULTI_SZ : REG_SZ, // flag for value type (CONST BYTE *)pszData, // address of value data MultiSz ? size : strlen(pszData) )) // size of value data {
RegCloseKey(hKey); return FALSE; }
// Close the key RegCloseKey(hKey);
return TRUE;} // end RegisterString()
BOOLRegDelString( LPSTR pszKey, LPSTR pszValue ){
HKEY hKey; DWORD dwDisposition;
// Create the key, if it exists it will be opened if (ERROR_SUCCESS != RegCreateKeyEx( HKEY_LOCAL_MACHINE, // handle of an open key pszKey, // address of subkey name 0, // reserved NULL, // address of class string REG_OPTION_NON_VOLATILE, // special options flag KEY_ALL_ACCESS, // desired security access NULL, // address of key security structure &hKey, // address of buffer for opened handle &dwDisposition)) // address of disposition value buffer { return FALSE; }
// Write the value and it's data to the key if (ERROR_SUCCESS != RegDeleteValue( hKey, // handle of key to set value for pszValue)) {
RegCloseKey(hKey); return FALSE; }
// Close the key RegCloseKey(hKey);
return TRUE;} // end RegDelString()
/// Get string from registry by Key path and Value nameBOOLGetRegString( LPSTR pszKey, LPSTR pszValue, LPSTR pszData, DWORD dwBufSize ){
HKEY hKey; DWORD dwDataSize = dwBufSize; DWORD dwValueType = REG_SZ;
if(!dwBufSize) return FALSE;
RegOpenKeyEx( HKEY_LOCAL_MACHINE, // handle of open key pszKey, // address of name of subkey to open 0, // reserved KEY_QUERY_VALUE, // security access mask &hKey // address of handle of open key );
if (ERROR_SUCCESS != RegQueryValueEx( hKey, // handle of key to query pszValue, // address of name of value to query 0, // reserved &dwValueType, // address of buffer for value type (BYTE *)pszData, // address of data buffer &dwDataSize // address of data buffer size )) return FALSE;
if (pszData[dwDataSize-1] != '\0') pszData[dwDataSize-1] = '\0';
return TRUE;} // end GetRegString()
BOOLRegisterDword( LPSTR pszKey, LPSTR pszValue, DWORD dwData ){
HKEY hKey; DWORD dwDisposition;
// Create the key, if it exists it will be opened if (ERROR_SUCCESS != RegCreateKeyEx( HKEY_LOCAL_MACHINE, // handle of an open key pszKey, // address of subkey name 0, // reserved NULL, // address of class string REG_OPTION_NON_VOLATILE, // special options flag KEY_ALL_ACCESS, // desired security access NULL, // address of key security structure &hKey, // address of buffer for opened handle &dwDisposition)) // address of disposition value buffer { return FALSE; }
// Write the value and it's data to the key if (ERROR_SUCCESS != RegSetValueEx( hKey, // handle of key to set value for pszValue, // address of value to set 0, // reserved REG_DWORD, // flag for value type (CONST BYTE *)&dwData, // address of value data 4 )) // size of value data {
RegCloseKey(hKey); return FALSE; }
// Close the key RegCloseKey(hKey);
return TRUE;} // end RegisterDword()
BOOLGetRegUlong( LPSTR pszKey, LPSTR pszValue, PULONG pszData ){
HKEY hKey; DWORD dwDataSize = 4; DWORD dwValueType = REG_DWORD; ULONG origValue = *pszData;
if(RegOpenKeyEx( HKEY_LOCAL_MACHINE, // handle of open key pszKey, // address of name of subkey to open 0, // reserved KEY_QUERY_VALUE, // security access mask &hKey // address of handle of open key ) != ERROR_SUCCESS) { (*pszData) = origValue; return FALSE; }
if(RegQueryValueEx( hKey, // handle of key to query pszValue, // address of name of value to query 0, // reserved &dwValueType,// address of buffer for value type (BYTE *)pszData, // address of data buffer &dwDataSize // address of data buffer size ) != ERROR_SUCCESS) { (*pszData) = origValue; }
RegCloseKey(hKey);
return TRUE;} // end GetRegUlong()
BOOLSetRegUlong( LPSTR pszKey, LPSTR pszValue, PULONG pszData ){
HKEY hKey; DWORD dwDataSize = 4; DWORD dwValueType = REG_DWORD; LPVOID lpMsgBuf; LONG RC;
if (!(ERROR_SUCCESS == (RC = RegOpenKeyEx( HKEY_LOCAL_MACHINE, // handle of open key pszKey, // address of name of subkey to open 0, // reserved KEY_ALL_ACCESS , // security access mask &hKey // address of handle of open key )))) { FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, RC, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL);
// Display the string. MessageBox( NULL, (CCHAR*)lpMsgBuf, "Error", MB_OK|MB_ICONHAND );
// Free the buffer. LocalFree( lpMsgBuf ); return FALSE; }
if (!(ERROR_SUCCESS == (RC = RegSetValueEx( hKey, // handle of key to query pszValue, // address of name of value to query 0, // reserved REG_DWORD,// address of buffer for value type (BYTE *)pszData, // address of data buffer sizeof(ULONG) // data buffer size )))) { FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, RC, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &lpMsgBuf, 0, NULL);
// Display the string. MessageBox( NULL, (CCHAR*)lpMsgBuf, "Error", MB_OK|MB_ICONHAND );
// Free the buffer. LocalFree( lpMsgBuf );
} RegCloseKey(hKey); return TRUE;} // end SetRegUlong()
BOOLPrivilege( LPTSTR pszPrivilege, BOOL bEnable ){
HANDLE hToken; TOKEN_PRIVILEGES tp;
// // obtain the token, first check the thread and then the process // if (!OpenThreadToken(GetCurrentThread(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, TRUE, &hToken)){ if (GetLastError() == ERROR_NO_TOKEN) { if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) return FALSE; } else return FALSE; }
// // get the luid for the privilege // if (!LookupPrivilegeValue(NULL, pszPrivilege, &tp.Privileges[0].Luid)) return FALSE;
tp.PrivilegeCount = 1;
if (bEnable) tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; else tp.Privileges[0].Attributes = 0;
// // enable or disable the privilege // if (!AdjustTokenPrivileges(hToken, FALSE, &tp, 0, (PTOKEN_PRIVILEGES)NULL, 0)) return FALSE;
if (!CloseHandle(hToken)) return FALSE;
return TRUE;} // end Privilege()
typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
BOOL IsWow64(VOID){ BOOL bIsWow64 = FALSE; LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"),"IsWow64Process");
if (NULL != fnIsWow64Process) { if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64)) { return FALSE; } } return bIsWow64;} // end IsWow64()
HANDLECreatePublicEvent( PWCHAR EventName ){ SECURITY_DESCRIPTOR sdPublic; SECURITY_ATTRIBUTES saPublic;
InitializeSecurityDescriptor( &sdPublic, SECURITY_DESCRIPTOR_REVISION );
SetSecurityDescriptorDacl( &sdPublic, TRUE, NULL, FALSE );
saPublic.nLength = sizeof(saPublic); saPublic.lpSecurityDescriptor = &sdPublic;
return CreateEventW( &saPublic, TRUE, FALSE, EventName);
} // end CreatePublicEvent()
/// Send Device IO Controls to undelaying level via handleULONGUDFPhSendIOCTL( IN ULONG IoControlCode, IN HANDLE DeviceObject, IN PVOID InputBuffer , IN ULONG InputBufferLength, OUT PVOID OutputBuffer , IN ULONG OutputBufferLength, IN BOOLEAN OverrideVerify, IN PVOID Dummy ){ ULONG real_read; ULONG ret; LONG offh=0; ULONG RC = DeviceIoControl(DeviceObject,IoControlCode, InputBuffer,InputBufferLength, OutputBuffer,OutputBufferLength, &real_read,NULL);
if (!RC) { ret = GetLastError(); } return RC ? 1 : -1;} // end UDFPhSendIOCTL()
CHAR RealDeviceName[MAX_PATH+1];
PCHARUDFGetDeviceName( PCHAR szDeviceName ){ HANDLE hDevice; WCHAR DeviceName[MAX_PATH+1]; ULONG RC;
ODS(" UDFGetDeviceName\r\n"); hDevice = CreateFile(szDeviceName, GENERIC_READ , FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDevice == ((HANDLE)-1)) { strcpy(RealDeviceName,""); return (PCHAR)&RealDeviceName; }
RC = UDFPhSendIOCTL(IOCTL_CDRW_GET_DEVICE_NAME,hDevice, &DeviceName,(MAX_PATH+1)*sizeof(WCHAR), &DeviceName,(MAX_PATH+1)*sizeof(WCHAR), FALSE,NULL);
if(RC == 1) { wcstombs((PCHAR)&RealDeviceName,&DeviceName[1],(USHORT)DeviceName[0]); RealDeviceName[(USHORT)DeviceName[0]/sizeof(USHORT)] = '\0'; } else { strcpy(RealDeviceName, szDeviceName+4); }
CloseHandle(hDevice);
return (PCHAR)(strrchr(RealDeviceName, '\\')+1);} // end UDFGetDeviceName()
BOOLGetOptUlong( PCHAR Path, PCHAR OptName, PULONG OptVal ){ if(!Path) { return FALSE; } if(Path[0] && Path[1] == ':') { CHAR SettingFile[MAX_PATH]; CHAR Setting[16];
sprintf(SettingFile, "%s\\%s", Path, UDF_CONFIG_STREAM_NAME); GetPrivateProfileString("DiskSettings", OptName, "d", &Setting[0], 10, SettingFile); Setting[15]=0; if (Setting[0] != 'd') { if(Setting[0] == '0' && Setting[1] == 'x') { sscanf(Setting+2, "%x", OptVal); } else { sscanf(Setting, "%d", OptVal); } return TRUE; } return FALSE; } return GetRegUlong(Path, OptName, OptVal);} // end GetOptUlong()
BOOLSetOptUlong( PCHAR Path, PCHAR OptName, PULONG OptVal ){ if(!Path) { return FALSE; } if(Path[0] && Path[1] == ':') { CHAR SettingFile[MAX_PATH]; CHAR Setting[16]; if(Path[2] != '\\') { sprintf(SettingFile, "%s\\%s", Path, UDF_CONFIG_STREAM_NAME); } else { sprintf(SettingFile, "%s%s", Path, UDF_CONFIG_STREAM_NAME); } sprintf(Setting, "%d\n", (*OptVal)); return WritePrivateProfileString("DiskSettings", OptName, Setting, SettingFile); } return SetRegUlong(Path, OptName, OptVal);} // end SetOptUlong()
ULONGUDFGetOptUlongInherited( PCHAR Drive, PCHAR OptName, PULONG OptVal, ULONG CheckDepth ){ CHAR LocalPath[1024]; ULONG retval = 0;
ODS(" UDFGetOptUlongInherited\r\n");
if(GetOptUlong(UDF_SERVICE_PARAM_PATH, OptName, OptVal)) { retval = UDF_OPTION_GLOBAL; } if(CheckDepth <= UDF_OPTION_GLOBAL) { return retval; } strcpy(LocalPath,UDF_SERVICE_PARAM_PATH); strcat(LocalPath,"\\"); strcat(LocalPath,UDFGetDeviceName(Drive)); if(GetOptUlong(LocalPath, OptName, OptVal)) { retval = UDF_OPTION_DEVSPEC; } if(CheckDepth <= UDF_OPTION_DEVSPEC) { return retval; } if(GetOptUlong(Drive, OptName, OptVal)) retval = UDF_OPTION_DISKSPEC; return retval;} // end UDFGetOptUlongInherited()
HANDLEOpenOurVolume( PCHAR szDeviceName ){ HANDLE hDevice;
// Open device volume hDevice = CreateFile(szDeviceName, GENERIC_READ , FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDevice == ((HANDLE)-1)) { hDevice = CreateFile(szDeviceName, GENERIC_READ , FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
} return hDevice;} // end OpenOurVolume()
ULONGdrv_letter_to_index( WCHAR a ){ if(a >= 'a' && a <= 'z') { return a - 'a'; } if(a >= 'A' && a <= 'Z') { return a - 'A'; } return -1;} // end drv_letter_to_index()
/// Start app with desired parametersDWORDWINAPILauncherRoutine2( LPVOID lpParameter ){ PCHAR ParamStr = (PCHAR)lpParameter; STARTUPINFO proc_startup_info; PROCESS_INFORMATION proc_info; CHAR szLaunchPath[MAX_PATH],ErrMes[50]; INT index; ULONG MkUdfRetCode; CHAR szTemp[256];
GetRegString(UDF_KEY,"ToolsPath",szLaunchPath, sizeof(szLaunchPath)); SetCurrentDirectory(szLaunchPath);
strcat(szLaunchPath,"\\"); //strcat(szLaunchPath,UDFFMT); strcat(szLaunchPath,ParamStr);
//strcpy(MkUdfStatus,"");
#ifndef TESTMODE proc_startup_info.cb = sizeof(proc_startup_info); proc_startup_info.lpReserved = 0; proc_startup_info.lpReserved2 = 0; proc_startup_info.cbReserved2 = 0; proc_startup_info.lpDesktop = 0; proc_startup_info.lpTitle = 0; proc_startup_info.dwFlags = 0;
proc_startup_info.hStdInput = NULL; proc_startup_info.hStdOutput = NULL; proc_startup_info.hStdError = NULL;
if(CreateProcess(NULL, szLaunchPath, 0,0, TRUE, CREATE_NO_WINDOW | NORMAL_PRIORITY_CLASS, 0,0, &proc_startup_info, &proc_info)) {
//hFmtProc[i] = proc_info.hProcess; WaitForSingleObject(proc_info.hProcess, -1); GetExitCodeProcess(proc_info.hProcess, &MkUdfRetCode); index=0;/* while (mkudf_err_msg[index].err_code != 0xffffffff){ if (mkudf_err_msg[index].err_code == MkUdfRetCode) break; index++; }*/ //strcpy(MkUdfStatus,mkudf_err_msg[index].err_msg);
CloseHandle(proc_info.hThread); CloseHandle(proc_info.hProcess); } else { strcpy(ErrMes,"Stop: Cannot launch "); strcat(ErrMes,szLaunchPath); sprintf(szTemp," error %d",GetLastError()); strcat(ErrMes,szTemp); MessageBox(NULL,ErrMes,"UDFFormat",MB_OK | MB_ICONHAND);
}#else MessageBox(NULL,szLaunchPath,"Message",MB_OK); Sleep(500); MkUdfRetCode = MKUDF_OK;// MkUdfRetCode = MKUDF_FORMAT_REQUIRED;// MkUdfRetCode = MKUDF_CANT_BLANK;
index = 0; while (mkudf_err_msg[index].err_code != 0xffffffff){ if (mkudf_err_msg[index].err_code == MkUdfRetCode) break; index++; } //strcpy(MkUdfStatus,mkudf_err_msg[index].err_msg);
#endif return MkUdfRetCode;} // end LauncherRoutine2()
#endif // __USER_LIB_CPP__