Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3e3ed6f4
Commit
3e3ed6f4
authored
Dec 05, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Forward SHCopyKey() to shcore.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
454264f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
135 deletions
+2
-135
reg.c
dlls/shlwapi/reg.c
+0
-133
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
No files found.
dlls/shlwapi/reg.c
View file @
3e3ed6f4
...
...
@@ -1994,139 +1994,6 @@ HKEY WINAPI SHRegDuplicateHKey(HKEY hKey)
return
newKey
;
}
/*************************************************************************
* SHCopyKeyA [SHLWAPI.@]
*
* Copy a key and its values/sub keys to another location.
*
* PARAMS
* hKeySrc [I] Source key to copy from
* lpszSrcSubKey [I] Sub key under hKeySrc, or NULL to use hKeySrc directly
* hKeyDst [I] Destination key
* dwReserved [I] Reserved, must be 0
*
* RETURNS
* Success: ERROR_SUCCESS. The key is copied to the destination key.
* Failure: A standard windows error code.
*
* NOTES
* If hKeyDst is a key under hKeySrc, this function will misbehave
* (It will loop until out of stack, or the registry is full). This
* bug is present in Win32 also.
*/
DWORD
WINAPI
SHCopyKeyA
(
HKEY
hKeySrc
,
LPCSTR
lpszSrcSubKey
,
HKEY
hKeyDst
,
DWORD
dwReserved
)
{
WCHAR
szSubKeyW
[
MAX_PATH
];
TRACE
(
"(hkey=%p,%s,%p08x,%d)
\n
"
,
hKeySrc
,
debugstr_a
(
lpszSrcSubKey
),
hKeyDst
,
dwReserved
);
if
(
lpszSrcSubKey
)
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszSrcSubKey
,
-
1
,
szSubKeyW
,
MAX_PATH
);
return
SHCopyKeyW
(
hKeySrc
,
lpszSrcSubKey
?
szSubKeyW
:
NULL
,
hKeyDst
,
dwReserved
);
}
/*************************************************************************
* SHCopyKeyW [SHLWAPI.@]
*
* See SHCopyKeyA.
*/
DWORD
WINAPI
SHCopyKeyW
(
HKEY
hKeySrc
,
LPCWSTR
lpszSrcSubKey
,
HKEY
hKeyDst
,
DWORD
dwReserved
)
{
DWORD
dwKeyCount
=
0
,
dwValueCount
=
0
,
dwMaxKeyLen
=
0
;
DWORD
dwMaxValueLen
=
0
,
dwMaxDataLen
=
0
,
i
;
BYTE
buff
[
1024
];
LPVOID
lpBuff
=
buff
;
WCHAR
szName
[
MAX_PATH
],
*
lpszName
=
szName
;
DWORD
dwRet
=
S_OK
;
TRACE
(
"hkey=%p,%s,%p08x,%d)
\n
"
,
hKeySrc
,
debugstr_w
(
lpszSrcSubKey
),
hKeyDst
,
dwReserved
);
if
(
!
hKeyDst
||
!
hKeySrc
)
dwRet
=
ERROR_INVALID_PARAMETER
;
else
{
/* Open source key */
if
(
lpszSrcSubKey
)
dwRet
=
RegOpenKeyExW
(
hKeySrc
,
lpszSrcSubKey
,
0
,
KEY_ALL_ACCESS
,
&
hKeySrc
);
if
(
dwRet
)
hKeyDst
=
NULL
;
/* Don't close this key since we didn't open it */
else
{
/* Get details about sub keys and values */
dwRet
=
RegQueryInfoKeyW
(
hKeySrc
,
NULL
,
NULL
,
NULL
,
&
dwKeyCount
,
&
dwMaxKeyLen
,
NULL
,
&
dwValueCount
,
&
dwMaxValueLen
,
&
dwMaxDataLen
,
NULL
,
NULL
);
if
(
!
dwRet
)
{
if
(
dwMaxValueLen
>
dwMaxKeyLen
)
dwMaxKeyLen
=
dwMaxValueLen
;
/* Get max size for key/value names */
if
(
dwMaxKeyLen
++
>
MAX_PATH
-
1
)
lpszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxKeyLen
*
sizeof
(
WCHAR
));
if
(
dwMaxDataLen
>
sizeof
(
buff
))
lpBuff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxDataLen
);
if
(
!
lpszName
||
!
lpBuff
)
dwRet
=
ERROR_NOT_ENOUGH_MEMORY
;
}
}
}
/* Copy all the sub keys */
for
(
i
=
0
;
i
<
dwKeyCount
&&
!
dwRet
;
i
++
)
{
HKEY
hSubKeySrc
,
hSubKeyDst
;
DWORD
dwSize
=
dwMaxKeyLen
;
dwRet
=
RegEnumKeyExW
(
hKeySrc
,
i
,
lpszName
,
&
dwSize
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
dwRet
)
{
/* Open source sub key */
dwRet
=
RegOpenKeyExW
(
hKeySrc
,
lpszName
,
0
,
KEY_READ
,
&
hSubKeySrc
);
if
(
!
dwRet
)
{
/* Create destination sub key */
dwRet
=
RegCreateKeyW
(
hKeyDst
,
lpszName
,
&
hSubKeyDst
);
if
(
!
dwRet
)
{
/* Recursively copy keys and values from the sub key */
dwRet
=
SHCopyKeyW
(
hSubKeySrc
,
NULL
,
hSubKeyDst
,
0
);
RegCloseKey
(
hSubKeyDst
);
}
}
RegCloseKey
(
hSubKeySrc
);
}
}
/* Copy all the values in this key */
for
(
i
=
0
;
i
<
dwValueCount
&&
!
dwRet
;
i
++
)
{
DWORD
dwNameSize
=
dwMaxKeyLen
,
dwType
,
dwLen
=
dwMaxDataLen
;
dwRet
=
RegEnumValueW
(
hKeySrc
,
i
,
lpszName
,
&
dwNameSize
,
NULL
,
&
dwType
,
lpBuff
,
&
dwLen
);
if
(
!
dwRet
)
dwRet
=
SHSetValueW
(
hKeyDst
,
NULL
,
lpszName
,
dwType
,
lpBuff
,
dwLen
);
}
/* Free buffers if allocated */
if
(
lpszName
!=
szName
)
HeapFree
(
GetProcessHeap
(),
0
,
lpszName
);
if
(
lpBuff
!=
buff
)
HeapFree
(
GetProcessHeap
(),
0
,
lpBuff
);
if
(
lpszSrcSubKey
&&
hKeyDst
)
RegCloseKey
(
hKeyDst
);
return
dwRet
;
}
/*
* The following functions are ORDINAL ONLY:
*/
...
...
dlls/shlwapi/shlwapi.spec
View file @
3e3ed6f4
...
...
@@ -680,8 +680,8 @@
@ stdcall PathUnquoteSpacesA (str)
@ stdcall PathUnquoteSpacesW (wstr)
@ stdcall SHAutoComplete(ptr long)
@ stdcall SHCopyKeyA(long str long long)
@ stdcall SHCopyKeyW(long wstr long long)
@ stdcall SHCopyKeyA(long str long long)
shcore.SHCopyKeyA
@ stdcall SHCopyKeyW(long wstr long long)
shcore.SHCopyKeyW
@ stdcall SHCreateShellPalette(long)
@ stdcall SHCreateStreamOnFileA(str long ptr) shcore.SHCreateStreamOnFileA
@ stdcall SHCreateStreamOnFileEx(wstr long long long ptr ptr) shcore.SHCreateStreamOnFileEx
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment