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
cd77c562
Commit
cd77c562
authored
Dec 03, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Forward SHOpenRegStream2() to shcore.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9c91ba79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
131 deletions
+2
-131
regstream.c
dlls/shlwapi/regstream.c
+0
-129
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
No files found.
dlls/shlwapi/regstream.c
View file @
cd77c562
...
@@ -397,135 +397,6 @@ static ISHRegStream *IStream_Create(HKEY hKey, LPBYTE pbBuffer, DWORD dwLength)
...
@@ -397,135 +397,6 @@ static ISHRegStream *IStream_Create(HKEY hKey, LPBYTE pbBuffer, DWORD dwLength)
}
}
/*************************************************************************
/*************************************************************************
* SHOpenRegStream2A [SHLWAPI.@]
*
* Create a stream to read binary registry data.
*
* PARAMS
* hKey [I] Registry handle
* pszSubkey [I] The sub key name
* pszValue [I] The value name under the sub key
* dwMode [I] Unused
*
* RETURNS
* Success: An IStream interface referring to the registry data
* Failure: NULL, if the registry key could not be opened or is not binary.
*/
IStream
*
WINAPI
SHOpenRegStream2A
(
HKEY
hKey
,
LPCSTR
pszSubkey
,
LPCSTR
pszValue
,
DWORD
dwMode
)
{
ISHRegStream
*
tmp
;
HKEY
hStrKey
=
NULL
;
LPBYTE
lpBuff
=
NULL
;
DWORD
dwLength
=
0
;
LONG
ret
;
TRACE
(
"(%p,%s,%s,0x%08x)
\n
"
,
hKey
,
pszSubkey
,
pszValue
,
dwMode
);
if
(
dwMode
==
STGM_READ
)
ret
=
RegOpenKeyExA
(
hKey
,
pszSubkey
,
0
,
KEY_READ
,
&
hStrKey
);
else
/* in write mode we make sure the subkey exits */
ret
=
RegCreateKeyExA
(
hKey
,
pszSubkey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
hStrKey
,
NULL
);
if
(
ret
==
ERROR_SUCCESS
)
{
if
(
dwMode
==
STGM_READ
||
dwMode
==
STGM_READWRITE
)
{
/* read initial data */
ret
=
RegQueryValueExA
(
hStrKey
,
pszValue
,
0
,
0
,
0
,
&
dwLength
);
if
(
ret
==
ERROR_SUCCESS
&&
dwLength
)
{
lpBuff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLength
);
RegQueryValueExA
(
hStrKey
,
pszValue
,
0
,
0
,
lpBuff
,
&
dwLength
);
}
}
if
(
!
dwLength
)
lpBuff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLength
);
tmp
=
IStream_Create
(
hStrKey
,
lpBuff
,
dwLength
);
if
(
tmp
)
{
if
(
pszValue
)
{
int
len
=
lstrlenA
(
pszValue
)
+
1
;
tmp
->
u
.
keyNameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
memcpy
(
tmp
->
u
.
keyNameA
,
pszValue
,
len
);
}
tmp
->
dwMode
=
dwMode
;
tmp
->
bUnicode
=
FALSE
;
return
&
tmp
->
IStream_iface
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpBuff
);
if
(
hStrKey
)
RegCloseKey
(
hStrKey
);
return
NULL
;
}
/*************************************************************************
* SHOpenRegStream2W [SHLWAPI.@]
*
* See SHOpenRegStream2A.
*/
IStream
*
WINAPI
SHOpenRegStream2W
(
HKEY
hKey
,
LPCWSTR
pszSubkey
,
LPCWSTR
pszValue
,
DWORD
dwMode
)
{
ISHRegStream
*
tmp
;
HKEY
hStrKey
=
NULL
;
LPBYTE
lpBuff
=
NULL
;
DWORD
dwLength
=
0
;
LONG
ret
;
TRACE
(
"(%p,%s,%s,0x%08x)
\n
"
,
hKey
,
debugstr_w
(
pszSubkey
),
debugstr_w
(
pszValue
),
dwMode
);
if
(
dwMode
==
STGM_READ
)
ret
=
RegOpenKeyExW
(
hKey
,
pszSubkey
,
0
,
KEY_READ
,
&
hStrKey
);
else
/* in write mode we make sure the subkey exits */
ret
=
RegCreateKeyExW
(
hKey
,
pszSubkey
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
hStrKey
,
NULL
);
if
(
ret
==
ERROR_SUCCESS
)
{
if
(
dwMode
==
STGM_READ
||
dwMode
==
STGM_READWRITE
)
{
/* read initial data */
ret
=
RegQueryValueExW
(
hStrKey
,
pszValue
,
0
,
0
,
0
,
&
dwLength
);
if
(
ret
==
ERROR_SUCCESS
&&
dwLength
)
{
lpBuff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLength
);
RegQueryValueExW
(
hStrKey
,
pszValue
,
0
,
0
,
lpBuff
,
&
dwLength
);
}
}
if
(
!
dwLength
)
lpBuff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLength
);
tmp
=
IStream_Create
(
hStrKey
,
lpBuff
,
dwLength
);
if
(
tmp
)
{
if
(
pszValue
)
{
int
len
=
lstrlenW
(
pszValue
)
+
1
;
tmp
->
u
.
keyNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
memcpy
(
tmp
->
u
.
keyNameW
,
pszValue
,
len
*
sizeof
(
WCHAR
));
}
tmp
->
dwMode
=
dwMode
;
tmp
->
bUnicode
=
TRUE
;
return
&
tmp
->
IStream_iface
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
lpBuff
);
if
(
hStrKey
)
RegCloseKey
(
hStrKey
);
return
NULL
;
}
/*************************************************************************
* SHCreateStreamWrapper [SHLWAPI.@]
* SHCreateStreamWrapper [SHLWAPI.@]
*
*
* Create an IStream object on a block of memory.
* Create an IStream object on a block of memory.
...
...
dlls/shlwapi/shlwapi.spec
View file @
cd77c562
...
@@ -705,8 +705,8 @@
...
@@ -705,8 +705,8 @@
@ stdcall SHGetValueA ( long str str ptr ptr ptr )
@ stdcall SHGetValueA ( long str str ptr ptr ptr )
@ stdcall SHGetValueW ( long wstr wstr ptr ptr ptr )
@ stdcall SHGetValueW ( long wstr wstr ptr ptr ptr )
@ stdcall SHIsLowMemoryMachine(long)
@ stdcall SHIsLowMemoryMachine(long)
@ stdcall SHOpenRegStream2A(long str str long)
@ stdcall SHOpenRegStream2A(long str str long)
shcore.SHOpenRegStream2A
@ stdcall SHOpenRegStream2W(long wstr wstr long)
@ stdcall SHOpenRegStream2W(long wstr wstr long)
shcore.SHOpenRegStream2W
@ stdcall SHOpenRegStreamA(long str str long) shcore.SHOpenRegStreamA
@ stdcall SHOpenRegStreamA(long str str long) shcore.SHOpenRegStreamA
@ stdcall SHOpenRegStreamW(long wstr wstr long) shcore.SHOpenRegStreamW
@ stdcall SHOpenRegStreamW(long wstr wstr long) shcore.SHOpenRegStreamW
@ stdcall SHQueryInfoKeyA(long ptr ptr ptr ptr)
@ stdcall SHQueryInfoKeyA(long ptr ptr ptr ptr)
...
...
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