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
568b0025
Commit
568b0025
authored
Jan 27, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Jan 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Return error directly from SOFTPUB_GetMessageFromFile.
parent
2c12de4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
25 deletions
+19
-25
softpub.c
dlls/wintrust/softpub.c
+19
-25
No files found.
dlls/wintrust/softpub.c
View file @
568b0025
...
...
@@ -146,9 +146,10 @@ static DWORD SOFTPUB_GetSIP(CRYPT_PROVIDER_DATA *data)
/* Assumes data->u.pPDSip has been loaded, and data->u.pPDSip->pSip allocated.
* Calls data->u.pPDSip->pSip->pfGet to construct data->hMsg.
*/
static
BOOL
SOFTPUB_GetMessageFromFile
(
CRYPT_PROVIDER_DATA
*
data
,
HANDLE
file
,
static
DWORD
SOFTPUB_GetMessageFromFile
(
CRYPT_PROVIDER_DATA
*
data
,
HANDLE
file
,
LPCWSTR
filePath
)
{
DWORD
err
=
ERROR_SUCCESS
;
BOOL
ret
;
LPBYTE
buf
=
NULL
;
DWORD
size
=
0
;
...
...
@@ -156,10 +157,7 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
data
->
u
.
pPDSip
->
psSipSubjectInfo
=
data
->
psPfns
->
pfnAlloc
(
sizeof
(
SIP_SUBJECTINFO
));
if
(
!
data
->
u
.
pPDSip
->
psSipSubjectInfo
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
return
ERROR_OUTOFMEMORY
;
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
cbSize
=
sizeof
(
SIP_SUBJECTINFO
);
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
pgSubjectType
=
&
data
->
u
.
pPDSip
->
gSubject
;
...
...
@@ -169,17 +167,11 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
&
data
->
dwEncoding
,
0
,
&
size
,
0
);
if
(
!
ret
)
{
SetLastError
(
TRUST_E_NOSIGNATURE
);
return
FALSE
;
}
return
TRUST_E_NOSIGNATURE
;
buf
=
data
->
psPfns
->
pfnAlloc
(
size
);
if
(
!
buf
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
return
ERROR_OUTOFMEMORY
;
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
&
data
->
dwEncoding
,
0
,
&
size
,
buf
);
...
...
@@ -188,12 +180,18 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
data
->
hMsg
=
CryptMsgOpenToDecode
(
data
->
dwEncoding
,
0
,
0
,
data
->
hProv
,
NULL
,
NULL
);
if
(
data
->
hMsg
)
{
ret
=
CryptMsgUpdate
(
data
->
hMsg
,
buf
,
size
,
TRUE
);
if
(
!
ret
)
err
=
GetLastError
();
}
}
else
err
=
GetLastError
();
data
->
psPfns
->
pfnFree
(
buf
);
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
TRACE
(
"returning %d
\n
"
,
err
);
return
err
;
}
static
BOOL
SOFTPUB_CreateStoreFromMessage
(
CRYPT_PROVIDER_DATA
*
data
)
...
...
@@ -339,12 +337,10 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
err
=
SOFTPUB_GetSIP
(
data
);
if
(
err
)
goto
error
;
if
(
!
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
))
{
err
=
GetLastError
();
err
=
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
);
if
(
err
)
goto
error
;
}
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
{
err
=
GetLastError
();
...
...
@@ -381,12 +377,10 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data)
err
=
SOFTPUB_GetSIP
(
data
);
if
(
err
)
goto
error
;
if
(
!
SOFTPUB_GetMessageFromFile
(
data
,
catalog
,
data
->
pWintrustData
->
u
.
pCatalog
->
pcwszCatalogFilePath
))
{
err
=
GetLastError
();
err
=
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
);
if
(
err
)
goto
error
;
}
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
{
err
=
GetLastError
();
...
...
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