/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/r3113/plugins/CDVDiso/src/Windows/Config.cpp
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/r3113/plugins/CDVDiso/src/Windows/Config.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 59 - (show annotations) (download)
Tue Sep 7 06:17:51 2010 UTC (10 years, 8 months ago) by william
File size: 1228 byte(s)
create working branch for pcsx2-0.9.7-r3113-debug
1 #include <stdio.h>
2 #include <windows.h>
3
4 #include "../CDVDiso.h"
5
6 #define GetKeyV(name, var, s, t) \
7 size = s; type = t; \
8 RegQueryValueEx(myKey, name, 0, &type, (LPBYTE) var, &size);
9
10 #define GetKeyVdw(name, var) \
11 GetKeyV(name, var, 4, REG_DWORD);
12
13 #define SetKeyV(name, var, s, t) \
14 RegSetValueEx(myKey, name, 0, t, (LPBYTE) var, s);
15
16 #define SetKeyVdw(name, var) \
17 SetKeyV(name, var, 4, REG_DWORD);
18
19 void SaveConf()
20 {
21 HKEY myKey;
22 DWORD myDisp;
23
24 RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\PS2Eplugin\\CDVD\\CDVDiso", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &myKey, &myDisp);
25
26 SetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY);
27 SetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY);
28 SetKeyVdw("BlockDump", &BlockDump);
29
30 RegCloseKey(myKey);
31 }
32
33 void LoadConf()
34 {
35 HKEY myKey;
36 DWORD type, size;
37
38 memset(IsoFile, 0, sizeof(IsoFile));
39
40 if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\PS2Eplugin\\CDVD\\CDVDiso", 0, KEY_ALL_ACCESS, &myKey) != ERROR_SUCCESS)
41 {
42 SaveConf();
43 return;
44 }
45
46 GetKeyV("IsoFile", IsoFile, sizeof(IsoFile), REG_BINARY);
47 GetKeyV("CurrentWorkingFolder", IsoCWD, sizeof(IsoCWD), REG_BINARY);
48 GetKeyVdw("BlockDump", &BlockDump);
49
50 RegCloseKey(myKey);
51 }

  ViewVC Help
Powered by ViewVC 1.1.22