Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3b4801c5
Commit
3b4801c5
authored
Jan 25, 2005
by
Eric Kohl
Committed by
Alexandre Julliard
Jan 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement DuplicateString and QueryRegistryValue.
parent
d0bdb388
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
2 deletions
+83
-2
misc.c
dlls/setupapi/misc.c
+81
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+2
-2
No files found.
dlls/setupapi/misc.c
View file @
3b4801c5
...
...
@@ -27,6 +27,8 @@
#include "winreg.h"
#include "setupapi.h"
#include "wine/unicode.h"
/**************************************************************************
* MyFree [SETUPAPI.@]
...
...
@@ -91,3 +93,82 @@ LPVOID WINAPI MyRealloc(LPVOID lpSrc, DWORD dwSize)
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
lpSrc
,
dwSize
);
}
/**************************************************************************
* DuplicateString [SETUPAPI.@]
*
* Duplicates a unicode string.
*
* PARAMS
* lpSrc [I] pointer to the unicode string that will be duplicated
*
* RETURNS
* Success: pointer to the duplicated unicode string
* Failure: NULL
*
* NOTES
* Call MyFree() to release the duplicated string.
*/
LPWSTR
WINAPI
DuplicateString
(
LPCWSTR
lpSrc
)
{
LPWSTR
lpDst
;
lpDst
=
MyMalloc
((
lstrlenW
(
lpSrc
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
lpDst
==
NULL
)
return
NULL
;
strcpyW
(
lpDst
,
lpSrc
);
return
lpDst
;
}
/**************************************************************************
* QueryRegistryValue [SETUPAPI.@]
*
* Retrieves value data from the registry and allocates memory for the
* value data.
*
* PARAMS
* hKey [I] Handle of the key to query
* lpValueName [I] Name of value under hkey to query
* lpData [O] Destination for the values contents,
* lpType [O] Destination for the value type
* lpcbData [O] Destination for the size of data
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: Otherwise
*
* NOTES
* Use MyFree to release the lpData buffer.
*/
LONG
WINAPI
QueryRegistryValue
(
HKEY
hKey
,
LPCWSTR
lpValueName
,
LPBYTE
*
lpData
,
LPDWORD
lpType
,
LPDWORD
lpcbData
)
{
LONG
lError
;
/* Get required buffer size */
*
lpcbData
=
0
;
lError
=
RegQueryValueExW
(
hKey
,
lpValueName
,
0
,
lpType
,
NULL
,
lpcbData
);
if
(
lError
!=
ERROR_SUCCESS
)
return
lError
;
/* Allocate buffer */
*
lpData
=
MyMalloc
(
*
lpcbData
);
if
(
*
lpData
==
NULL
)
return
ERROR_NOT_ENOUGH_MEMORY
;
/* Query registry value */
lError
=
RegQueryValueExW
(
hKey
,
lpValueName
,
0
,
lpType
,
*
lpData
,
lpcbData
);
if
(
lError
!=
ERROR_SUCCESS
)
MyFree
(
*
lpData
);
return
lError
;
}
dlls/setupapi/setupapi.spec
View file @
3b4801c5
...
...
@@ -198,7 +198,7 @@
@ stub DelimStringToMultiSz
@ stub DestroyTextFileReadBuffer
@ stub DoesUserHavePrivilege
@ st
ub DuplicateString
@ st
dcall DuplicateString(wstr)
@ stub EnablePrivilege
@ stub ExtensionPropSheetPageProc
@ stub FileExists
...
...
@@ -226,7 +226,7 @@
@ stub OpenAndMapFileForRead
@ stub OutOfMemory
@ stub QueryMultiSzValueToArray
@ st
ub QueryRegistryValue
@ st
dcall QueryRegistryValue(long wstr ptr ptr ptr)
@ stub ReadAsciiOrUnicodeTextFile
@ stub RegistryDelnode
@ stub RetreiveFileSecurity
...
...
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