|
@@ -28,12 +28,13 @@ begin
|
|
Dispose(PWinRegData(FSysData));
|
|
Dispose(PWinRegData(FSysData));
|
|
end;
|
|
end;
|
|
|
|
|
|
-Function PrepKey(Const S : String) : pChar;
|
|
|
|
|
|
+Function PrepKey(Const S : String) : String;
|
|
|
|
|
|
begin
|
|
begin
|
|
- Result:=PChar(S);
|
|
|
|
- If Result^='\' then
|
|
|
|
- Inc(Result);
|
|
|
|
|
|
+ If Copy(S, 1, 1)='\' then
|
|
|
|
+ Result := Copy(Result, 2)
|
|
|
|
+ else
|
|
|
|
+ Result := S;
|
|
end;
|
|
end;
|
|
|
|
|
|
Function RelativeKey(Const S : String) : Boolean;
|
|
Function RelativeKey(Const S : String) : Boolean;
|
|
@@ -52,7 +53,7 @@ Var
|
|
|
|
|
|
begin
|
|
begin
|
|
SecurityAttributes := Nil;
|
|
SecurityAttributes := Nil;
|
|
- u:=UTF8Decode(PrepKey(Key));
|
|
|
|
|
|
+ u:=PrepKey(Key);
|
|
FLastError:=RegCreateKeyExW(GetBaseKey(RelativeKey(Key)),
|
|
FLastError:=RegCreateKeyExW(GetBaseKey(RelativeKey(Key)),
|
|
PWideChar(u),
|
|
PWideChar(u),
|
|
0,
|
|
0,
|
|
@@ -71,14 +72,14 @@ function TRegistry.DeleteKey(const Key: String): Boolean;
|
|
Var
|
|
Var
|
|
u: UnicodeString;
|
|
u: UnicodeString;
|
|
begin
|
|
begin
|
|
- u:=UTF8Decode(PRepKey(Key));
|
|
|
|
|
|
+ u:=PRepKey(Key);
|
|
FLastError:=RegDeleteKeyW(GetBaseKey(RelativeKey(Key)),PWideChar(u));
|
|
FLastError:=RegDeleteKeyW(GetBaseKey(RelativeKey(Key)),PWideChar(u));
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
end;
|
|
end;
|
|
|
|
|
|
function TRegistry.DeleteValue(const Name: String): Boolean;
|
|
function TRegistry.DeleteValue(const Name: String): Boolean;
|
|
begin
|
|
begin
|
|
- FLastError:= RegDeleteValueW(fCurrentKey, PWideChar(UTF8Decode(Name)));
|
|
|
|
|
|
+ FLastError:= RegDeleteValueW(fCurrentKey, PWideChar(UnicodeString(Name)));
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -89,7 +90,7 @@ Var
|
|
RD : DWord;
|
|
RD : DWord;
|
|
|
|
|
|
begin
|
|
begin
|
|
- u := UTF8Decode(Name);
|
|
|
|
|
|
+ u := Name;
|
|
FLastError:=RegQueryValueExW(fCurrentKey,PWideChar(u),Nil,
|
|
FLastError:=RegQueryValueExW(fCurrentKey,PWideChar(u),Nil,
|
|
@RD,Buffer,lpdword(@BufSize));
|
|
@RD,Buffer,lpdword(@BufSize));
|
|
if (FLastError<>ERROR_SUCCESS) Then
|
|
if (FLastError<>ERROR_SUCCESS) Then
|
|
@@ -110,7 +111,7 @@ Var
|
|
RD : DWord;
|
|
RD : DWord;
|
|
|
|
|
|
begin
|
|
begin
|
|
- u:=UTF8Decode(ValueName);
|
|
|
|
|
|
+ u:=ValueName;
|
|
With Value do
|
|
With Value do
|
|
begin
|
|
begin
|
|
FLastError:=RegQueryValueExW(fCurrentKey,PWideChar(u),Nil,lpdword(@RegData),Nil,lpdword(@DataSize));
|
|
FLastError:=RegQueryValueExW(fCurrentKey,PWideChar(u),Nil,lpdword(@RegData),Nil,lpdword(@DataSize));
|
|
@@ -147,7 +148,7 @@ begin
|
|
{$ifdef WinCE}
|
|
{$ifdef WinCE}
|
|
FLastError:=RegOpenKeyEx(GetBaseKey(Rel),PWideChar(WideString(S)),0,FAccess,Result);
|
|
FLastError:=RegOpenKeyEx(GetBaseKey(Rel),PWideChar(WideString(S)),0,FAccess,Result);
|
|
{$else WinCE}
|
|
{$else WinCE}
|
|
- u:=UTF8Decode(S);
|
|
|
|
|
|
+ u:=UnicodeString(S);
|
|
FLastError:=RegOpenKeyExW(GetBaseKey(Rel),PWideChar(u),0,FAccess,Result);
|
|
FLastError:=RegOpenKeyExW(GetBaseKey(Rel),PWideChar(u),0,FAccess,Result);
|
|
{$endif WinCE}
|
|
{$endif WinCE}
|
|
end;
|
|
end;
|
|
@@ -212,7 +213,7 @@ Var
|
|
S: string;
|
|
S: string;
|
|
begin
|
|
begin
|
|
SecurityAttributes := Nil;
|
|
SecurityAttributes := Nil;
|
|
- u:=UTF8Decode(PrepKey(Key));
|
|
|
|
|
|
+ u:=PrepKey(Key);
|
|
If CanCreate then
|
|
If CanCreate then
|
|
begin
|
|
begin
|
|
Handle:=0;
|
|
Handle:=0;
|
|
@@ -260,7 +261,7 @@ begin
|
|
{$ifdef WinCE}
|
|
{$ifdef WinCE}
|
|
Result:=False;
|
|
Result:=False;
|
|
{$else}
|
|
{$else}
|
|
- FLastError:=RegConnectRegistryW(PWideChar(UTF8Decode(UNCName)),RootKey,newroot);
|
|
|
|
|
|
+ FLastError:=RegConnectRegistryW(PWideChar(UnicodeString(UNCName)),RootKey,newroot);
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
if Result then begin
|
|
if Result then begin
|
|
RootKey:=newroot;
|
|
RootKey:=newroot;
|
|
@@ -422,7 +423,7 @@ Var
|
|
|
|
|
|
begin
|
|
begin
|
|
RegDataType:=RegDataWords[RegData];
|
|
RegDataType:=RegDataWords[RegData];
|
|
- u:=UTF8Decode(Name);
|
|
|
|
|
|
+ u:=UnicodeString(Name);
|
|
FLastError:=RegSetValueExW(fCurrentKey,PWideChar(u),0,RegDataType,Buffer,BufSize);
|
|
FLastError:=RegSetValueExW(fCurrentKey,PWideChar(u),0,RegDataType,Buffer,BufSize);
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
Result:=FLastError=ERROR_SUCCESS;
|
|
end;
|
|
end;
|