Преглед изворни кода

* 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.

git-svn-id: trunk@23202 -

yury пре 12 година
родитељ
комит
5556fecdf0
2 измењених фајлова са 3 додато и 45 уклоњено
  1. 1 44
      packages/fcl-registry/src/regdef.inc
  2. 2 1
      packages/fcl-registry/src/registry.pp

+ 1 - 44
packages/fcl-registry/src/regdef.inc

@@ -1,28 +1,7 @@
 Type
 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;
   HKEY = THandle;
   PHKEY = ^HKEY;
   PHKEY = ^HKEY;
-
-
-
+  
 Const
 Const
   HKEY_CLASSES_ROOT     = HKEY($80000000);
   HKEY_CLASSES_ROOT     = HKEY($80000000);
   HKEY_CURRENT_USER     = HKEY($80000001);
   HKEY_CURRENT_USER     = HKEY($80000001);
@@ -42,25 +21,3 @@ Const
   KEY_READ               = $20019;
   KEY_READ               = $20019;
   KEY_SET_VALUE          = 2;
   KEY_SET_VALUE          = 2;
   KEY_WRITE              = $20006;
   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;
-
-

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

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