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
4c984e08
Commit
4c984e08
authored
Mar 25, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Mar 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Test the MachineGuid value.
parent
45b944ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
crypt.c
dlls/advapi32/tests/crypt.c
+48
-0
No files found.
dlls/advapi32/tests/crypt.c
View file @
4c984e08
...
...
@@ -871,6 +871,53 @@ static void test_set_provider_ex(void)
LocalFree
(
pszProvName
);
}
static
void
test_machine_guid
(
void
)
{
char
originalGuid
[
40
],
guid
[
40
];
LONG
r
;
HKEY
key
;
DWORD
size
;
HCRYPTPROV
hCryptProv
;
BOOL
restoreGuid
=
FALSE
,
ret
;
r
=
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography"
,
0
,
KEY_ALL_ACCESS
,
&
key
);
if
(
r
!=
ERROR_SUCCESS
)
{
skip
(
"couldn't open HKLM
\\
Software
\\
Microsoft
\\
Cryptography
\n
"
);
return
;
}
/* Cache existing MachineGuid, and delete it */
size
=
sizeof
(
originalGuid
);
r
=
RegQueryValueExA
(
key
,
"MachineGuid"
,
NULL
,
NULL
,
(
BYTE
*
)
originalGuid
,
&
size
);
if
(
r
==
ERROR_SUCCESS
)
{
restoreGuid
=
TRUE
;
r
=
RegDeleteValueA
(
key
,
"MachineGuid"
);
ok
(
!
r
,
"RegDeleteValueA failed: %d
\n
"
,
r
);
}
else
ok
(
r
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
r
);
/* Create and release a provider */
ret
=
pCryptAcquireContextA
(
&
hCryptProv
,
szKeySet
,
NULL
,
PROV_RSA_FULL
,
0
);
ok
(
ret
,
"CryptAcquireContextA failed: %08x
\n
"
,
GetLastError
());
CryptReleaseContext
(
hCryptProv
,
0
);
/* Check that MachineGuid was created */
size
=
sizeof
(
guid
);
r
=
RegQueryValueExA
(
key
,
"MachineGuid"
,
NULL
,
NULL
,
(
BYTE
*
)
guid
,
&
size
);
todo_wine
ok
(
!
r
,
"expected to find MachineGuid: %d
\n
"
,
r
);
r
=
RegDeleteValueA
(
key
,
"MachineGuid"
);
todo_wine
ok
(
!
r
,
"RegDeleteValueA failed: %d
\n
"
,
r
);
if
(
restoreGuid
)
RegSetValueExA
(
key
,
"MachineGuid"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
originalGuid
,
strlen
(
originalGuid
)
+
1
);
RegCloseKey
(
key
);
}
START_TEST
(
crypt
)
{
init_function_pointers
();
...
...
@@ -879,6 +926,7 @@ START_TEST(crypt)
test_acquire_context
();
test_incorrect_api_usage
();
test_verify_sig
();
test_machine_guid
();
clean_up_environment
();
}
...
...
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