MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2StorePropertyinRegistry

Function Ext2StorePropertyinRegistry

Ext2Mgr/enumDisk.cpp:2275–2388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2273}
2274
2275VOID
2276Ext2StorePropertyinRegistry(PEXT2_VOLUME_PROPERTY3 EVP)
2277{
2278 CHAR UUID[50], ID[16];
2279 HKEY hKey;
2280 CHAR keyPath[MAX_PATH];
2281 LONG status;
2282 CString data = "";
2283
2284 int i;
2285 int len = 0;
2286
2287 memset(UUID, 0, 50);
2288 for (i=0; i < 16; i++) {
2289 if (i == 0) {
2290 sprintf(&UUID[len], "{%2.2X", EVP->UUID[i]);
2291 len += 3;
2292 } else if (i == 15) {
2293 sprintf(&UUID[len], "-%2.2X}", EVP->UUID[i]);
2294 len +=4;
2295 } else {
2296 sprintf(&UUID[len], "-%2.2X", EVP->UUID[i]);
2297 len += 3;
2298 }
2299 }
2300
2301 /* Create or open ext2fsd volumes key */
2302 strcpy (keyPath, "SYSTEM\\CurrentControlSet\\Services\\Ext2Fsd\\Volumes") ;
2303 status = ::RegCreateKeyEx (HKEY_LOCAL_MACHINE,
2304 keyPath,
2305 0,
2306 0,
2307 REG_OPTION_NON_VOLATILE,
2308 KEY_ALL_ACCESS,
2309 NULL,
2310 &hKey,
2311 NULL);
2312 if (status != ERROR_SUCCESS) {
2313 return;
2314 }
2315
2316#define READING_ONLY "Readonly"
2317#define WRITING_SUPPORT "WritingSupport"
2318#define EXT3_FORCEWRITING "Ext3ForceWriting"
2319#define CODEPAGE_NAME "CodePage"
2320#define HIDING_PREFIX "HidingPrefix"
2321#define HIDING_SUFFIX "HidingSuffix"
2322#define MOUNT_POINT "MountPoint"
2323#define UID "uid"
2324#define GID "gid"
2325#define EUID "euid"
2326#define EGID "egid"
2327
2328
2329 if (EVP->bReadonly) {
2330 data += READING_ONLY";";
2331 } else if (EVP->bExt3 && EVP->bExt3Writable) {
2332 data += EXT3_FORCEWRITING";";

Callers 3

AddMountPointMethod · 0.85
OnOKMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected