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
bba9587f
Commit
bba9587f
authored
Sep 27, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement CRYPT_WriteSerializedStoreToFile using CRYPT_WriteSerializedStoreToStream.
parent
779dd45e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
56 deletions
+4
-56
serialize.c
dlls/crypt32/serialize.c
+4
-56
No files found.
dlls/crypt32/serialize.c
View file @
bba9587f
...
...
@@ -599,68 +599,16 @@ BOOL CRYPT_WriteSerializedStoreToStream(HCERTSTORE store,
return
ret
;
}
static
BOOL
CRYPT_SerializeContextsToFile
(
HANDLE
file
,
const
WINE_CONTEXT_INTERFACE
*
contextInterface
,
HCERTSTORE
store
)
static
BOOL
CRYPT_FileOutputFunc
(
void
*
handle
,
const
void
*
buffer
,
DWORD
size
)
{
const
void
*
context
=
NULL
;
BOOL
ret
;
do
{
context
=
contextInterface
->
enumContextsInStore
(
store
,
context
);
if
(
context
)
{
DWORD
size
=
0
;
LPBYTE
buf
=
NULL
;
ret
=
contextInterface
->
serialize
(
context
,
0
,
NULL
,
&
size
);
if
(
size
)
buf
=
CryptMemAlloc
(
size
);
if
(
buf
)
{
ret
=
contextInterface
->
serialize
(
context
,
0
,
buf
,
&
size
);
if
(
ret
)
ret
=
WriteFile
(
file
,
buf
,
size
,
&
size
,
NULL
);
}
CryptMemFree
(
buf
);
}
else
ret
=
TRUE
;
}
while
(
ret
&&
context
!=
NULL
);
if
(
context
)
contextInterface
->
free
(
context
);
return
ret
;
return
WriteFile
(
handle
,
buffer
,
size
,
&
size
,
NULL
);
}
BOOL
CRYPT_WriteSerializedStoreToFile
(
HANDLE
file
,
HCERTSTORE
store
)
{
static
const
BYTE
fileTrailer
[
12
]
=
{
0
};
WINE_CONTEXT_INTERFACE
interface
;
BOOL
ret
;
DWORD
size
;
SetFilePointer
(
file
,
0
,
NULL
,
FILE_BEGIN
);
ret
=
WriteFile
(
file
,
fileHeader
,
sizeof
(
fileHeader
),
&
size
,
NULL
);
if
(
ret
)
{
memcpy
(
&
interface
,
pCertInterface
,
sizeof
(
interface
));
interface
.
serialize
=
(
SerializeElementFunc
)
CRYPT_SerializeCertNoHash
;
ret
=
CRYPT_SerializeContextsToFile
(
file
,
&
interface
,
store
);
}
if
(
ret
)
{
memcpy
(
&
interface
,
pCRLInterface
,
sizeof
(
interface
));
interface
.
serialize
=
(
SerializeElementFunc
)
CRYPT_SerializeCRLNoHash
;
ret
=
CRYPT_SerializeContextsToFile
(
file
,
&
interface
,
store
);
}
if
(
ret
)
{
memcpy
(
&
interface
,
pCTLInterface
,
sizeof
(
interface
));
interface
.
serialize
=
(
SerializeElementFunc
)
CRYPT_SerializeCTLNoHash
;
ret
=
CRYPT_SerializeContextsToFile
(
file
,
&
interface
,
store
);
}
if
(
ret
)
ret
=
WriteFile
(
file
,
fileTrailer
,
sizeof
(
fileTrailer
),
&
size
,
NULL
);
return
ret
;
return
CRYPT_WriteSerializedStoreToStream
(
store
,
CRYPT_FileOutputFunc
,
file
);
}
BOOL
WINAPI
CertAddSerializedElementToStore
(
HCERTSTORE
hCertStore
,
...
...
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