Explorar el Código

--- Merging r23202 into '.':
U packages/fcl-registry/src/regdef.inc
U packages/fcl-registry/src/registry.pp
--- Merging r23219 into '.':
G packages/fcl-registry/src/regdef.inc
G packages/fcl-registry/src/registry.pp

# revisions: 23202,23219
r23202 | yury | 2012-12-21 15:53:44 +0100 (Fri, 21 Dec 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-registry/src/regdef.inc
M /trunk/packages/fcl-registry/src/registry.pp

* Include regdef.inc only if XMLREG is defined (non-Windows platforms). On Windows it is not needed since the Windows unit is included and it has all necessary declarations. Keeping duplicate declarations in regdef.inc on Windows is dangerous since it leads to out of sync problems.
* Cleanup regdef.inc to contain only necessary types and constants to work with registry unit on non-Windows platforms.
r23219 | yury | 2012-12-24 15:07:01 +0100 (Mon, 24 Dec 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-registry/src/regdef.inc
M /trunk/packages/fcl-registry/src/registry.pp

* For compatibility with existing cross-platform registry code, add registry constants to Registry unit on Windows. The constants are directly mapped to Windows unit to avoid problems.

git-svn-id: branches/fixes_2_6@23343 -

marco hace 12 años
padre
commit
67d7a95c5e
Se han modificado 2 ficheros con 27 adiciones y 43 borrados
  1. 26 41
      packages/fcl-registry/src/regdef.inc
  2. 1 2
      packages/fcl-registry/src/registry.pp

+ 26 - 41
packages/fcl-registry/src/regdef.inc

@@ -1,27 +1,32 @@
 Type
-  LPDWORD = ^DWord;
-  LPVOID  = Pointer;
-  WINBOOL = LongBool;
-  LPCSTR  = PChar;
-  LPSTR   = Pchar;
-  LONG    = LongInt;
-  LPBYTE  = ^Byte;
-
-  ACCESS_MASK = DWORD;
-       REGSAM = ACCESS_MASK;
-
-  SECURITY_ATTRIBUTES = record
-    nLength : DWORD;
-    lpSecurityDescriptor : LPVOID;
-    bInheritHandle : WINBOOL;
-  end;
-  LPSECURITY_ATTRIBUTES = ^SECURITY_ATTRIBUTES;
-
-
   HKEY = THandle;
   PHKEY = ^HKEY;
+  
+{$ifdef windows}
 
+{ Direct mapping to constants in Windows unit }
 
+Const
+  HKEY_CLASSES_ROOT     = Windows.HKEY_CLASSES_ROOT;
+  HKEY_CURRENT_USER     = Windows.HKEY_CURRENT_USER;
+  HKEY_LOCAL_MACHINE    = Windows.HKEY_LOCAL_MACHINE;
+  HKEY_USERS            = Windows.HKEY_USERS;
+  HKEY_PERFORMANCE_DATA = Windows.HKEY_PERFORMANCE_DATA;
+  HKEY_CURRENT_CONFIG   = Windows.HKEY_CURRENT_CONFIG;
+  HKEY_DYN_DATA         = Windows.HKEY_DYN_DATA;
+
+  KEY_ALL_ACCESS         = Windows.KEY_ALL_ACCESS;
+  KEY_CREATE_LINK        = Windows.KEY_CREATE_LINK;
+  KEY_CREATE_SUB_KEY     = Windows.KEY_CREATE_SUB_KEY;
+  KEY_ENUMERATE_SUB_KEYS = Windows.KEY_ENUMERATE_SUB_KEYS;
+  KEY_EXECUTE            = Windows.KEY_EXECUTE;
+  KEY_NOTIFY             = Windows.KEY_NOTIFY;
+  KEY_QUERY_VALUE        = Windows.KEY_QUERY_VALUE;
+  KEY_READ               = Windows.KEY_READ;
+  KEY_SET_VALUE          = Windows.KEY_SET_VALUE;
+  KEY_WRITE              = Windows.KEY_WRITE;
+
+{$else}
 
 Const
   HKEY_CLASSES_ROOT     = HKEY($80000000);
@@ -42,25 +47,5 @@ Const
   KEY_READ               = $20019;
   KEY_SET_VALUE          = 2;
   KEY_WRITE              = $20006;
-
-  REG_BINARY                     = 3;
-  REG_DWORD                      = 4;
-  REG_DWORD_LITTLE_ENDIAN        = 4;
-  REG_DWORD_BIG_ENDIAN           = 5;
-  REG_EXPAND_SZ                  = 2;
-  REG_FULL_RESOURCE_DESCRIPTOR   = 9;
-  REG_LINK                       = 6;
-  REG_MULTI_SZ                   = 7;
-  REG_NONE                       = 0;
-  REG_RESOURCE_LIST              = 8;
-  REG_RESOURCE_REQUIREMENTS_LIST = 10;
-  REG_SZ                         = 1;
-
-  REG_OPTION_VOLATILE            = 1;
-  REG_OPTION_NON_VOLATILE        = 0;
-  REG_CREATED_NEW_KEY            = 1;
-  REG_OPENED_EXISTING_KEY        = 2;
-
-  ERROR_SUCCESS = 0;
-
-
+  
+{$endif windows}

+ 1 - 2
packages/fcl-registry/src/registry.pp

@@ -17,8 +17,7 @@ Uses
     SysUtils,
     inifiles;
 
-  {$I regdef.inc}
-
+{$I regdef.inc}
 
 type
   ERegistryException = class(Exception);