#include "precomp.h"
#include <winbase.h>
#include <winreg.h>
Go to the source code of this file.
◆ ChangeNtProductType()
Definition at line 73 of file RtlGetNtProductType.c.
74{
75 PWSTR ProductTypeString;
79
81 {
82 ProductTypeString =
L"WinNT";
83 }
85 {
86 ProductTypeString =
L"LanmanNT";
87 }
89 {
90 ProductTypeString =
L"ServerNT";
91 }
92 else
93 {
94 ok(
FALSE,
"Passed invalid product type to CHangeNtProduct: %lu", NtProductType);
95 }
96
98 L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
99 0,
103 {
106 }
107
111 0,
113 (
PBYTE)ProductTypeString,
116 {
120 }
121
124}
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define HKEY_LOCAL_MACHINE
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Referenced by START_TEST().
◆ ReturnNtProduct()
Definition at line 14 of file RtlGetNtProductType.c.
15{
20
22 L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
23 0,
27 {
28 *ProductNtType = 0;
30 }
31
39 {
41 *ProductNtType = 0;
43 }
44
46 {
50 }
51
53 {
57 }
58
60 {
64 }
65
66 *ProductNtType = 0;
69}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Referenced by START_TEST().
◆ START_TEST()
Definition at line 126 of file RtlGetNtProductType.c.
127{
131
132
133
134
135
136
140
141
144 {
145 ok(Ret,
"Failed to query the product type value!\n");
146 }
147
148
150 ok(Ret ==
TRUE,
"Expected a valid product type value (and TRUE as returned success code) but got %u as status.\n", Ret);
151 ok(ProductNtType == ProductType,
"Expected the product type value to be the same but got %lu (original value pointed by RtlGetNtProductType() is %d).\n", ProductNtType, ProductType);
152
153
156 ok_long(ProductType2, ProductType);
157
160 ok_long(ProductType2, ProductType);
161
164 ok_long(ProductType2, ProductType);
165
167}
static BOOLEAN ChangeNtProductType(DWORD NtProductType)
static BOOLEAN ReturnNtProduct(PDWORD ProductNtType)
#define EndSeh(ExpectedStatus)
#define ok_long(expression, result)
#define ok_char(expression, result)
BOOLEAN NTAPI RtlGetNtProductType(_Out_ PNT_PRODUCT_TYPE ProductType)
enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE
#define STATUS_ACCESS_VIOLATION