ReactOS 0.4.16-dev-927-g467dec4
CertEnumSystemStoreLocation.c File Reference
#include <apitest.h>
#include <windef.h>
#include <wincrypt.h>
Include dependency graph for CertEnumSystemStoreLocation.c:

Go to the source code of this file.

Classes

struct  _CERT_SYSTEM_STORE_LOCATION
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define ARG_CONTEXT   ((PVOID)(ULONG_PTR)0x12345678)
 

Typedefs

typedef struct _CERT_SYSTEM_STORE_LOCATION CERT_SYSTEM_STORE_LOCATION
 
typedef struct _CERT_SYSTEM_STORE_LOCATIONPCERT_SYSTEM_STORE_LOCATION
 

Functions

static BOOL WINAPI CertEnumSystemStoreLocationCallback (_In_ LPCWSTR pwszStoreLocation, _In_ DWORD dwFlags, _Reserved_ void *pvReserved, _Inout_opt_ void *pvArg)
 
 START_TEST (CertEnumSystemStoreLocation)
 

Variables

static const CERT_SYSTEM_STORE_LOCATION g_SystemStoreLocations []
 
static ULONG g_Index = 0
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 9 of file CertEnumSystemStoreLocation.c.

◆ ARG_CONTEXT

#define ARG_CONTEXT   ((PVOID)(ULONG_PTR)0x12345678)

Definition at line 16 of file CertEnumSystemStoreLocation.c.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 10 of file CertEnumSystemStoreLocation.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file CertEnumSystemStoreLocation.c.

Typedef Documentation

◆ CERT_SYSTEM_STORE_LOCATION

◆ PCERT_SYSTEM_STORE_LOCATION

Function Documentation

◆ CertEnumSystemStoreLocationCallback()

static BOOL WINAPI CertEnumSystemStoreLocationCallback ( _In_ LPCWSTR  pwszStoreLocation,
_In_ DWORD  dwFlags,
_Reserved_ void pvReserved,
_Inout_opt_ void pvArg 
)
static

Definition at line 40 of file CertEnumSystemStoreLocation.c.

45{
46 ok(pvReserved == NULL, "pvReserved is not NULL\n");
47 ok(pvArg == ARG_CONTEXT, "pvArg incorrect\n");
48
50 {
51 ok(dwFlags == g_SystemStoreLocations[g_Index].dwFlags, "#%lu dwFlags incorrect\n", g_Index);
52 ok(wcscmp(pwszStoreLocation, g_SystemStoreLocations[g_Index].pwszStoreLocation) == 0,
53 "#%lu pwszStoreLocation incorrect\n",
54 g_Index);
55 }
56
57 g_Index++;
58 return TRUE;
59}
static const CERT_SYSTEM_STORE_LOCATION g_SystemStoreLocations[]
#define ARG_CONTEXT
static ULONG g_Index
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( CertEnumSystemStoreLocation  )

Definition at line 61 of file CertEnumSystemStoreLocation.c.

62{
63 BOOL bRet;
64
65 /* dwFlags should be 0, otherwise fail with E_INVALIDARG */
67 ok(bRet == FALSE && GetLastError() == E_INVALIDARG,
68 "CertEnumSystemStoreLocation should failed with E_INVALIDARG when dwFlags is not 0\n");
69
70 /* Start enumeration */
72 ok(bRet != FALSE, "CertEnumSystemStoreLocation failed with 0x%08lX\n", GetLastError());
73 ok(g_Index >= ARRAYSIZE(g_SystemStoreLocations), "Count of enumerated item incorrect\n");
74}
static BOOL WINAPI CertEnumSystemStoreLocationCallback(_In_ LPCWSTR pwszStoreLocation, _In_ DWORD dwFlags, _Reserved_ void *pvReserved, _Inout_opt_ void *pvArg)
#define E_INVALIDARG
Definition: ddrawi.h:101
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
BOOL WINAPI CertEnumSystemStoreLocation(_In_ DWORD dwFlags, _Inout_opt_ void *pvArg, __callback PFN_CERT_ENUM_SYSTEM_STORE_LOCATION pfnEnum)

Variable Documentation

◆ g_Index

ULONG g_Index = 0
static

◆ g_SystemStoreLocations

const CERT_SYSTEM_STORE_LOCATION g_SystemStoreLocations[]
static
Initial value:
= {
{ CERT_SYSTEM_STORE_CURRENT_USER, L"CurrentUser" },
{ CERT_SYSTEM_STORE_LOCAL_MACHINE, L"LocalMachine" },
{ CERT_SYSTEM_STORE_CURRENT_SERVICE, L"CurrentService" },
{ CERT_SYSTEM_STORE_SERVICES, L"Services" },
{ CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY, L"CurrentUserGroupPolicy" },
{ CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY, L"LocalMachineGroupPolicy" },
{ CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE, L"LocalMachineEnterprise" },
}
#define L(x)
Definition: ntvdm.h:50
#define CERT_SYSTEM_STORE_SERVICES
Definition: wincrypt.h:2330
#define CERT_SYSTEM_STORE_CURRENT_SERVICE
Definition: wincrypt.h:2328
#define CERT_SYSTEM_STORE_USERS
Definition: wincrypt.h:2332
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE
Definition: wincrypt.h:2338
#define CERT_SYSTEM_STORE_LOCAL_MACHINE
Definition: wincrypt.h:2326
#define CERT_SYSTEM_STORE_CURRENT_USER
Definition: wincrypt.h:2324
#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY
Definition: wincrypt.h:2334
#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY
Definition: wincrypt.h:2336

Definition at line 24 of file CertEnumSystemStoreLocation.c.

Referenced by CertEnumSystemStoreLocationCallback(), and START_TEST().