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
Show 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)
...
@@ -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.
/* Assumes data->u.pPDSip has been loaded, and data->u.pPDSip->pSip allocated.
* Calls data->u.pPDSip->pSip->pfGet to construct data->hMsg.
* 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
)
LPCWSTR
filePath
)
{
{
DWORD
err
=
ERROR_SUCCESS
;
BOOL
ret
;
BOOL
ret
;
LPBYTE
buf
=
NULL
;
LPBYTE
buf
=
NULL
;
DWORD
size
=
0
;
DWORD
size
=
0
;
...
@@ -156,10 +157,7 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
...
@@ -156,10 +157,7 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
data
->
u
.
pPDSip
->
psSipSubjectInfo
=
data
->
u
.
pPDSip
->
psSipSubjectInfo
=
data
->
psPfns
->
pfnAlloc
(
sizeof
(
SIP_SUBJECTINFO
));
data
->
psPfns
->
pfnAlloc
(
sizeof
(
SIP_SUBJECTINFO
));
if
(
!
data
->
u
.
pPDSip
->
psSipSubjectInfo
)
if
(
!
data
->
u
.
pPDSip
->
psSipSubjectInfo
)
{
return
ERROR_OUTOFMEMORY
;
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
cbSize
=
sizeof
(
SIP_SUBJECTINFO
);
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
cbSize
=
sizeof
(
SIP_SUBJECTINFO
);
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
pgSubjectType
=
&
data
->
u
.
pPDSip
->
gSubject
;
data
->
u
.
pPDSip
->
psSipSubjectInfo
->
pgSubjectType
=
&
data
->
u
.
pPDSip
->
gSubject
;
...
@@ -169,17 +167,11 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
...
@@ -169,17 +167,11 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
&
data
->
dwEncoding
,
0
,
&
size
,
0
);
&
data
->
dwEncoding
,
0
,
&
size
,
0
);
if
(
!
ret
)
if
(
!
ret
)
{
return
TRUST_E_NOSIGNATURE
;
SetLastError
(
TRUST_E_NOSIGNATURE
);
return
FALSE
;
}
buf
=
data
->
psPfns
->
pfnAlloc
(
size
);
buf
=
data
->
psPfns
->
pfnAlloc
(
size
);
if
(
!
buf
)
if
(
!
buf
)
{
return
ERROR_OUTOFMEMORY
;
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
ret
=
data
->
u
.
pPDSip
->
pSip
->
pfGet
(
data
->
u
.
pPDSip
->
psSipSubjectInfo
,
&
data
->
dwEncoding
,
0
,
&
size
,
buf
);
&
data
->
dwEncoding
,
0
,
&
size
,
buf
);
...
@@ -188,12 +180,18 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
...
@@ -188,12 +180,18 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file,
data
->
hMsg
=
CryptMsgOpenToDecode
(
data
->
dwEncoding
,
0
,
0
,
data
->
hProv
,
data
->
hMsg
=
CryptMsgOpenToDecode
(
data
->
dwEncoding
,
0
,
0
,
data
->
hProv
,
NULL
,
NULL
);
NULL
,
NULL
);
if
(
data
->
hMsg
)
if
(
data
->
hMsg
)
{
ret
=
CryptMsgUpdate
(
data
->
hMsg
,
buf
,
size
,
TRUE
);
ret
=
CryptMsgUpdate
(
data
->
hMsg
,
buf
,
size
,
TRUE
);
if
(
!
ret
)
err
=
GetLastError
();
}
}
}
else
err
=
GetLastError
();
data
->
psPfns
->
pfnFree
(
buf
);
data
->
psPfns
->
pfnFree
(
buf
);
TRACE
(
"returning %d
\n
"
,
ret
);
TRACE
(
"returning %d
\n
"
,
err
);
return
ret
;
return
err
;
}
}
static
BOOL
SOFTPUB_CreateStoreFromMessage
(
CRYPT_PROVIDER_DATA
*
data
)
static
BOOL
SOFTPUB_CreateStoreFromMessage
(
CRYPT_PROVIDER_DATA
*
data
)
...
@@ -339,12 +337,10 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
...
@@ -339,12 +337,10 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data)
err
=
SOFTPUB_GetSIP
(
data
);
err
=
SOFTPUB_GetSIP
(
data
);
if
(
err
)
if
(
err
)
goto
error
;
goto
error
;
if
(
!
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
err
=
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
))
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
);
{
if
(
err
)
err
=
GetLastError
();
goto
error
;
goto
error
;
}
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
{
{
err
=
GetLastError
();
err
=
GetLastError
();
...
@@ -381,12 +377,10 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data)
...
@@ -381,12 +377,10 @@ static DWORD SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data)
err
=
SOFTPUB_GetSIP
(
data
);
err
=
SOFTPUB_GetSIP
(
data
);
if
(
err
)
if
(
err
)
goto
error
;
goto
error
;
if
(
!
SOFTPUB_GetMessageFromFile
(
data
,
catalog
,
err
=
SOFTPUB_GetMessageFromFile
(
data
,
data
->
pWintrustData
->
u
.
pFile
->
hFile
,
data
->
pWintrustData
->
u
.
pCatalog
->
pcwszCatalogFilePath
))
data
->
pWintrustData
->
u
.
pFile
->
pcwszFilePath
);
{
if
(
err
)
err
=
GetLastError
();
goto
error
;
goto
error
;
}
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
if
(
!
SOFTPUB_CreateStoreFromMessage
(
data
))
{
{
err
=
GetLastError
();
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