diff --git a/Packages/DXE2/X2Utils.dpk b/Packages/DXE2/X2Utils.dpk
new file mode 100644
index 0000000..59674f0
--- /dev/null
+++ b/Packages/DXE2/X2Utils.dpk
@@ -0,0 +1,63 @@
+package X2Utils;
+
+{$R *.res}
+{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
+{$ALIGN 8}
+{$ASSERTIONS ON}
+{$BOOLEVAL OFF}
+{$DEBUGINFO ON}
+{$EXTENDEDSYNTAX ON}
+{$IMPORTEDDATA ON}
+{$IOCHECKS ON}
+{$LOCALSYMBOLS ON}
+{$LONGSTRINGS ON}
+{$OPENSTRINGS ON}
+{$OPTIMIZATION ON}
+{$OVERFLOWCHECKS OFF}
+{$RANGECHECKS OFF}
+{$REFERENCEINFO ON}
+{$SAFEDIVIDE OFF}
+{$STACKFRAMES ON}
+{$TYPEDADDRESS OFF}
+{$VARSTRINGCHECKS ON}
+{$WRITEABLECONST ON}
+{$MINENUMSIZE 1}
+{$IMAGEBASE $400000}
+{$ENDIF IMPLICITBUILDING}
+{$DESCRIPTION 'X2Utils'}
+{$LIBSUFFIX 'XE2'}
+{$RUNONLY}
+{$IMPLICITBUILD ON}
+
+requires
+ rtl,
+ vcl,
+ xmlrtl;
+
+contains
+ X2UtApp in '..\..\X2UtApp.pas',
+ X2UtBits in '..\..\X2UtBits.pas',
+ X2UtGraphics in '..\..\X2UtGraphics.pas',
+ X2UtHandCursor in '..\..\X2UtHandCursor.pas',
+ X2UtHashes in '..\..\X2UtHashes.pas',
+ X2UtHashesVariants in '..\..\X2UtHashesVariants.pas',
+ X2UtMisc in '..\..\X2UtMisc.pas',
+ X2UtOS in '..\..\X2UtOS.pas',
+ X2UtStrings in '..\..\X2UtStrings.pas',
+ X2UtImageInfo in '..\..\X2UtImageInfo.pas',
+ X2UtTempFile in '..\..\X2UtTempFile.pas',
+ X2UtIniParser in '..\..\X2UtIniParser.pas',
+ X2UtProcess in '..\..\X2UtProcess.pas',
+ X2UtSingleInstance in '..\..\X2UtSingleInstance.pas',
+ X2UtStreams in '..\..\X2UtStreams.pas',
+ X2UtNamedFormat in '..\..\X2UtNamedFormat.pas',
+ X2UtPersist in '..\..\X2UtPersist.pas',
+ X2UtPersistForm in '..\..\X2UtPersistForm.pas',
+ X2UtPersistIntf in '..\..\X2UtPersistIntf.pas',
+ X2UtPersistRegistry in '..\..\X2UtPersistRegistry.pas',
+ X2UtElevation in '..\..\X2UtElevation.pas',
+ X2UtPersistXML in '..\..\X2UtPersistXML.pas',
+ X2UtPersistXMLBinding in '..\..\X2UtPersistXMLBinding.pas',
+ XMLDataBindingUtils in '..\..\XMLDataBinding\XMLDataBindingUtils.pas';
+
+end.
diff --git a/Packages/DXE2/X2Utils.dproj b/Packages/DXE2/X2Utils.dproj
new file mode 100644
index 0000000..11cd811
--- /dev/null
+++ b/Packages/DXE2/X2Utils.dproj
@@ -0,0 +1,189 @@
+
+
+ {3cd28184-f9a5-4320-9ad8-80ef25ba762e}
+ X2Utils.dpk
+ Debug
+ DCC32
+ P:\algemeen\bin\D2007\X2Utils2007.bpl
+ VCL
+ 13.4
+ True
+ Debug
+ Win32
+ 1
+ Package
+
+
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Base
+ true
+
+
+ true
+ Cfg_2
+ true
+ true
+
+
+ true
+ true
+ 00400000
+ true
+ X2Utils
+ Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)
+ true
+ 1043
+ true
+ CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
+ 2007
+ true
+
+
+ X2Utils_Icon.ico
+
+
+ X2Utils_Icon.ico
+ Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
+ true
+ 1033
+ CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=
+
+
+ 7.0
+ False
+ True
+ False
+ True
+ 0
+ RELEASE;$(DCC_Define)
+
+
+ 7.0
+ True
+ True
+ $(DELPHILIB)
+ $(DELPHILIB)
+ $(DELPHILIB)
+ $(DELPHIBIN)
+ $(DELPHIBIN)
+
+
+ XE2
+ 1033
+
+
+ Delphi.Personality.12
+ Package
+
+
+
+ False
+ True
+ False
+
+
+ True
+ False
+ 1
+ 0
+ 0
+ 0
+ False
+ False
+ False
+ False
+ False
+ 1043
+ 1252
+
+
+
+
+ 1.0.0.0
+
+
+
+
+
+ 1.0.0.0
+
+
+
+
+ Microsoft Office 2000 Sample Automation Server Wrapper Components
+ Microsoft Office XP Sample Automation Server Wrapper Components
+
+
+
+ False
+ True
+
+
+ 12
+
+
+
+
+ MainSource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cfg_2
+ Base
+
+
+ Base
+
+
+ Cfg_1
+ Base
+
+
+
+
diff --git a/Packages/DXE2/X2Utils.res b/Packages/DXE2/X2Utils.res
new file mode 100644
index 0000000..8cbdc5a
Binary files /dev/null and b/Packages/DXE2/X2Utils.res differ
diff --git a/Packages/DXE2/X2Utils_Icon.ico b/Packages/DXE2/X2Utils_Icon.ico
new file mode 100644
index 0000000..7ade9bf
Binary files /dev/null and b/Packages/DXE2/X2Utils_Icon.ico differ
diff --git a/Test/X2UtHashesTest.dpr b/Test/X2UtHashesTest.dpr
index fe780f9..51bf3c3 100644
--- a/Test/X2UtHashesTest.dpr
+++ b/Test/X2UtHashesTest.dpr
@@ -3,6 +3,9 @@ program X2UtHashesTest;
{$APPTYPE CONSOLE}
uses
+ madListHardware,
+ madListProcesses,
+ madListModules,
madExcept,
madLinkDisAsm,
SysUtils,
diff --git a/Test/X2UtHashesTest.dproj b/Test/X2UtHashesTest.dproj
new file mode 100644
index 0000000..57480bd
--- /dev/null
+++ b/Test/X2UtHashesTest.dproj
@@ -0,0 +1,80 @@
+
+
+ {f8e0020e-c40f-4444-ac12-fa457cf72877}
+ X2UtHashesTest.dpr
+ Debug
+ AnyCPU
+ DCC32
+ X2UtHashesTest.exe
+
+
+ 7.0
+ False
+ True
+ False
+ True
+ 0
+ 3
+ madExcept;RELEASE
+ IconXP
+
+
+ 7.0
+ True
+ True
+ 3
+ madExcept;DEBUG
+ IconXP
+
+
+ Delphi.Personality
+ VCLApplication
+
+
+ False
+ True
+ False
+
+
+ False
+ False
+ 1
+ 0
+ 0
+ 0
+ False
+ False
+ False
+ False
+ False
+ 1043
+ 1252
+
+
+
+
+ 1.0.0.0
+
+
+
+
+
+ 1.0.0.0
+
+
+
+ X2UtHashesTest.dpr
+
+
+
+
+
+
+ MainSource
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/UnitTests/Units/HashesTest.pas b/UnitTests/Units/HashesTest.pas
index eb5bbbd..28af7c1 100644
--- a/UnitTests/Units/HashesTest.pas
+++ b/UnitTests/Units/HashesTest.pas
@@ -39,6 +39,7 @@ type
procedure testGet; override;
procedure testDelete; override;
procedure testIterate; override;
+ procedure testIterateEmpty;
procedure testEnumerator; override;
end;
@@ -203,6 +204,13 @@ begin
end;
+procedure THashesSITest.testIterateEmpty;
+begin
+ Hash.First;
+ CheckFalse(Hash.Next, 'Next');
+end;
+
+
function THashesSITest.GetHash: TX2SIHash;
begin
Result := TX2SIHash(FHash);
diff --git a/X2UtApp.pas b/X2UtApp.pas
index 5406bcf..812167c 100644
--- a/X2UtApp.pas
+++ b/X2UtApp.pas
@@ -359,8 +359,8 @@ begin
GetPropList(Strings.ClassInfo, tkStrings, pProps);
for iProp := 0 to iCount - 1 do begin
- if VerQueryValue(pBuffer, PChar(cName + '\' + pProps^[iProp]^.Name),
- Pointer(pValue), dVer) then
+ if VerQueryValueA(pBuffer, PAnsiChar(cName + AnsiString('\') + pProps^[iProp]^.Name),
+ Pointer(pValue), dVer) then
SetStrProp(Strings, pProps[iProp], pValue);
end;
finally
diff --git a/X2UtElevation.pas b/X2UtElevation.pas
index 821d00c..d749888 100644
--- a/X2UtElevation.pas
+++ b/X2UtElevation.pas
@@ -259,9 +259,9 @@ begin
RaiseLastOSError;
try
- if RegOpenKeyExA(HKEY_CLASSES_ROOT, PChar(AKey), 0, KEY_READ or KEY_WRITE, keyHandle) = ERROR_SUCCESS then
+ if RegOpenKeyEx(HKEY_CLASSES_ROOT, PChar(AKey), 0, KEY_READ or KEY_WRITE, keyHandle) = ERROR_SUCCESS then
try
- if RegSetValueExA(keyHandle, PChar('AccessPermission'), 0, REG_BINARY, descriptor, size) <> ERROR_SUCCESS then
+ if RegSetValueEx(keyHandle, PChar('AccessPermission'), 0, REG_BINARY, descriptor, size) <> ERROR_SUCCESS then
RaiseLastOSError;
finally
RegCloseKey(keyHandle);
@@ -336,7 +336,11 @@ begin
end;
except
on E: Exception do
+ {$IFDEF VER230}
+ raise EOleRegistrationError.Create(E.Message, 0, 0);
+ {$ELSE}
raise EOleRegistrationError.Create(E.Message);
+ {$ENDIF}
end;
end;
diff --git a/X2UtPersist.pas b/X2UtPersist.pas
index 0afaa57..d34b8fb 100644
--- a/X2UtPersist.pas
+++ b/X2UtPersist.pas
@@ -365,7 +365,8 @@ begin
tkString,
tkLString,
- tkWString:
+ tkWString,
+ tkUString:
if ReadString(APropInfo^.Name, stringValue) then
SetStrProp(AObject, APropInfo, stringValue);
diff --git a/X2UtProcess.pas b/X2UtProcess.pas
index 7dd816d..ba375c4 100644
--- a/X2UtProcess.pas
+++ b/X2UtProcess.pas
@@ -102,10 +102,10 @@ const
var
buffer: PChar;
processInfo: TProcessInformation;
- readPipe: Cardinal;
+ readPipe: THandle;
securityAttr: TSecurityAttributes;
startupInfo: TStartupInfo;
- writePipe: Cardinal;
+ writePipe: THandle;
bytesRead: Cardinal;
newConsole: Boolean;
consoleOutput: THandle;