10#define RtlRosInitUnicodeStringFromLiteral(__Name__, __Value__) \
12 (__Name__)->Buffer = (__Value__); \
13 (__Name__)->Length = sizeof(__Value__) - sizeof(WCHAR); \
14 (__Name__)->MaximumLength = sizeof(__Value__); \
49 ,&KeyInformation[0],
sizeof(KeyInformation)
70 dprintf(
"Create key '\\Registry\\Machine\\Software\\testkey':\n");
100 dprintf(
"Delete key '\\Registry\\Machine\\Software\\testkey':\n");
133 dprintf(
"Enumerate key '\\Registry\\Machine\\Software':\n");
152 sizeof(KeyInformation),
171 sizeof(KeyInformation),
197 dprintf(
"Create key '\\Registry\\Machine\\Software\\testkey':\n");
238 dprintf(
"Create key '\\Registry\\Machine\\Software\\testkey':\n");
278 dprintf(
"Open key '\\Registry\\Machine\\Software\\testkey':\n");
314 dprintf(
"Open key '\\Registry\\Machine\\Software\\testkey':\n");
328 dprintf(
"Enumerate values:\n");
335 &KeyValueInformation[0],
336 sizeof(KeyValueInformation),
340 dprintf(
" Value:DO=%d, DL=%d, NL=%d, Name = ",
341 KeyValueInformation[0].DataOffset,
343 KeyValueInformation[0].NameLength);
346 dprintf(
", Type = %d\n", KeyValueInformation[0].
Type);
350 ((
char*)&KeyValueInformation[0]+KeyValueInformation[0].DataOffset));
354 *((
DWORD*)((
char*)&KeyValueInformation[0]+KeyValueInformation[0].DataOffset)));
376 dprintf(
"NtOpenKey \\Registry : ");
378 dprintf(
"NtOpenKey \\Registry\\Machine\\Software : ");
390 ,&KeyInformation[0],
sizeof(KeyInformation)
400 dprintf(
"NtEnumerateKey : \n");
405 ,&KeyInformation[0],
sizeof(KeyInformation)
431 dprintf(
"NtCreateKey non volatile: \n");
432 dprintf(
" \\Registry\\Machine\\Software\\test3reactos: ");
441 dprintf(
"delete \\Registry\\Machine\\software\\test3reactos ?");
445 dprintf(
"delete \\Registry\\Machine\\software\\test3reactos ?");
466 DWORD RegDataType, RegDataSize;
467 BOOL GlobalFifoEnable;
469 DWORD RegDisposition;
476 DWORD cchMaxValueName;
477 DWORD cbMaxValueData;
478 DWORD cbSecurityDescriptor;
482 dprintf (
"RegOpenKeyExW HKLM\\System\\Setup: ");
488 dprintf(
"\t\tdwError =%x\n",dwError);
494 , szClass, &cchClass,
NULL, &cSubKeys
495 , &cchMaxSubkey, &cchMaxClass, &cValues, &cchMaxValueName
496 , &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime);
497 dprintf (
"\t\t\t\tdwError %x\n", dwError);
499 dprintf (
"\tnb of subkeys=%d,last write : %d/%d/%d %d:%02.2d'%02.2d''%03.3d\n",cSubKeys
513 L"System\\ControlSet001\\Services\\Serial",
517 dprintf (
"\t\t\t\t\tdwError %x\n", dwError);
518 RegDataSize =
sizeof(GlobalFifoEnable);
521 dprintf (
"RegQueryValueExW: ");
526 (
PBYTE)&GlobalFifoEnable,
528 dprintf(
"\t\t\t\tdwError =%x\n",dwError);
531 dprintf(
"\tValue:DT=%d, DS=%d, Value=%d\n"
539 L"Parameters\\Serial001",
548 dprintf (
"\t\t\t\tdwError %x\n", dwError);
552 L"Software\\test4reactos\\test",
561 dprintf (
"\t\t\t\tdwError %x ", dwError);
562 dprintf (
"dwDisposition %x\n", dwDisposition);
570 (
BYTE*)
L"TestString",
573 dprintf (
"\t\t\t\tdwError %x\n", dwError);
576 dprintf (
"\t\t\t\t\tdwError %x\n", dwError);
593 dprintf (
"\t\t\t\tdwError %x ", dwError);
594 dprintf (
"dwDisposition %x\n", dwDisposition);
602 , szClass, &cchClass,
NULL, &cSubKeys
603 , &cchMaxSubkey, &cchMaxClass, &cValues, &cchMaxValueName
604 , &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime);
605 dprintf (
"\t\t\t\tdwError %x\n", dwError);
607 dprintf (
"\tnb of subkeys=%d,last write : %d/%d/%d %d:%02.2d'%02.2d''%03.3d\n",cSubKeys
618 dprintf (
"\t\t\t\t\tdwError %x\n", dwError);
631 dprintf(
" \\Registry\\Machine\\Software\\reactos : ");
655 dprintf(
"Create target key\n");
656 dprintf(
" Key: \\Registry\\Machine\\SOFTWARE\\Reactos\n");
666 dprintf(
"Create target value\n");
667 dprintf(
" Value: TestValue = 'Test String'\n");
679 dprintf(
" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
697 dprintf(
"Create link value\n");
698 dprintf(
" Value: SymbolicLinkValue = '\\Registry\\Machine\\SOFTWARE\\Reactos'\n");
704 dprintf(
"Creating link value failed! Test failed!\n");
713 dprintf(
" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
724 dprintf(
" Value: TestValue\n");
729 &KeyValueInformation[0],
730 sizeof(KeyValueInformation),
735 dprintf(
" Value: Type %d DataLength %d NameLength %d Name '",
736 KeyValueInformation[0].
Type,
738 KeyValueInformation[0].NameLength);
744 KeyValueInformation[0].
Name+1
745 +KeyValueInformation[0].NameLength/2);
763 dprintf(
" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
780 dprintf(
"Could not open the link key. Please run the link create test first!\n");
784 dprintf(
"Delete link value\n");
830 dprintf(
"\t\t\t\tbRes =%x\n",bRes);
843 dprintf(
"\t\t\t\tdwError =%x\n",dwError);
845 dprintf(
"NtOpenKey \\Registry\\Machine : ");
871 dprintf(
"NtOpenKey \\Registry : ");
890 dprintf(
"NtEnumerateKey : \n");
907 dprintf(
"NtOpenKey \\Registry\\Machine : ");
922 dprintf(
"NtOpenKey System\\ControlSet001\\Services\\Tcpip\\Parameters : ");
925 dprintf(
"NtOpenKey System\\CurrentControlSet\\Services\\Tcpip : ");
937 dprintf(
"\tValue:DO=%d, DL=%d, NL=%d, Name = "
938 ,KeyValueInformation[0].DataOffset
940 ,KeyValueInformation[0].NameLength);
941 for (
i = 0;
i < 10 &&
i < KeyValueInformation[0].
NameLength / 2;
i++)
944 dprintf(
"\t\tType = %d\n", KeyValueInformation[0].
Type);
947 dprintf(
"\t\tValue = %S\n", KeyValueInformation[0].
Name + KeyValueInformation[0].NameLength / 2);
949 dprintf(
"NtEnumerateValueKey : \n");
954 dprintf(
"\tValue:DO=%d, DL=%d, NL=%d, Name = "
955 ,KeyValueInformation[0].DataOffset
957 ,KeyValueInformation[0].NameLength);
960 dprintf(
", Type = %d\n", KeyValueInformation[0].
Type);
962 dprintf(
"\t\tValue = %S\n", ((
char*)&KeyValueInformation[0]+KeyValueInformation[0].DataOffset));
964 dprintf(
"\t\tValue = %X\n", *((
DWORD*)((
char*)&KeyValueInformation[0]+KeyValueInformation[0].DataOffset)));
989 dprintf(
" 3 = Enumerate key\n");
990 dprintf(
" 4 = Set value (REG_SZ)\n");
991 dprintf(
" 5 = Set value (REG_DWORD)\n");
992 dprintf(
" 6 = Delete value\n");
993 dprintf(
" 7 = Enumerate value\n");
ACPI_SIZE strlen(const char *String)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
#define RegCloseKey(hKey)
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
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)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
#define GetCurrentProcess()
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleA(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleA(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void DeleteValueTest(void)
#define RtlRosInitUnicodeStringFromLiteral(__Name__, __Value__)
void EnumerateValueTest(void)
void EnumerateKeyTest(void)
void do_enumeratekey(PWSTR Name)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
#define REG_OPTION_OPEN_LINK
@ KeyValueFullInformation
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
#define REG_OPTION_CREATE_LINK
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
#define REG_OPTION_NON_VOLATILE
NTSYSAPI NTSTATUS NTAPI NtEnumerateKey(IN HANDLE KeyHandle, IN ULONG Index, IN KEY_INFORMATION_CLASS KeyInformationClass, IN PVOID KeyInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define REG_OPTION_VOLATILE
NTSTATUS NTAPI NtDeleteKey(IN HANDLE KeyHandle)
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
NTSTATUS NTAPI NtFlushKey(IN HANDLE KeyHandle)
NTSTATUS NTAPI NtEnumerateValueKey(IN HANDLE KeyHandle, IN ULONG Index, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, OUT PVOID KeyValueInformation, IN ULONG Length, OUT PULONG ResultLength)
NTSTATUS NTAPI NtLoadKey(IN POBJECT_ATTRIBUTES KeyObjectAttributes, IN POBJECT_ATTRIBUTES FileObjectAttributes)
NTSTATUS NTAPI NtQueryKey(IN HANDLE KeyHandle, IN KEY_INFORMATION_CLASS KeyInformationClass, OUT PVOID KeyInformation, IN ULONG Length, OUT PULONG ResultLength)
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS NTAPI NtOpenProcessToken(IN HANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, OUT PHANDLE TokenHandle)
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
#define RTL_CONSTANT_STRING(s)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
#define STD_OUTPUT_HANDLE
#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
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED