ReactOS 0.4.15-dev-5672-gf73ac17
RegOpenKeyExW.c File Reference
#include "precomp.h"
Include dependency graph for RegOpenKeyExW.c:

Go to the source code of this file.

Macros

#define TEST_STR   L".exe"
 

Functions

 START_TEST (RegOpenKeyExW)
 

Macro Definition Documentation

◆ TEST_STR

#define TEST_STR   L".exe"

Definition at line 10 of file RegOpenKeyExW.c.

Function Documentation

◆ START_TEST()

START_TEST ( RegOpenKeyExW  )

Definition at line 12 of file RegOpenKeyExW.c.

13{
14 char GccShouldNotAlignThis[20 * 2];
15 char GccShouldNotAlignThis2[20];
16 PVOID Alias = GccShouldNotAlignThis + 1;
17 PVOID UnalignedKey = GccShouldNotAlignThis2 + 1;
18 HKEY hk;
19 LONG lRes;
20
21 memcpy(Alias, TEST_STR, sizeof(TEST_STR));
22
24 ok_int(lRes, ERROR_SUCCESS);
25 if (lRes)
26 return;
27 RegCloseKey(hk);
28
29 ok_hex(((ULONG_PTR)Alias) % 2, 1);
30 lRes = RegOpenKeyExW(HKEY_CLASSES_ROOT, Alias, 0, KEY_READ, &hk);
31 ok_int(lRes, ERROR_SUCCESS);
32 if (!lRes)
33 RegCloseKey(hk);
34
35 ok_hex(((ULONG_PTR)UnalignedKey) % 2, 1);
36 lRes = RegOpenKeyExW(HKEY_CLASSES_ROOT, TEST_STR, 0, KEY_READ, UnalignedKey);
37 ok_int(lRes, ERROR_SUCCESS);
38 if (!lRes)
39 {
40 RegCloseKey(*(HKEY*)(UnalignedKey));
41 }
42}
#define TEST_STR
Definition: RegOpenKeyExW.c:10
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok_int(expression, result)
Definition: atltest.h:134
#define RegCloseKey(hKey)
Definition: registry.h:47
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10