| 2701 | } |
| 2702 | |
| 2703 | BOOL |
| 2704 | Ext2SetGlobalProperty ( |
| 2705 | ULONG ulStartup, |
| 2706 | BOOLEAN bReadonly, |
| 2707 | BOOLEAN bExt3Writable, |
| 2708 | CHAR * Codepage, |
| 2709 | CHAR * sPrefix, |
| 2710 | CHAR * sSuffix, |
| 2711 | BOOL bAutoMount |
| 2712 | ) |
| 2713 | { |
| 2714 | EXT2_VOLUME_PROPERTY3 EVP; |
| 2715 | |
| 2716 | NT::NTSTATUS status; |
| 2717 | HANDLE Handle = NULL; |
| 2718 | int rc = TRUE; |
| 2719 | HKEY hKey; |
| 2720 | CHAR keyPath[MAX_PATH] ; |
| 2721 | |
| 2722 | ULONG data = 0; |
| 2723 | |
| 2724 | memset(&EVP, 0, sizeof(EXT2_VOLUME_PROPERTY3)); |
| 2725 | EVP.Magic = EXT2_VOLUME_PROPERTY_MAGIC; |
| 2726 | EVP.Command = APP_CMD_SET_PROPERTY3; |
| 2727 | EVP.Flags |= EXT2_FLAG_VP_SET_GLOBAL; |
| 2728 | EVP.bReadonly = bReadonly; |
| 2729 | EVP.bExt3Writable = bExt3Writable; |
| 2730 | strcpy((CHAR *)EVP.Codepage, Codepage); |
| 2731 | |
| 2732 | if (strlen(sPrefix)) { |
| 2733 | strcpy(EVP.sHidingPrefix, sPrefix); |
| 2734 | EVP.bHidingPrefix = TRUE; |
| 2735 | } |
| 2736 | |
| 2737 | if (strlen(sSuffix)) { |
| 2738 | strcpy(EVP.sHidingSuffix, sSuffix); |
| 2739 | EVP.bHidingSuffix = TRUE; |
| 2740 | } |
| 2741 | |
| 2742 | strcpy (keyPath, "SYSTEM\\CurrentControlSet\\Services\\Ext2Fsd") ; |
| 2743 | status = ::RegOpenKeyEx (HKEY_LOCAL_MACHINE, |
| 2744 | keyPath, |
| 2745 | 0, |
| 2746 | KEY_ALL_ACCESS, |
| 2747 | &hKey) ; |
| 2748 | if (status != ERROR_SUCCESS) { |
| 2749 | rc = FALSE; |
| 2750 | goto errorout; |
| 2751 | } |
| 2752 | |
| 2753 | /* set Start type */ |
| 2754 | status = RegSetValueEx( hKey, |
| 2755 | "Start", |
| 2756 | 0, |
| 2757 | REG_DWORD, |
| 2758 | (BYTE *)&ulStartup, |
| 2759 | sizeof(DWORD)); |
| 2760 | RegCloseKey(hKey); |
no test coverage detected