diff --git a/eramntui/eramntui.c b/eramntui/eramntui.c index f39cc6f..2f9887d 100644 --- a/eramntui/eramntui.c +++ b/eramntui/eramntui.c @@ -1,55 +1,54 @@ -/* ERAMNTUI.C  RAMディスクERAM for WindowsNT/2000/XP - コントロールパネルアプレット/クラスインストーラ -   Copyright (c) 1999-2004 by *Error15 +/* ERAMNTUI.C RAM Disk ERAM for WindowsNT/2000/XP + Control Panel Applet / Class Installer + Copyright (c) 1999-2004 by *Error15 + Translated into English by Katayama Hirofumi MZ . */ -/* 更新履歴 +/* History v1.00 - 新規作成 + Newly created. v1.01 - over32MB対応(64MBまで) + over32MB support (upto 64MB). v1.10 - Windows2000クラスインストーラ追加 + Windows2000 class installer added. v1.11 - Windows2000プロパティシートページ追加 - 非ページ,ページプールサイズ変更機能追加 + Windows2000 property sheet page added. + Non-page, page pool size modification feature added. v2.00 - 非ページ,ページプールサイズ変更機能廃止 - OS管理外メモリ設定機能追加 - アンインストール機能追加 + Non-page, page pool size modification feature obsoleted. + OS Management Outside Memory setting feature added. + Uninstaller feature added. v2.01 - アロケーションユニット32を増やして1GB確保可能… - アンインストール機能のWindows2000対応強化に伴いNT3.51対応廃止 + Increased Allocation Unit 32 and enabled 1GB allocation. + NT3.51 support was obsolete for uninstaller feature Windows2000 support enhancement. v2.02 - ドライブ文字が使用中の場合は警告を出すようにした - ページ数が6桁しか入力できなかったのを修正 - MAXMEM=nn以降のメモリの開始アドレスを書き込み可能にした - 削除後リブートダイアログが表示されていなかったのを修正 - NTで削除直後にRAMディスクが作成されていたのを修正 - メモリ検査スキップするかどうか保存可能にした - スワップファイルを扱えるようにするかどうか選択可能にした - NT3.51対応復活 - 設定変更後レジストリのドライブ文字から : が欠けていたのを修正 - イベントログメッセージ削除対応 + Add warning if drive character was in use. + Fix that page number was 6 digits only. + Enable to write the starting address of memory after MAXMEM=nn. + Fixed that the reboot dialog won't be shown after delete. + Fixed that the RAM disk was created immediately after deleting in NT. + Enabled to save the info that the memory check was skipped or not. + Resume the NT3.51 support. + Fixed the lacking a colon of the drive character of registry after setting changed. + Supported deletion of event log messages. v2.10 - Win2000以降(=FAT32対応)の場合は自動で対応bitを設定 - 最大アロケーションユニット64化 + Automatically set supported bits if Win2000 and later (=FAT32 support). + 64-nized max. allocation unit. v2.11 - WinXP対応 - Fastfatドライバのスタートアップ変更機能追加 + WinXP support. + Added startup change feature of Fastfat driver v2.12 - メモリ上限検出部のUIを逆転 - スタンバイ対策部追加 + Reversal of UI of Memory upper limit detector. + Add standby countermeasure unit. v2.20 - 'にに'文字列修正 - 文字列リソース米国対応 - 16bitFATの最大クラスタを65525に制限 - メッセージボックスをリソース対応 - オプションフラグを32bit化 - 4GB制限追加 - スワップ関係無く実デバイス設定可能にした - TEMPディレクトリ作成の編集追加 - ルートディレクトリ制限確認追加 + String resource american support. + Maximum cluster size of 16 bit FAT is limited to 65525. + Resource support of message box. + 32bit-nized option flag(s). + 4GB limitation added. + Made real device setting possible without swapping. + Add edit of the TEMP directory creation. + root directory restriction added. */ @@ -65,36 +64,36 @@ #include #include "eramntui.h" -#define RAMDISK_MEDIA_TYPE 0xf8 /* ERAMNT.H */ -#define SECTOR (512) /* ERAMNT.H */ -#define PAGE_SIZE_4K (1024 * 4) /* 1ページの大きさ */ -#define DISKMAXCLUSTER_16 (65525) /* FAT16の最大クラスタ */ -#define DISKMAXCLUSTER_32 (268435455) /* FAT32の最大クラスタ */ -#define DISKMINPAGE (16) /* データ領域が確保できない;アロケーション2では2が最小 */ -#define MAXALLOCUNIT (64) /* アロケーションユニット */ -#define MAXINSTANCE (9999) /* インスタンス */ -#define LIMIT_4GBPAGES (0xfffff) /* 4GBページ */ +#define RAMDISK_MEDIA_TYPE 0xf8 /* ERAMNT.H */ +#define SECTOR (512) /* ERAMNT.H */ +#define PAGE_SIZE_4K (1024 * 4) /* the size of one page */ +#define DISKMAXCLUSTER_16 (65525) /* The max cluster(s) of FAT16 */ +#define DISKMAXCLUSTER_32 (268435455) /* The max cluster(s) of FAT32 */ +#define DISKMINPAGE (16) /* Unable to allocate the data area; 2 is minimal value in Allocation 2 */ +#define MAXALLOCUNIT (64) /* allocation unit */ +#define MAXINSTANCE (9999) /* The max instance(s) */ +#define LIMIT_4GBPAGES (0xfffff) /* 4GB pages */ #define EXPORT __declspec(dllexport) #define SPPSR_ENUM_ADV_DEVICE_PROPERTIES 3 -/* ERAMレジストリ設定値参照用構造体 */ +/* The structure for referencing the ERAM registry setting values */ typedef union { - DWORD dwOptflag; // ERAM制御 + DWORD dwOptflag; // ERAM Control. struct { - BYTE NonPaged:1; // bit 0:NonPagedPool使用 - BYTE External:1; // bit 1:外部メモリ使用 - BYTE SkipExternalCheck:1; // bit 2:外部メモリ使用時メモリ検査しない - BYTE Swapable:1; // bit 3:ローカルディスクとして扱う - BYTE EnableFat32:1; // bit 4:FAT32の使用を許可 - BYTE SkipReportUsage:1; // bit 5:外部メモリ使用時Reportしない=2000:スタンバイ可 - BYTE MakeTempDir:1; // bit 6:TEMPディレクトリ作成 + BYTE NonPaged:1; // bit 0:NonPagedPool use. + BYTE External:1; // bit 1:External memory use. + BYTE SkipExternalCheck:1; // bit 2:Do not check memory when using external memory + BYTE Swapable:1; // bit 3:Treat as local disk + BYTE EnableFat32:1; // bit 4:Allow FAT32 use. + BYTE SkipReportUsage:1; // bit 5:When using external memory don't report=2000:stand-by OK + BYTE MakeTempDir:1; // bit 6:TEMP directory creation. BYTE byResv7:1; // bit 7: BYTE byResv8:8; // bit 8: BYTE byResv16:8; // bit16: BYTE byResv24:7; // bit24: - BYTE UseExtFile:1; // bit31:外部ファイル使用 + BYTE UseExtFile:1; // bit31:External file use. } Bits; } ERAM_OPTFLAG, *PERAM_OPTFLAG; @@ -108,14 +107,14 @@ typedef struct { CHAR szDefDrv[3]; } ERAMREGOPT, *PERAMREGOPT, FAR *LPERAMREGOPT; -/* SETUPAPI関数型定義 */ +/* SETUPAPI function type definitions */ typedef HDEVINFO (WINAPI* LPFNSETUPDIGETCLASSDEVSA)(LPGUID, PCSTR, HWND, DWORD); typedef BOOL (WINAPI* LPFNSETUPDIENUMDEVICEINFO)(HDEVINFO, DWORD, PSP_DEVINFO_DATA); typedef BOOL (WINAPI* LPFNSETUPDIREMOVEDEVICE)(HDEVINFO, PSP_DEVINFO_DATA); typedef BOOL (WINAPI* LPFNSETUPDIDESTROYDEVICEINFOLIST)(HDEVINFO); typedef HKEY (WINAPI* LPFNSETUPDIOPENDEVREGKEY)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM); -/* ERAM内関数ポインタ */ +/* function pointer(s) in ERAM */ typedef struct { HMODULE hSetupApi; LPFNSETUPDIGETCLASSDEVSA lpfnSetupDiGetClassDevs; @@ -125,7 +124,7 @@ typedef struct { LPFNSETUPDIOPENDEVREGKEY lpfnSetupDiOpenDevRegKey; } SETUPAPIENTRYS, FAR *LPSETUPAPIENTRYS, *PSETUPAPIENTRYS; -/* グローバル変数 */ +/* global variables */ HINSTANCE hgInstance = NULL; BOOL bUpdate = FALSE; BOOL bReboot = FALSE; @@ -133,7 +132,7 @@ HKEY hgKey = NULL; BOOL bProp = FALSE; SETUPAPIENTRYS sSetupApi = { NULL, NULL, NULL, NULL, NULL, NULL }; -/* 文字列定数 */ +/* string constants */ CHAR szWinName[] = "ERAM for Windows NT/2000/XP"; CHAR szRootDir[] = "RootDirEntries"; CHAR szOption[] = "Option"; @@ -143,7 +142,7 @@ CHAR szDefDrv[] = "DriveLetter"; CHAR szPage[] = "Page"; CHAR szExtStart[] = "ExtStart"; -/* プロトタイプ */ +/* prototypes */ BOOL WINAPI StatusDlgProc(HWND, UINT, WPARAM, LPARAM); BOOL WINAPI WmInitDialog(HWND, HWND, LPARAM); VOID WINAPI GetRegOption(LPERAMREGOPT); @@ -167,116 +166,116 @@ LPCSTR WINAPI GetEramClass(GUID*); LPSTR WINAPI GetResStr(WORD, LPSTR, INT); -/* StatusDlgProc - 設定ダイアログ - 引数 - hDlg ダイアログのウィンドウハンドル - uMsg メッセージ - wParam 引数 - lParam 引数 - 戻り値 - 結果 +/* StatusDlgProc + Setting Dialog. + Parameters + hDlg The window handle of dialog. + uMsg The message. + wParam Parameters + lParam Parameters + Return Value + The results. */ BOOL WINAPI StatusDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { - HANDLE_MSG(hDlg, WM_INITDIALOG , WmInitDialog); /* ダイアログ作成時 */ - HANDLE_MSG(hDlg, WM_COMMAND , WmCommand); /* コントロール操作時 */ - HANDLE_MSG(hDlg, WM_NOTIFY , WmNotify); /* 通知メッセージ受信時 */ - HANDLE_MSG(hDlg, WM_DESTROY , WmDestroy); /* 閉じる */ + HANDLE_MSG(hDlg, WM_INITDIALOG , WmInitDialog); /* On dialog creation */ + HANDLE_MSG(hDlg, WM_COMMAND , WmCommand); /* On control handling */ + HANDLE_MSG(hDlg, WM_NOTIFY , WmNotify); /* On notification received */ + HANDLE_MSG(hDlg, WM_DESTROY , WmDestroy); /* Close */ } return FALSE; } -/* WmInitDialog - ダイアログ初期化時の処理 - 引数 - hDlg ダイアログのウィンドウハンドル - hwndFocus フォーカスを受け取るコントロールのハンドル - lInitParam 引数 - 戻り値 - 結果 +/* WmInitDialog + Dialog Initialization Processing. + Parameters + hDlg The window handle of dialog. + hwndFocus The control handle to be got focus. + lInitParam Parameters + Return Value + The results. */ BOOL WINAPI WmInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lInitParam) { - /* ローカル変数 */ + /* Local variable(s) */ DWORD dwDisp; ERAMREGOPT EramOpt; CHAR szPath[MAX_PATH], szText[128]; - /* フラグ初期化 */ + /* Initialization of flag(s) */ bUpdate = FALSE; bReboot = FALSE; - /* プロパティのときは不要なボタンを隠す */ + /* Hide the needless button if property */ if (bProp != FALSE) { ShowWindow(GetDlgItem(hDlg, IDOK), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDCANCEL), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDC_UPDATE), SW_HIDE); } - /* レジストリキーオープン */ + /* Open the registry key */ wsprintf(szPath, "%s\\Eram\\Parameters", REGSTR_PATH_SERVICES); - if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hgKey, &dwDisp) != ERROR_SUCCESS) /* 失敗 */ + if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hgKey, &dwDisp) != ERROR_SUCCESS) /* Failure */ { MessageBox(hDlg, GetResStr(IDS_ERR_OPEN_REG, szText, sizeof(szText)), szWinName, MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); EndDialog(hDlg, 0); return FALSE; } - /* レジストリ値取得 */ + /* Get the registry value */ GetRegOption(&EramOpt); - /* レジストリ値をコントロールに反映 */ + /* Adapt the registry value(s) to the control(s). */ SetPageOption(hDlg, &EramOpt); return FALSE; } -/* GetRegOption - レジストリ設定値の取得 - 引数 - lpEramOpt ERAM_REGOPT構造体へのポインタ - 戻り値 - なし +/* GetRegOption + Get the registry setting value. + Parameters + lpEramOpt The pointer to ERAM_REGOPT structure. + Return Value + None. */ VOID WINAPI GetRegOption(LPERAMREGOPT lpEramOpt) { - /* ルートディレクトリ数取得 */ + /* Get the number of root directories */ ReadRegValues(hgKey, szRootDir, REG_DWORD, &(lpEramOpt->wRootDir), sizeof(lpEramOpt->wRootDir), 128); - /* オプション取得 */ + /* Get the option(s) */ ReadRegValues(hgKey, szOption, REG_DWORD, &(lpEramOpt->uOption.dwOptflag), sizeof(lpEramOpt->uOption.dwOptflag), 0); - /* アロケーションユニット取得 */ + /* Get the allocation unit */ ReadRegValues(hgKey, szAllocUnit, REG_DWORD, &(lpEramOpt->byAllocUnit), sizeof(lpEramOpt->byAllocUnit), 1024 / SECTOR); - /* メディアID取得 */ + /* Get the media ID */ ReadRegValues(hgKey, szMediaId, REG_DWORD, &(lpEramOpt->byMediaId), sizeof(lpEramOpt->byMediaId), RAMDISK_MEDIA_TYPE); - /* ドライブ文字取得 */ + /* Get the drive character */ ReadRegValues(hgKey, szDefDrv, REG_SZ, lpEramOpt->szDefDrv, sizeof(lpEramOpt->szDefDrv), (WORD)'Z'); lpEramOpt->szDefDrv[1] = '\0'; - /* ページ数取得 */ + /* Get the number of pages */ ReadRegValues(hgKey, szPage, REG_DWORD, &(lpEramOpt->dwSizePage), sizeof(lpEramOpt->dwSizePage), DISKMINPAGE); - /* 外部メモリ開始位置取得 */ + /* Get the starting position of external memory */ ReadRegValues(hgKey, szExtStart, REG_DWORD, &(lpEramOpt->dwExtStart), sizeof(lpEramOpt->dwExtStart), 0); } -/* ReadRegValues - レジストリの取得と既定値設定 - 引数 - hKey アクセスするキー - lpszValueName 値名文字列へのポインタ - uType 値タイプ REG_DWORD または REG_SZ - lpVal 値取得領域へのポインタ - uSizeOrg 値取得領域のサイズ - wDefVal 既定値 - 戻り値 - なし +/* ReadRegValues + Get the registry and set the default values. + Parameters + hKey The key to be accessed. + lpszValueName The pointer to the value name string. + uType The value type of REG_DWORD or REG_SZ + lpVal The pointer to the value to be retrived. + uSizeOrg The size of the value to get. + wDefVal The default value. + Return Value + None. */ VOID WINAPI ReadRegValues(HKEY hKey, LPSTR lpszValueName, UINT uType, LPVOID lpVal, ULONG uSizeOrg, WORD wDefVal) { - /* ローカル変数 */ + /* Local variable(s) */ LONG lRet; ULONG uSize; DWORD dwVal, dwType; @@ -284,12 +283,12 @@ VOID WINAPI ReadRegValues(HKEY hKey, LPSTR lpszValueName, UINT uType, LPVOID lpV { case REG_DWORD: uSize = sizeof(dwVal); - /* レジストリ値取得 */ + /* Get the registry value */ lRet = RegQueryValueEx(hKey, lpszValueName, NULL, &dwType, (LPBYTE)(&dwVal), &uSize); if ((lRet == ERROR_SUCCESS)&& - (dwType == uType)) /* 取得成功 */ + (dwType == uType)) /* Successfully got */ { - /* 取得値を設定 */ + /* Set the retrieved value */ switch (uSizeOrg) { case sizeof(DWORD): @@ -306,16 +305,16 @@ VOID WINAPI ReadRegValues(HKEY hKey, LPSTR lpszValueName, UINT uType, LPVOID lpV break; case REG_SZ: uSize = uSizeOrg; - /* レジストリ値取得 */ + /* Get the registry value */ lRet = RegQueryValueEx(hKey, lpszValueName, NULL, &dwType, lpVal, &uSize); if ((lRet == ERROR_SUCCESS)&& - (dwType == uType)) /* 取得成功 */ + (dwType == uType)) /* Successfully got */ { return; } break; } - /* 既定値を設定 */ + /* Set the default value */ switch (uSizeOrg) { case sizeof(DWORD): @@ -331,27 +330,27 @@ VOID WINAPI ReadRegValues(HKEY hKey, LPSTR lpszValueName, UINT uType, LPVOID lpV } -/* SetPageOption - レジストリ値をコントロールに反映 - 引数 - hDlg ダイアログのウィンドウハンドル - lpEramOpt ERAM_REGOPT構造体へのポインタ - 戻り値 - なし +/* SetPageOption + Adapt the registry values to the controls. + Parameters + hDlg The window handle of dialog. + lpEramOpt The pointer to ERAM_REGOPT structure. + Return Value + None. */ VOID WINAPI SetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) { - /* ローカル変数 */ + /* Local variable(s) */ CHAR szId[3], szDrv[2], szAlloc[3]; HWND hCtl; UINT loopi, uAlloc; CHAR cDrv; INT nSelect; - /* ルートディレクトリ数設定 */ + /* Set the number of root directories */ SetDlgItemInt(hDlg, IDC_EDIT_ROOTDIR, (UINT)(lpEramOpt->wRootDir), FALSE); - Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT_ROOTDIR), 4); /* 最大9999 */ - /* オプション設定 */ + Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT_ROOTDIR), 4); /* max 9999 */ + /* Set the option(s) */ if (lpEramOpt->uOption.Bits.NonPaged != 0) { Button_SetCheck(GetDlgItem(hDlg, IDC_RADIO_NONPAGED), 1); @@ -383,7 +382,7 @@ VOID WINAPI SetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) { Button_SetCheck(GetDlgItem(hDlg, IDC_CHECK_MAKE_TEMP), 1); } - /* アロケーションユニット設定 */ + /* Set the allocation unit */ hCtl = GetDlgItem(hDlg, IDC_COMBO_ALLOCUNIT); nSelect = -1; for (loopi=0, uAlloc=1; uAlloc<=MAXALLOCUNIT; loopi++, uAlloc<<=1) @@ -397,15 +396,15 @@ VOID WINAPI SetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) } if (nSelect < 0) { - nSelect = 1; /* 2 */ + nSelect = 1; /* 2 */ } ComboBox_SetCurSel(hCtl, nSelect); - /* メディアID設定 */ + /* Set the media ID */ wsprintf((LPSTR)szId, "%X", (UINT)(lpEramOpt->byMediaId)); hCtl = GetDlgItem(hDlg, IDC_EDIT_MEDIAID); Edit_SetText(hCtl, (LPSTR)szId); Edit_LimitText(hCtl, sizeof(szId)-1); - /* ドライブ文字設定 */ + /* Set the drive character */ hCtl = GetDlgItem(hDlg, IDC_COMBO_DRIVE); nSelect = -1; lpEramOpt->szDefDrv[0] &= ~0x20; @@ -421,17 +420,17 @@ VOID WINAPI SetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) } if (nSelect < 0) { - nSelect = loopi - 1; /* Z */ + nSelect = loopi - 1; /* Z */ } ComboBox_SetCurSel(hCtl, nSelect); - /* ページ数設定 */ + /* Set the page number */ SetDlgItemInt(hDlg, IDC_EDIT_PAGE, (ULONG)(lpEramOpt->dwSizePage << 2), FALSE); - Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT_PAGE), 7); /* 1024MB=1048576KB */ - /* 外部メモリ開始位置設定 */ + Edit_LimitText(GetDlgItem(hDlg, IDC_EDIT_PAGE), 7); /* 1024MB=1048576KB */ + /* Set the starting positioin of external memory */ hCtl = GetDlgItem(hDlg, IDC_EDIT_EXTSTART_MB); SetDlgItemInt(hDlg, IDC_EDIT_EXTSTART_MB, (ULONG)(lpEramOpt->dwExtStart / 0x100000), FALSE); - Edit_LimitText(hCtl, 4); /* 4095MB */ - if ((lpEramOpt->dwExtStart / 0x100000) != 0) /* 指定あり */ + Edit_LimitText(hCtl, 4); /* 4095MB */ + if ((lpEramOpt->dwExtStart / 0x100000) != 0) /* With specified */ { Button_SetCheck(GetDlgItem(hDlg, IDC_CHECK_EXTSTART), 1); } @@ -439,20 +438,20 @@ VOID WINAPI SetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) } -/* WmCommand - コントロール処理 - 引数 - hDlg ダイアログのウィンドウハンドル - wId 項目ID - hWndCtl コントロールのハンドル - wNotifyCode 通知コード - 戻り値 - なし +/* WmCommand + The control processing. + Parameters + hDlg The window handle of dialog. + wId The item ID. + hWndCtl The control handle. + wNotifyCode The notification code. + Return Value + None. */ VOID WINAPI WmCommand(HWND hDlg, INT wId, HWND hWndCtl, UINT wNotifyCode) { - /* 変更がかかったときにそれを記録 */ + /* Record them if there were changes */ switch (wId) { case IDC_COMBO_DRIVE: @@ -527,7 +526,7 @@ VOID WINAPI WmCommand(HWND hDlg, INT wId, HWND hWndCtl, UINT wNotifyCode) RegCloseKey(hgKey); hgKey = NULL; } - /* リブート */ + /* Reboot */ Reboot(hDlg); break; case IDC_CHECK_EXTSTART: @@ -541,26 +540,26 @@ VOID WINAPI WmCommand(HWND hDlg, INT wId, HWND hWndCtl, UINT wNotifyCode) } -/* EnableExtGroup - OS管理外メモリの使用可/不可制御 - 引数 - hDlg ダイアログのウィンドウハンドル - bEnable 設定可能にするかどうか - 戻り値 - なし +/* EnableExtGroup + Enable/Disable OS Management Outside Memory. + Parameters + hDlg The window handle of dialog. + bEnable To be enabled or not to be. + Return Value + None. */ VOID WINAPI EnableExtGroup(HWND hDlg, BOOL bEnable) { - /* ローカル変数 */ + /* Local variable(s) */ HWND hCtl; Static_Enable(GetDlgItem(hDlg, IDC_STATIC_EXT), bEnable); Button_Enable(GetDlgItem(hDlg, IDC_CHECK_NOTSEARCHSKIP), bEnable); Button_Enable(GetDlgItem(hDlg, IDC_CHECK_REPORTUSAGE), bEnable); hCtl = GetDlgItem(hDlg, IDC_CHECK_EXTSTART); Button_Enable(hCtl, bEnable); - if ((bEnable != FALSE)&& /* これから有効化 */ - (Button_GetCheck(hCtl) == 0)) /* 指定なし */ + if ((bEnable != FALSE)&& /* Enabling now */ + (Button_GetCheck(hCtl) == 0)) /* No specifying */ { bEnable = FALSE; } @@ -569,17 +568,17 @@ VOID WINAPI EnableExtGroup(HWND hDlg, BOOL bEnable) } -/* Reboot - リブート処理 - 引数 - hDlg ダイアログのウィンドウハンドル - 戻り値 - なし +/* Reboot + The reboot processing. + Parameters + hDlg The window handle of dialog. + Return Value + None. */ VOID WINAPI Reboot(HWND hDlg) { - /* ローカル変数 */ + /* Local variable(s) */ CHAR szText[128]; if (bReboot == FALSE) { @@ -597,63 +596,63 @@ VOID WINAPI Reboot(HWND hDlg) } -/* SettingUpdate - 設定更新処理 - 引数 - hDlg ダイアログのウィンドウハンドル - wId 項目ID - hWndCtl コントロールのハンドル - wNotifyCode 通知コード - 戻り値 - 結果 +/* SettingUpdate + The setting update processing. + Parameters + hDlg The window handle of dialog. + wId The item ID. + hWndCtl The control handle. + wNotifyCode The notification code. + Return Value + The results. */ BOOL WINAPI SettingUpdate(HWND hDlg) { - /* ローカル変数 */ + /* Local variable(s) */ ERAMREGOPT EramOpt; CHAR szText[128]; - if (bUpdate == FALSE) /* 更新無し */ + if (bUpdate == FALSE) /* No update */ { return TRUE; } - /* 画面情報取得 */ + /* Get the page info */ if (GetPageOption(hDlg, &EramOpt) == FALSE) { return FALSE; } - /* 設定情報更新 */ + /* Update the setting info */ if (SetRegOption(&EramOpt) == FALSE) { MessageBox(hDlg, GetResStr(IDS_ERR_REG_MODIFY, szText, sizeof(szText)), szWinName, MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); return FALSE; } - /* 再起動が必要なことをセット */ + /* Set them to reboot. */ bReboot = TRUE; bUpdate = FALSE; return TRUE; } -/* GetPageOption - 画面情報取得 - 引数 - hDlg ダイアログのウィンドウハンドル - lpEramOpt ERAM_REGOPT構造体へのポインタ - 戻り値 - 結果 +/* GetPageOption + Get the page option. + Parameters + hDlg The window handle of dialog. + lpEramOpt The pointer to ERAM_REGOPT structure. + Return Value + The results. */ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) { - /* ローカル変数 */ + /* Local variable(s) */ CHAR szId[3], szRoot[4], szMsg[128], szVolLabel[16], szText[128]; PSTR pEnd; ULONGLONG ulPageT; OSVERSIONINFO Ver; - /* ルートディレクトリ数取得 */ + /* Get the number of root directories */ lpEramOpt->wRootDir = (WORD)GetDlgItemInt(hDlg, IDC_EDIT_ROOTDIR, NULL, FALSE); - /* オプション取得 */ + /* Get the option(s) */ lpEramOpt->uOption.dwOptflag = 0; if (Button_GetCheck(GetDlgItem(hDlg, IDC_RADIO_NONPAGED)) != 0) { @@ -682,28 +681,28 @@ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) Ver.dwOSVersionInfoSize = sizeof(Ver); if ((GetVersionEx(&Ver) != FALSE)&& (Ver.dwPlatformId == VER_PLATFORM_WIN32_NT)&& - (Ver.dwMajorVersion >= 5)) /* Win2000以降 */ + (Ver.dwMajorVersion >= 5)) /* Win2000+ */ { lpEramOpt->uOption.Bits.EnableFat32 = 1; } - /* アロケーションユニット取得 */ + /* Get the allocation unit */ lpEramOpt->byAllocUnit = (BYTE)GetDlgItemInt(hDlg, IDC_COMBO_ALLOCUNIT, NULL, FALSE); - /* メディアID取得 */ + /* Get the media ID */ Edit_GetText(GetDlgItem(hDlg, IDC_EDIT_MEDIAID), (LPSTR)szId, sizeof(szId)); lpEramOpt->byMediaId = (BYTE)strtoul(szId, &pEnd, 16); - /* ドライブ文字取得 */ + /* Get the drive character */ ComboBox_GetText(GetDlgItem(hDlg, IDC_COMBO_DRIVE), (LPSTR)(lpEramOpt->szDefDrv), sizeof(lpEramOpt->szDefDrv)); if (lpEramOpt->szDefDrv[0] != '\0') { - if ((GetLogicalDrives() & (1 << (lpEramOpt->szDefDrv[0] - 'A'))) != 0) /* 現在使用中 */ + if ((GetLogicalDrives() & (1 << (lpEramOpt->szDefDrv[0] - 'A'))) != 0) /* Now using */ { wsprintf(szRoot, "%c:\\", lpEramOpt->szDefDrv[0]); switch (GetDriveType(szRoot)) { - case DRIVE_REMOTE: /* リモート */ - case DRIVE_RAMDISK: /* おそらく自身 */ + case DRIVE_REMOTE: /* Remote */ + case DRIVE_RAMDISK: /* Likely it's self */ break; - default: /* HDD等で利用中 */ + default: /* In use by HDD */ if ((GetVolumeInformation(szRoot, szVolLabel, sizeof(szVolLabel), NULL, NULL, NULL, NULL, 0) == FALSE)|| (lstrcmpi(szVolLabel, "ERAM-DRIVE") != 0)) { @@ -717,17 +716,17 @@ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) } } } - /* ページ数取得 */ + /* Get the page number */ lpEramOpt->dwSizePage = (GetDlgItemInt(hDlg, IDC_EDIT_PAGE, NULL, FALSE) + 3) >> 2; - if (lpEramOpt->uOption.Bits.EnableFat32 == 0) /* FAT32禁止 */ + if (lpEramOpt->uOption.Bits.EnableFat32 == 0) /* Prohibit FAT32 */ { ulPageT = ((ULONGLONG)DISKMAXCLUSTER_16 * SECTOR * lpEramOpt->byAllocUnit) / PAGE_SIZE_4K; } - else /* FAT32 */ + else /* FAT32 */ { ulPageT = ((ULONGLONG)DISKMAXCLUSTER_32 * SECTOR * lpEramOpt->byAllocUnit) / PAGE_SIZE_4K; } - if ((ULONGLONG)(lpEramOpt->dwSizePage) > ulPageT) /* アロケーションユニット制限超過 */ + if ((ULONGLONG)(lpEramOpt->dwSizePage) > ulPageT) /* exceed allocation unit restriction */ { lpEramOpt->dwSizePage = (DWORD)ulPageT; wsprintf(szMsg, GetResStr((WORD)((lpEramOpt->byAllocUnit == MAXALLOCUNIT) ? IDS_WARN_LIMIT_SIZE : IDS_WARN_LIMIT_SIZE_THIS_UNIT), szText, sizeof(szText)), ((DWORD)ulPageT << 2)); @@ -735,7 +734,7 @@ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) SetDlgItemInt(hDlg, IDC_EDIT_PAGE, ((DWORD)ulPageT << 2), FALSE); return FALSE; } - /* 4GBチェック */ + /* 4GB check */ if (lpEramOpt->dwSizePage > LIMIT_4GBPAGES) { lpEramOpt->dwSizePage = LIMIT_4GBPAGES; @@ -744,14 +743,14 @@ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) SetDlgItemInt(hDlg, IDC_EDIT_PAGE, (LIMIT_4GBPAGES << 2), FALSE); return FALSE; } - /* ルートディレクトリエントリ数検査 */ + /* Test the entry number of root directories */ if (lpEramOpt->dwSizePage <= (DWORD)(((lpEramOpt->wRootDir * 32) + (PAGE_SIZE_4K - 1)) / PAGE_SIZE_4K)) { MessageBox(hDlg, GetResStr(IDS_WARN_LIMIT_ROOTDIR, szText, sizeof(szText)), szWinName, MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); SetDlgItemInt(hDlg, IDC_EDIT_ROOTDIR, 128, FALSE); return FALSE; } - /* 外部メモリ開始位置取得 */ + /* Get the starting position of external memory */ lpEramOpt->dwExtStart = 0; if (Button_GetCheck(GetDlgItem(hDlg, IDC_CHECK_EXTSTART)) != 0) { @@ -761,55 +760,55 @@ BOOL WINAPI GetPageOption(HWND hDlg, LPERAMREGOPT lpEramOpt) } -/* SetRegOption - 設定情報更新 - 引数 - lpEramOpt ERAM_REGOPT構造体へのポインタ - 戻り値 - なし +/* SetRegOption + Update the setting info. + Parameters + lpEramOpt The pointer to ERAM_REGOPT structure. + Return Value + None. */ BOOL WINAPI SetRegOption(LPERAMREGOPT lpEramOpt) { - /* ローカル変数 */ + /* Local variable(s) */ DWORD dwVal; - /* ルートディレクトリ数設定 */ + /* Set the number of root directories */ dwVal = (DWORD)lpEramOpt->wRootDir; if (RegSetValueEx(hgKey, szRootDir, 0, REG_DWORD, (LPBYTE)(&dwVal), sizeof(dwVal)) != ERROR_SUCCESS) { return FALSE; } - /* オプション設定 */ + /* Set the option(s) */ dwVal = (DWORD)lpEramOpt->uOption.dwOptflag; if (RegSetValueEx(hgKey, szOption, 0, REG_DWORD, (LPBYTE)(&dwVal), sizeof(dwVal)) != ERROR_SUCCESS) { return FALSE; } - /* アロケーションユニット設定 */ + /* Set the allocation unit */ dwVal = (DWORD)lpEramOpt->byAllocUnit; if (RegSetValueEx(hgKey, szAllocUnit, 0, REG_DWORD, (LPBYTE)(&dwVal), sizeof(dwVal)) != ERROR_SUCCESS) { return FALSE; } - /* メディアID設定 */ + /* Set the media ID */ dwVal = (DWORD)lpEramOpt->byMediaId; if (RegSetValueEx(hgKey, szMediaId, 0, REG_DWORD, (LPBYTE)(&dwVal), sizeof(dwVal)) != ERROR_SUCCESS) { return FALSE; } - /* ドライブ文字設定 */ + /* Set the drive character */ lpEramOpt->szDefDrv[1] = ':'; lpEramOpt->szDefDrv[2] = '\0'; if (RegSetValueEx(hgKey, szDefDrv, 0, REG_SZ, (LPBYTE)(lpEramOpt->szDefDrv), sizeof(lpEramOpt->szDefDrv)) != ERROR_SUCCESS) { return FALSE; } - /* ページ数設定 */ + /* Set the page number */ if (RegSetValueEx(hgKey, szPage, 0, REG_DWORD, (LPBYTE)(&(lpEramOpt->dwSizePage)), sizeof(lpEramOpt->dwSizePage)) != ERROR_SUCCESS) { return FALSE; } - /* 外部メモリ開始位置設定 */ + /* Set the starting positioin of external memory */ if (RegSetValueEx(hgKey, szExtStart, 0, REG_DWORD, (LPBYTE)(&(lpEramOpt->dwExtStart)), sizeof(lpEramOpt->dwExtStart)) != ERROR_SUCCESS) { return FALSE; @@ -818,32 +817,32 @@ BOOL WINAPI SetRegOption(LPERAMREGOPT lpEramOpt) } -/* CPlApplet - コントロールパネルアプレット - 引数 - hwndCPL コントロールパネル親ウィンドウのハンドル - uMsg 通知メッセージ - lParam1 パラメータ1 - lParam2 パラメータ2 - 戻り値 - 結果 +/* CPlApplet + Control Panel Applet. + Parameters + hwndCPL The parent window handle of Control Panel. + uMsg The notification message. + lParam1 Parameter 1. + lParam2 Parameter 2. + Return Value + The results. */ LONG __declspec(dllexport) CALLBACK CPlApplet(HWND hwndCPL, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { switch (uMsg) { - case CPL_INIT: /* 初期化メッセージ */ + case CPL_INIT: /* Initialization message */ return CplInit(); - case CPL_GETCOUNT: /* ダイアログボックス数取得要求 */ + case CPL_GETCOUNT: /* Request the number of the dialog boxes */ return 1; - case CPL_NEWINQUIRE: /* ダイアログボックス情報取得要求 */ + case CPL_NEWINQUIRE: /* Request the number of dialog boxes infos */ CplNewInquire((LPNEWCPLINFO)lParam2); break; case CPL_SELECT: break; - case CPL_DBLCLK: /* ダブルクリックされた */ - /* ダイアログ表示 */ + case CPL_DBLCLK: /* Double-clicked */ + /* Display the dialog */ DialogBox(hgInstance, MAKEINTRESOURCE(IDD_SETUP), hwndCPL, StatusDlgProc); break; case CPL_STOP: @@ -858,23 +857,23 @@ LONG __declspec(dllexport) CALLBACK CPlApplet(HWND hwndCPL, UINT uMsg, LPARAM lP /* CplInit - コントロールパネルアプレット:初期化 - 引数 - なし - 戻り値 - 結果 + Control Panel Applet:Initialization. + Parameters + None. + Return Value + The results. */ LONG WINAPI CplInit(VOID) { - /* ローカル変数 */ + /* Local variable(s) */ OSVERSIONINFO Ver; Ver.dwOSVersionInfoSize = sizeof(Ver); if (GetVersionEx(&Ver) == FALSE) { return FALSE; } - /* NT以外はロードしない */ + /* Don't load if not NT */ if (Ver.dwPlatformId != VER_PLATFORM_WIN32_NT) { return FALSE; @@ -883,18 +882,18 @@ LONG WINAPI CplInit(VOID) } -/* ダイアログボックス情報取得要求 */ +/* Request the info of dialog box(es) */ /* CplNewInquire - コントロールパネルアプレット:ダイアログボックス情報取得要求 - 引数 - lpNewCPlInfo 情報構造体へのポインタ - 戻り値 - なし + Control Panel Applet: Request the info of dialog box(es). + Parameters + lpNewCPlInfo The pointer to the info structure. + Return Value + None. */ VOID WINAPI CplNewInquire(LPNEWCPLINFO lpNewCPlInfo) { - /* 情報を返す */ + /* Return the info */ ZeroMemory(lpNewCPlInfo, sizeof(*lpNewCPlInfo)); lpNewCPlInfo->dwSize = sizeof(*lpNewCPlInfo); lpNewCPlInfo->hIcon = LoadIcon(hgInstance, MAKEINTRESOURCE(IDI_ICON)); @@ -904,41 +903,41 @@ VOID WINAPI CplNewInquire(LPNEWCPLINFO lpNewCPlInfo) /* SystemShutdown - リブート指示 - 引数 - なし - 戻り値 - 結果 + Reboot Instruction. + Parameters + None. + Return Value + The results. */ BOOL WINAPI SystemShutdown(VOID) { - /* ローカル変数の定義 */ + /* The definition(s) of local variable(s) */ HANDLE hToken; TOKEN_PRIVILEGES tkp; - /* シャットダウン特権を有効にする */ + /* Enable shutdown privilege */ if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) == FALSE) { return FALSE; } - /* LUID取得 */ + /* Get LUID */ LookupPrivilegeValue("", SE_SHUTDOWN_NAME, &tkp.Privileges[0].Luid); tkp.PrivilegeCount = 1; tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - /* シャットダウン特権有効化 */ + /* Enable the shutdown privilege(s) */ AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); - if (GetLastError() != ERROR_SUCCESS) /* 有効化失敗 */ + if (GetLastError() != ERROR_SUCCESS) /* Failed to enable */ { CloseHandle(hToken); return FALSE; } - /* シャットダウン指示 */ + /* Shutdown instruction */ if (ExitWindowsEx(EWX_REBOOT, 0) == FALSE) { CloseHandle(hToken); return FALSE; } - /* シャットダウン特権無効化 */ + /* shutdown privilege(s) */ tkp.Privileges[0].Attributes = 0; AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0); CloseHandle(hToken); @@ -946,27 +945,27 @@ BOOL WINAPI SystemShutdown(VOID) } -/* WmNotify - 通知メッセージ処理 - 引数 - hDlg ダイアログのウィンドウハンドル - idFrom 項目ID - pnmhdr 通知情報 - 戻り値 - 結果 +/* WmNotify + The notification message processing. + Parameters + hDlg The window handle of dialog. + idFrom The item ID. + pnmhdr The notification info. + Return Value + The results. */ DWORD WINAPI WmNotify(HWND hDlg, INT idFrom, NMHDR FAR* pnmhdr) { - if (pnmhdr->code == PSN_APPLY) /* 適用 */ + if (pnmhdr->code == PSN_APPLY) /* Apply */ { - /* 更新 */ + /* Update */ if (SettingUpdate(hDlg) == FALSE) { SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); return TRUE; } - /* リブートが必要ならリブートする */ + /* Reboot if necessary */ Reboot(hDlg); SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_NOERROR); return TRUE; @@ -975,12 +974,12 @@ DWORD WINAPI WmNotify(HWND hDlg, INT idFrom, NMHDR FAR* pnmhdr) } -/* WmDestroy - 破棄メッセージ処理 - 引数 - hDlg ダイアログのウィンドウハンドル - 戻り値 - なし +/* WmDestroy + Destruction Message Processing. + Parameters + hDlg The window handle of dialog. + Return Value + None. */ VOID WINAPI WmDestroy(HWND hDlg) @@ -994,43 +993,43 @@ VOID WINAPI WmDestroy(HWND hDlg) } -/* EramClassInstall - クラスインストーラ - 引数 - diFctn 機能番号 - hDevInfoSet デバイス情報のハンドル - pDevInfoData デバイス情報へのポインタ - 戻り値 - 結果 +/* EramClassInstall + The class installer. + Parameters + diFctn The function number. + hDevInfoSet The handle of the device info. + pDevInfoData The pointer to the device info. + Return Value + The results. */ DWORD EXPORT WINAPI EramClassInstall(DI_FUNCTION diFctn, HDEVINFO hDevInfoSet, PSP_DEVINFO_DATA pDevInfoData) { - /* デフォルト動作させる */ + /* Do default */ return ERROR_DI_DO_DEFAULT; } -/* EnumPropPages32 - プロパティページプロバイダ - 引数 - lplDi デバイス情報へのポインタ - lpfnAddPage ページ追加関数ポインタ - lParam 引数 - 戻り値 - 結果 +/* EnumPropPages32 + Property Page Provider. + Parameters + lplDi The pointer to the device info. + lpfnAddPage The page addition function pointer. + lParam The parameter. + Return Value + The results. */ BOOL EXPORT WINAPI EnumPropPages32(PSP_PROPSHEETPAGE_REQUEST pInfo, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) { - /* ローカル変数 */ + /* Local variable(s) */ PROPSHEETPAGE Setting; HPROPSHEETPAGE hSetting; CHAR szText[64]; if (pInfo->PageRequested == SPPSR_ENUM_ADV_DEVICE_PROPERTIES) { bProp = TRUE; - /* ページを用意 */ + /* Prepare the page */ ZeroMemory(&Setting, sizeof(Setting)); Setting.dwSize = sizeof(Setting); Setting.dwFlags = PSP_USETITLE; @@ -1038,15 +1037,15 @@ BOOL EXPORT WINAPI EnumPropPages32(PSP_PROPSHEETPAGE_REQUEST pInfo, LPFNADDPROPS Setting.pszTemplate = MAKEINTRESOURCE(IDD_SETUP); Setting.pszTitle = GetResStr(IDS_TAB_TITLE, szText, sizeof(szText)); Setting.pfnDlgProc = (DLGPROC)StatusDlgProc; - /* ページを作成 */ + /* Create the page */ hSetting = CreatePropertySheetPage(&Setting); - if (hSetting == NULL) /* 作成失敗 */ + if (hSetting == NULL) /* Failed to create */ { - /* 成功を返す */ + /* Return success */ return TRUE; } - /* ページを追加 */ - if ((*lpfnAddPage)(hSetting, lParam) == FALSE) /* 追加失敗 */ + /* Add the page */ + if ((*lpfnAddPage)(hSetting, lParam) == FALSE) /* Failed to add */ { DestroyPropertySheetPage(hSetting); } @@ -1055,20 +1054,20 @@ BOOL EXPORT WINAPI EnumPropPages32(PSP_PROPSHEETPAGE_REQUEST pInfo, LPFNADDPROPS } -/* EramUninstall - アンインストーラ - 引数 - hWnd 親ウィンドウハンドル - hInstance インスタンスハンドル - lpszCmdLine 引数 - nCmdShow 表示状態 - 戻り値 - なし +/* EramUninstall + Uninstaller + Parameters + hWnd The parent window handle. + hInstance The instance handle. + lpszCmdLine The parameters + nCmdShow The display status. + Return Value + None. */ VOID EXPORT CALLBACK EramUninstall(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLine, INT nCmdShow) { - /* ローカル変数 */ + /* Local variable(s) */ SC_HANDLE hScm, hEram; CHAR szMsg[256], szSysDir[MAX_PATH], szFile[MAX_PATH], szText[128]; DWORD dwError; @@ -1079,21 +1078,21 @@ VOID EXPORT CALLBACK EramUninstall(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmd } Ver.dwOSVersionInfoSize = sizeof(Ver); if ((GetVersionEx(&Ver) == FALSE)|| - (Ver.dwPlatformId != VER_PLATFORM_WIN32_NT)) /* NT以外 */ + (Ver.dwPlatformId != VER_PLATFORM_WIN32_NT)) /* Not NT */ { MessageBox(hWnd, GetResStr(IDS_ERR_DETECT_OS, szText, sizeof(szText)), szWinName, MB_OK); return; } - if (Ver.dwMajorVersion >= 5) /* Windows2000 */ + if (Ver.dwMajorVersion >= 5) /* Windows2000 */ { - /* デバイスマネージャからの削除相当 */ + /* Delete from device manager? */ if (Eram2000UnInstall(hWnd) == FALSE) { MessageBox(hWnd, GetResStr(IDS_PROMPT_BEFORE_DEVMGR, szText, sizeof(szText)), szWinName, MB_OK); return; } } - /* SCM接続 */ + /* Connect SCM */ hScm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hScm == NULL) { @@ -1107,12 +1106,12 @@ VOID EXPORT CALLBACK EramUninstall(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmd MessageBox(hWnd, szMsg, szWinName, MB_OK); return; } - /* ERAMデバイスオープン */ + /* ERAM device open */ hEram = OpenService(hScm, "Eram", SERVICE_CHANGE_CONFIG | DELETE); if (hEram == NULL) { dwError = GetLastError(); - if (dwError != ERROR_SERVICE_DOES_NOT_EXIST) /* アンインストール済み以外 */ + if (dwError != ERROR_SERVICE_DOES_NOT_EXIST) /* Not uninstalled */ { wsprintf(szMsg, GetResStr(IDS_ERR_OPEN_ERAM, szText, sizeof(szText)), dwError); MessageBox(hWnd, szMsg, szWinName, MB_OK); @@ -1122,9 +1121,9 @@ VOID EXPORT CALLBACK EramUninstall(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmd } else { - /* スタートアップで起動してこないよう変更 */ + /* Make it not to be started by startup */ ChangeServiceConfig(hEram, SERVICE_NO_CHANGE, SERVICE_DISABLED, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - /* ERAMデバイス削除 */ + /* Delete the ERAM device */ if (DeleteService(hEram) == FALSE) { wsprintf(szMsg, GetResStr(IDS_ERR_ERAM_REMOVE, szText, sizeof(szText)), GetLastError()); @@ -1141,43 +1140,43 @@ VOID EXPORT CALLBACK EramUninstall(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmd MessageBox(hWnd, szMsg, szWinName, MB_OK); return; } - /* ERAM削除 */ + /* Delete the ERAM */ wsprintf(szFile, "%s\\drivers\\eram.sys", szSysDir); if (MoveFileEx(szFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT) == FALSE) { wsprintf(szMsg, GetResStr(IDS_ERR_REMOVE, szText, sizeof(szText)), szFile, GetLastError()); MessageBox(hWnd, szMsg, szWinName, MB_OK); } - /* コントロールパネル削除 */ + /* Delete Control Panel */ wsprintf(szFile, "%s\\eramnt.cpl", szSysDir); if (MoveFileEx(szFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT) == FALSE) { wsprintf(szMsg, GetResStr(IDS_ERR_REMOVE, szText, sizeof(szText)), szFile, GetLastError()); MessageBox(hWnd, szMsg, szWinName, MB_OK); } - /* アンインストールキー削除 */ + /* Delete the uninstall key */ RegDeleteKey(HKEY_LOCAL_MACHINE, "SoftWare\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Eram"); - /* イベントログ用キー削除 */ + /* Delete the key for event log */ RegDeleteKey(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Services\\EventLog\\System\\Eram"); - /* 再起動が必要なことをセット */ + /* Set to be rebooted */ bReboot = TRUE; - /* リブート指示 */ + /* Reboot instruction */ Reboot(hWnd); } -/* 以降はWindows2000以降専用 */ -/* Eram2000UnInstall - アンインストーラ(Windows2000:デバイスマネージャ) - 引数 - hWnd 親ウィンドウハンドル - 戻り値 - 結果 +/* The followings are for Windows2000 and later only */ +/* Eram2000UnInstall + Uninstaller(Windows2000:Device Manager) + Parameters + hWnd The parent window handle. + Return Value + The results. */ BOOL WINAPI Eram2000UnInstall(HWND hWnd) { - /* ローカル変数 */ + /* Local variable(s) */ static GUID EramClass = { 0xFB6B01E0, 0x3191, 0x11D4, 0x99, 0x10, 0x00, 0x00, 0x4C, 0x67, 0x20, 0x63 }; LPCSTR lpszEramClass; HDEVINFO hDevInfoSet; @@ -1186,9 +1185,9 @@ BOOL WINAPI Eram2000UnInstall(HWND hWnd) HKEY hKey; UINT loopi; BOOL bStat; - /* SETUPAPI.DLLロード */ + /* Load SETUPAPI.DLL */ sSetupApi.hSetupApi = (HMODULE)LoadLibrary("setupapi"); - if (sSetupApi.hSetupApi == NULL) /* SETUPAPI.DLLロード失敗 */ + if (sSetupApi.hSetupApi == NULL) /* Failed to load SETUPAPI.DLL */ { wsprintf(szBuf, GetResStr(IDS_ERR_LOAD_SETUPAPI, szText, sizeof(szText)), GetLastError()); MessageBox(hWnd, szBuf, szWinName, MB_OK); @@ -1209,23 +1208,23 @@ BOOL WINAPI Eram2000UnInstall(HWND hWnd) MessageBox(hWnd, szBuf, szWinName, MB_OK); return FALSE; } - /* ERAMクラスのデバイス列挙を準備 */ + /* Prepare for ERAM class device enumeration */ hDevInfoSet = (*(sSetupApi.lpfnSetupDiGetClassDevs))(&EramClass, NULL, hWnd, 0); - if (hDevInfoSet == INVALID_HANDLE_VALUE) /* ERAMクラス不在 */ + if (hDevInfoSet == INVALID_HANDLE_VALUE) /* Without ERAM classes */ { return TRUE; } bStat = FALSE; __try { - /* ANSI構造体を設定 */ + /* Set the ANSI structure */ DevInfoData.cbSize = sizeof(DevInfoData); for (loopi=0; loopi= 17.%0 +Please specify 17 or more for MAXMEM.%0 . MessageId=0xf Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_MAXMEM_TOO_BIG -Language=Japanese -MAXMEMは4095未満を指定してください.%0 -. Language=English -Need MAXMEM < 4095.%0 +Please specify the smaller value for MAXMEM than 4095.%0 . MessageId=0x10 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_MAXMEM_INVALID -Language=Japanese -起動オプションに MAXMEM=n が無いか、不正な値です.%0 -. Language=English -MAXMEM not available.%0 +The startup option(s) has no MAXMEM=n or invalid MAXMEM value.%0 . MessageId=0x11 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_EXTSTART_TOO_BIG -Language=Japanese -ExtStartは4095MB未満を指定してください.%0 -. Language=English -ExtStart too big.%0 +Please specify the smaller value than 4095MB for ExtStart.%0 . MessageId=0x12 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_WORK_ALLOC_FAILED -Language=Japanese -作業用メモリ確保失敗.%0 -. Language=English -ExAllocatePool(for work) failed.%0 +Failed to allocate the work-area memory.%0 . MessageId=0x13 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_REG_KEY_APPEND_FAILED -Language=Japanese -レジストリキー文字列合成失敗.%0 -. Language=English -RtlAppendUnicodeStringToString failed.%0 +Failed to combine the registry key strings.%0 . MessageId=0x14 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_CREATE_DEVICE_FAILED -Language=Japanese -デバイス作成失敗.%0 -. Language=English -IoCreateDevice failed.%0 +Failed to create a device.%0 . MessageId=0x15 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_DISK_SIZE_TOO_SMALL -Language=Japanese -ディスクへの割り当てメモリが小さすぎます.%0 -. Language=English -Disk size too small.%0 +The assigned disk size is too small.%0 . MessageId=0x16 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_DEVICE_NAME_ALLOC_FAILED -Language=Japanese -デバイス名領域確保失敗.%0 -. Language=English -ExAllocatePool(for device name) failed.%0 +Failed to allocate the device name area.%0 . MessageId=0x17 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_CREATE_SYMBOLIC_LINK_FAILED -Language=Japanese -シンボリックリンク作成失敗.%0 -. Language=English -IoCreateSymbolicLink failed.%0 +Failed to create a symbolic link.%0 . MessageId=0x18 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_DISK_ALLOC_FAILED -Language=Japanese -ディスク用メモリ確保失敗.%0 -. Language=English -ExAllocatePool(for disk space) failed.%0 +Failed to allocate the memory to be used for the disk.%0 . MessageId=0x19 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_DISK_SIZE_IS_0 -Language=Japanese -確保容量が0です.%0 -. Language=English -Disk size 0 error.%0 +The size of the disk cannot be 0.%0 . MessageId=0x1a Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_TRANSLATE_ADDRESS_FAILED -Language=Japanese -OS管理アドレスへの変換に失敗.%0 -. Language=English -HalTranslateBusAddress failed.%0 +Failed to convert to OS Management Address.%0 . MessageId=0x1b Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_PORT_MAPPED -Language=Japanese -I/O空間のマップには対応していません.%0 -. Language=English -I/O map not supported.%0 +No support of I/O space mapping.%0 . MessageId=0x1c Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_CREATE_EXT_FILE -Language=Japanese -外部ファイルの作成に失敗しました.%0 -. Language=English -ZwCreateFile failed.%0 +Failed to create the external file.%0 . MessageId=0x1d Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_SET_INFO_EXT_FILE -Language=Japanese -外部ファイルのサイズ調整に失敗しました.%0 -. Language=English -ZwSetInformationFile failed.%0 +Failed to adjust the size of the external file.%0 . MessageId=0x1e Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_CREATE_EXT_FILE_SECTION -Language=Japanese -外部ファイルのセクション作成に失敗しました.%0 -. Language=English -ZwCreateSection failed.%0 +Failed to create a section of the external file.%0 . MessageId=0x1f Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_MAP_EXT_FILE -Language=Japanese -外部ファイルのマップに失敗しました.%0 -. Language=English -ZwMapViewOfSection failed.%0 +Failed to map the external file.%0 . MessageId=0x20 Severity=Error Facility=System SymbolicName=ERAMNT_ERROR_GET_THREAD_OBJECT -Language=Japanese -システムスレッドのオブジェクト取得に失敗しました.%0 -. Language=English -ObReferenceObjectByHandle failed.%0 +Failed to get the object of the system thread.%0 . @@ -366,11 +269,8 @@ MessageId=0x6 Severity=Warning Facility=System SymbolicName=ERAMNT_WARN_MAXMEM_DISK_SIZE_FIXED -Language=Japanese -OS管理外メモリが少ないのでRAMディスクは縮小されました.%0 -. Language=English -Disk size fixed.%0 +The RAM disk was shrinked because OS Outside Management Memory was smaller than expected.%0 . @@ -378,10 +278,7 @@ MessageId=0x1c Severity=Informational Facility=System SymbolicName=ERAMNT_INF_MEMORY_SIZE -Language=Japanese -%2KB程度確保可能と思われます.%0 -. Language=English -Perhaps you can allocate %2KB.%0 +%2KB is able to be allocated.%0 . diff --git a/eramntum.h b/eramntum.h index 26a8fe3..f4df01b 100644 --- a/eramntum.h +++ b/eramntum.h @@ -1,8 +1,8 @@ // -// ERAMNT用メッセージ定義 +// Message Definitions for ERAMNT // -// ヘッダ -// メッセージ定義 +// Header +// Message Definition // // Values are 32 bit values layed out as follows: // @@ -44,7 +44,7 @@ // // MessageText: // -// 関数%2で失敗が返されました.%0 +// Function %2 returned a failure.%0 // #define ERAMNT_ERROR_FUNCTIONERROR ((NTSTATUS)0xE0FF0001L) @@ -53,7 +53,7 @@ // // MessageText: // -// OS管理外メモリが既に解放されています.%0 +// OS Outside Management Memory is already released.%0 // #define ERAMNT_ERROR_MAXMEM_ALREADY_FREE ((NTSTATUS)0xE0FF0002L) @@ -62,7 +62,7 @@ // // MessageText: // -// OS管理外メモリのマップ失敗.%0 +// Failed to map OS Outside Management Memory.%0 // #define ERAMNT_ERROR_MAXMEM_MAP_FAILED ((NTSTATUS)0xE0FF0003L) @@ -71,7 +71,7 @@ // // MessageText: // -// OS管理外メモリの使用通知失敗.%0 +// Failed to notify usage of OS Outside Management Memory.%0 // #define ERAMNT_ERROR_MAXMEM_REPORT_USAGE_FAILED ((NTSTATUS)0xE0FF0004L) @@ -80,7 +80,7 @@ // // MessageText: // -// OS管理外メモリの一部は、他のデバイスにより使用されています.ディスクサイズを小さくしてみてください.%0 +// OS Outside Management Memory is being partially used by another device. Please shrink the disk size.%0 // #define ERAMNT_ERROR_MAXMEM_REPORT_USAGE_CONFLICT ((NTSTATUS)0xE0FF0005L) @@ -89,7 +89,7 @@ // // MessageText: // -// システムスレッドの作成に失敗しました.%0 +// Failed to create a system thread.%0 // #define ERAMNT_ERROR_CREATE_THREAD ((NTSTATUS)0xE0FF0006L) @@ -98,7 +98,7 @@ // // MessageText: // -// OS管理外メモリは検出されませんでした.%0 +// OS Outside Management Memory was not detected.%0 // #define ERAMNT_ERROR_MAXMEM_NO_MEMORY ((NTSTATUS)0xE0FF0007L) @@ -107,7 +107,7 @@ // // MessageText: // -// OS管理外メモリが見つかりません.%0 +// OS Outside Management Memory was not found.%0 // #define ERAMNT_ERROR_MAXMEM_NOT_DETECTED ((NTSTATUS)0xE0FF0008L) @@ -116,7 +116,7 @@ // // MessageText: // -// OS起動オプション用メモリ確保失敗.%0 +// Failed to allocate the OS startup option(s).%0 // #define ERAMNT_ERROR_OPTION_WORK_ALLOC_FAILED ((NTSTATUS)0xE0FF0009L) @@ -125,7 +125,7 @@ // // MessageText: // -// OS起動オプション取得失敗.%0 +// Failed to get the OS startup option(s).%0 // #define ERAMNT_ERROR_OPTION_GET_FAILED ((NTSTATUS)0xE0FF000AL) @@ -134,7 +134,7 @@ // // MessageText: // -// 起動オプションに%bMAXMEM=n%bがありません.%0 +// There was no %bMAXMEM=n%b in starup options.%0 // #define ERAMNT_ERROR_MAXMEM_NO_OPTION ((NTSTATUS)0xE0FF000BL) @@ -143,7 +143,7 @@ // // MessageText: // -// 起動オプション大文字化失敗.%0 +// Failed to capitalize the startup option(s).%0 // #define ERAMNT_ERROR_MAXMEM_CAPITAL_FAILED ((NTSTATUS)0xE0FF000CL) @@ -152,7 +152,7 @@ // // MessageText: // -// MAXMEM数値化失敗.%0 +// Failed to numerize MAXMEM.%0 // #define ERAMNT_ERROR_MAXMEM_ATOU ((NTSTATUS)0xE0FF000DL) @@ -161,7 +161,7 @@ // // MessageText: // -// MAXMEMは17以上を指定してください.%0 +// Please specify 17 or more for MAXMEM.%0 // #define ERAMNT_ERROR_MAXMEM_TOO_SMALL ((NTSTATUS)0xE0FF000EL) @@ -170,7 +170,7 @@ // // MessageText: // -// MAXMEMは4095未満を指定してください.%0 +// Please specify the smaller value for MAXMEM than 4095.%0 // #define ERAMNT_ERROR_MAXMEM_TOO_BIG ((NTSTATUS)0xE0FF000FL) @@ -179,7 +179,7 @@ // // MessageText: // -// 起動オプションに MAXMEM=n が無いか、不正な値です.%0 +// The startup option(s) has no MAXMEM=n or invalid MAXMEM value.%0 // #define ERAMNT_ERROR_MAXMEM_INVALID ((NTSTATUS)0xE0FF0010L) @@ -188,7 +188,7 @@ // // MessageText: // -// ExtStartは4095MB未満を指定してください.%0 +// Please specify the smaller value than 4095MB for ExtStart.%0 // #define ERAMNT_ERROR_EXTSTART_TOO_BIG ((NTSTATUS)0xE0FF0011L) @@ -197,7 +197,7 @@ // // MessageText: // -// 作業用メモリ確保失敗.%0 +// Failed to allocate the workarea memory.%0 // #define ERAMNT_ERROR_WORK_ALLOC_FAILED ((NTSTATUS)0xE0FF0012L) @@ -206,7 +206,7 @@ // // MessageText: // -// レジストリキー文字列合成失敗.%0 +// Failed to combine the registry key strings.%0 // #define ERAMNT_ERROR_REG_KEY_APPEND_FAILED ((NTSTATUS)0xE0FF0013L) @@ -215,7 +215,7 @@ // // MessageText: // -// デバイス作成失敗.%0 +// Failed to create an device.%0 // #define ERAMNT_ERROR_CREATE_DEVICE_FAILED ((NTSTATUS)0xE0FF0014L) @@ -224,7 +224,7 @@ // // MessageText: // -// ディスクへの割り当てメモリが小さすぎます.%0 +// Too small allocation memory for disk.%0 // #define ERAMNT_ERROR_DISK_SIZE_TOO_SMALL ((NTSTATUS)0xE0FF0015L) @@ -233,7 +233,7 @@ // // MessageText: // -// デバイス名領域確保失敗.%0 +// Failed to allocate the device name area.%0 // #define ERAMNT_ERROR_DEVICE_NAME_ALLOC_FAILED ((NTSTATUS)0xE0FF0016L) @@ -242,7 +242,7 @@ // // MessageText: // -// シンボリックリンク作成失敗.%0 +// Failed to create a symbolic link.%0 // #define ERAMNT_ERROR_CREATE_SYMBOLIC_LINK_FAILED ((NTSTATUS)0xE0FF0017L) @@ -251,7 +251,7 @@ // // MessageText: // -// ディスク用メモリ確保失敗.%0 +// Failed to allocate the memory for disk.%0 // #define ERAMNT_ERROR_DISK_ALLOC_FAILED ((NTSTATUS)0xE0FF0018L) @@ -260,7 +260,7 @@ // // MessageText: // -// 確保容量が0です.%0 +// The allocated size was zero.%0 // #define ERAMNT_ERROR_DISK_SIZE_IS_0 ((NTSTATUS)0xE0FF0019L) @@ -269,7 +269,7 @@ // // MessageText: // -// OS管理アドレスへの変換に失敗.%0 +// Failed to convert to OS Management Address.%0 // #define ERAMNT_ERROR_TRANSLATE_ADDRESS_FAILED ((NTSTATUS)0xE0FF001AL) @@ -278,7 +278,7 @@ // // MessageText: // -// I/O空間のマップには対応していません.%0 +// No support of I/O space mapping.%0 // #define ERAMNT_ERROR_PORT_MAPPED ((NTSTATUS)0xE0FF001BL) @@ -287,7 +287,7 @@ // // MessageText: // -// 外部ファイルの作成に失敗しました.%0 +// Failed to create the external file.%0 // #define ERAMNT_ERROR_CREATE_EXT_FILE ((NTSTATUS)0xE0FF001CL) @@ -296,7 +296,7 @@ // // MessageText: // -// 外部ファイルのサイズ調整に失敗しました.%0 +// Failed to adjust the size of the external file.%0 // #define ERAMNT_ERROR_SET_INFO_EXT_FILE ((NTSTATUS)0xE0FF001DL) @@ -305,7 +305,7 @@ // // MessageText: // -// 外部ファイルのセクション作成に失敗しました.%0 +// Failed to create section of the external file.%0 // #define ERAMNT_ERROR_CREATE_EXT_FILE_SECTION ((NTSTATUS)0xE0FF001EL) @@ -314,7 +314,7 @@ // // MessageText: // -// 外部ファイルのマップに失敗しました.%0 +// Failed to map the external file.%0 // #define ERAMNT_ERROR_MAP_EXT_FILE ((NTSTATUS)0xE0FF001FL) @@ -323,7 +323,7 @@ // // MessageText: // -// システムスレッドのオブジェクト取得に失敗しました.%0 +// Failed to get the object of the system thread.%0 // #define ERAMNT_ERROR_GET_THREAD_OBJECT ((NTSTATUS)0xE0FF0020L) @@ -332,7 +332,7 @@ // // MessageText: // -// OS管理外メモリが少ないのでRAMディスクは縮小されました.%0 +// The RAM disk was shrinked because OS Outside Management Memory was small .%0 // #define ERAMNT_WARN_MAXMEM_DISK_SIZE_FIXED ((NTSTATUS)0xA0FF0006L) @@ -341,7 +341,7 @@ // // MessageText: // -// %2KB程度確保可能と思われます.%0 +// It seems like it is able to allocate about %2KB.%0 // #define ERAMNT_INF_MEMORY_SIZE ((NTSTATUS)0x60FF001CL)