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
7d78d394
Commit
7d78d394
authored
Aug 01, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Create a helper to load a SIP function from an open key.
parent
3f563c3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
29 deletions
+39
-29
sip.c
dlls/crypt32/sip.c
+39
-29
No files found.
dlls/crypt32/sip.c
View file @
7d78d394
...
...
@@ -254,6 +254,39 @@ end_function:
return
TRUE
;
}
static
void
*
CRYPT_LoadSIPFuncFromKey
(
HKEY
key
,
HMODULE
*
pLib
)
{
LONG
r
;
DWORD
size
;
WCHAR
dllName
[
MAX_PATH
];
char
functionName
[
MAX_PATH
];
HMODULE
lib
;
void
*
func
=
NULL
;
/* Read the DLL entry */
size
=
sizeof
(
dllName
);
r
=
RegQueryValueExW
(
key
,
szDllName
,
NULL
,
NULL
,
(
LPBYTE
)
dllName
,
&
size
);
if
(
r
)
goto
end
;
/* Read the Function entry */
size
=
sizeof
(
functionName
);
r
=
RegQueryValueExA
(
key
,
"FuncName"
,
NULL
,
NULL
,
(
LPBYTE
)
functionName
,
&
size
);
if
(
r
)
goto
end
;
lib
=
LoadLibraryW
(
dllName
);
if
(
!
lib
)
goto
end
;
func
=
GetProcAddress
(
lib
,
functionName
);
if
(
func
)
*
pLib
=
lib
;
else
FreeLibrary
(
lib
);
end:
return
func
;
}
/***********************************************************************
* CryptSIPRetrieveSubjectGuid (CRYPT32.@)
*
...
...
@@ -378,40 +411,17 @@ static void *CRYPT_LoadSIPFunc(const GUID *pgSubject, LPCWSTR function,
HMODULE
*
pLib
)
{
LONG
r
;
HKEY
key
=
NULL
;
DWORD
size
;
WCHAR
dllName
[
MAX_PATH
];
char
functionName
[
MAX_PATH
];
HMODULE
lib
;
HKEY
key
;
void
*
func
=
NULL
;
TRACE
(
"(%s, %s)
\n
"
,
debugstr_guid
(
pgSubject
),
debugstr_w
(
function
));
r
=
CRYPT_OpenSIPFunctionKey
(
pgSubject
,
function
,
&
key
);
if
(
r
)
goto
error
;
/* Read the DLL entry */
size
=
sizeof
(
dllName
);
r
=
RegQueryValueExW
(
key
,
szDllName
,
NULL
,
NULL
,
(
LPBYTE
)
dllName
,
&
size
);
if
(
r
)
goto
error
;
/* Read the Function entry */
size
=
sizeof
(
functionName
);
r
=
RegQueryValueExA
(
key
,
"FuncName"
,
NULL
,
NULL
,
(
LPBYTE
)
functionName
,
&
size
);
if
(
r
)
goto
error
;
lib
=
LoadLibraryW
(
dllName
);
if
(
!
lib
)
goto
error
;
func
=
GetProcAddress
(
lib
,
functionName
);
if
(
func
)
*
pLib
=
lib
;
else
FreeLibrary
(
lib
);
error:
RegCloseKey
(
key
);
if
(
!
r
)
{
func
=
CRYPT_LoadSIPFuncFromKey
(
key
,
pLib
);
RegCloseKey
(
key
);
}
TRACE
(
"returning %p
\n
"
,
func
);
return
func
;
}
...
...
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