|
@@ -31,7 +31,7 @@ end;
|
|
function TRegistry.sysCreateKey(const Key: String): Boolean;
|
|
function TRegistry.sysCreateKey(const Key: String): Boolean;
|
|
Var
|
|
Var
|
|
P: PChar;
|
|
P: PChar;
|
|
- Disposition: Integer;
|
|
|
|
|
|
+ Disposition: Dword;
|
|
Handle: HKEY;
|
|
Handle: HKEY;
|
|
SecurityAttributes: Pointer; //LPSECURITY_ATTRIBUTES;
|
|
SecurityAttributes: Pointer; //LPSECURITY_ATTRIBUTES;
|
|
|
|
|
|
@@ -70,13 +70,13 @@ function TRegistry.SysGetData(const Name: String; Buffer: Pointer;
|
|
Var
|
|
Var
|
|
P: PChar;
|
|
P: PChar;
|
|
RD : DWord;
|
|
RD : DWord;
|
|
-
|
|
|
|
|
|
+
|
|
begin
|
|
begin
|
|
P := @Name[1];
|
|
P := @Name[1];
|
|
If RegQueryValueEx(fCurrentKey,P,Nil,
|
|
If RegQueryValueEx(fCurrentKey,P,Nil,
|
|
@RD,Buffer,@BufSize)<>ERROR_SUCCESS Then
|
|
@RD,Buffer,@BufSize)<>ERROR_SUCCESS Then
|
|
Result:=-1
|
|
Result:=-1
|
|
- else
|
|
|
|
|
|
+ else
|
|
begin
|
|
begin
|
|
If (RD=REG_SZ) then
|
|
If (RD=REG_SZ) then
|
|
RegData:=rdString
|
|
RegData:=rdString
|
|
@@ -87,7 +87,7 @@ begin
|
|
else if (RD=REG_BINARY) then
|
|
else if (RD=REG_BINARY) then
|
|
RegData:=rdBinary
|
|
RegData:=rdBinary
|
|
else
|
|
else
|
|
- RegData:=rdUnknown;
|
|
|
|
|
|
+ RegData:=rdUnknown;
|
|
Result:=BufSize;
|
|
Result:=BufSize;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -149,19 +149,19 @@ begin
|
|
SecurityAttributes := Nil;
|
|
SecurityAttributes := Nil;
|
|
P:=PrepKey(Key);
|
|
P:=PrepKey(Key);
|
|
If CanCreate then
|
|
If CanCreate then
|
|
- begin
|
|
|
|
|
|
+ begin
|
|
Handle:=0;
|
|
Handle:=0;
|
|
Result:=RegCreateKeyEx(GetBaseKey(RelativeKey(Key)),P,0,'',
|
|
Result:=RegCreateKeyEx(GetBaseKey(RelativeKey(Key)),P,0,'',
|
|
-
|
|
|
|
|
|
+
|
|
REG_OPTION_NON_VOLATILE,
|
|
REG_OPTION_NON_VOLATILE,
|
|
fAccess,SecurityAttributes,Handle,
|
|
fAccess,SecurityAttributes,Handle,
|
|
- @Disposition)=ERROR_SUCCESS
|
|
|
|
-
|
|
|
|
|
|
+ @Disposition)=ERROR_SUCCESS
|
|
|
|
+
|
|
end
|
|
end
|
|
else
|
|
else
|
|
Result:=RegOpenKeyEx(GetBaseKey(RelativeKey(Key)),
|
|
Result:=RegOpenKeyEx(GetBaseKey(RelativeKey(Key)),
|
|
P,0,fAccess,Handle)=ERROR_SUCCESS;
|
|
P,0,fAccess,Handle)=ERROR_SUCCESS;
|
|
- If Result then
|
|
|
|
|
|
+ If Result then
|
|
fCurrentKey:=Handle;
|
|
fCurrentKey:=Handle;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -174,7 +174,7 @@ Var
|
|
begin
|
|
begin
|
|
P:=PrepKey(Key);
|
|
P:=PrepKey(Key);
|
|
Result := RegOpenKeyEx(GetBaseKey(RelativeKey(Key)),P,0,KEY_READ,Handle) = 0;
|
|
Result := RegOpenKeyEx(GetBaseKey(RelativeKey(Key)),P,0,KEY_READ,Handle) = 0;
|
|
- If Result Then
|
|
|
|
|
|
+ If Result Then
|
|
fCurrentKey := Handle;
|
|
fCurrentKey := Handle;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -217,7 +217,7 @@ begin
|
|
If (CurrentKey<>0) then
|
|
If (CurrentKey<>0) then
|
|
begin
|
|
begin
|
|
if LazyWrite then
|
|
if LazyWrite then
|
|
- RegCloseKey(CurrentKey)
|
|
|
|
|
|
+ RegCloseKey(CurrentKey)
|
|
else
|
|
else
|
|
RegFlushKey(CurrentKey);
|
|
RegFlushKey(CurrentKey);
|
|
fCurrentKey:=0;
|
|
fCurrentKey:=0;
|
|
@@ -236,7 +236,7 @@ Var
|
|
I: Integer;
|
|
I: Integer;
|
|
Info: TRegKeyInfo;
|
|
Info: TRegKeyInfo;
|
|
P : PChar;
|
|
P : PChar;
|
|
-
|
|
|
|
|
|
+
|
|
begin
|
|
begin
|
|
Strings.Clear;
|
|
Strings.Clear;
|
|
if GetKeyInfo(Info) then
|
|
if GetKeyInfo(Info) then
|
|
@@ -251,7 +251,7 @@ begin
|
|
Strings.Add(StrPas(P));
|
|
Strings.Add(StrPas(P));
|
|
end;
|
|
end;
|
|
Finally
|
|
Finally
|
|
- FreeMem(P);
|
|
|
|
|
|
+ FreeMem(P);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -263,7 +263,7 @@ Var
|
|
I: Integer;
|
|
I: Integer;
|
|
Info: TRegKeyInfo;
|
|
Info: TRegKeyInfo;
|
|
P : PChar;
|
|
P : PChar;
|
|
-
|
|
|
|
|
|
+
|
|
begin
|
|
begin
|
|
Strings.Clear;
|
|
Strings.Clear;
|
|
if GetKeyInfo(Info) then
|
|
if GetKeyInfo(Info) then
|
|
@@ -278,7 +278,7 @@ begin
|
|
Strings.Add(StrPas(P));
|
|
Strings.Add(StrPas(P));
|
|
end;
|
|
end;
|
|
Finally
|
|
Finally
|
|
- FreeMem(P);
|
|
|
|
|
|
+ FreeMem(P);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -310,9 +310,9 @@ var
|
|
InfoO,InfoN : TRegDataInfo;
|
|
InfoO,InfoN : TRegDataInfo;
|
|
D : TRegDataType;
|
|
D : TRegDataType;
|
|
P: PChar;
|
|
P: PChar;
|
|
-
|
|
|
|
|
|
+
|
|
begin
|
|
begin
|
|
- If GetDataInfo(OldName,InfoO) and Not GetDataInfo(NewName,InfoN) then
|
|
|
|
|
|
+ If GetDataInfo(OldName,InfoO) and Not GetDataInfo(NewName,InfoN) then
|
|
begin
|
|
begin
|
|
L:=InfoO.DataSize;
|
|
L:=InfoO.DataSize;
|
|
if L>0 then
|
|
if L>0 then
|
|
@@ -326,7 +326,7 @@ begin
|
|
FreeMem(P);
|
|
FreeMem(P);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- end;
|
|
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TRegistry.SetCurrentKey(Value: HKEY);
|
|
procedure TRegistry.SetCurrentKey(Value: HKEY);
|