60 if (InfoBufferSize == 0)
70 DPRINT1(
"Unrecognized user-mode callback request\n");
79 DPRINT(
"Callback handler dying! Error code %lu",
Error);
107 if (CallbackThread !=
NULL)
197 StringCbCopyW(DevicePath,
sizeof(DevicePath),
L"\\\\.\\Global\\GLOBALROOT\\Device\\");
ACPI_SIZE strlen(const char *String)
static WCHAR ServiceName[]
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define INVALID_HANDLE_VALUE
static void cleanup(void)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define KMTEST_DEVICE_PATH
#define IOCTL_KMTEST_USERMODE_AWAIT_REQ
#define IOCTL_KMTEST_USERMODE_SEND_RESPONSE
#define IOCTL_KMTEST_RUN_TEST
#define KMT_MAKE_CODE(ControlCode)
#define error_goto(Error, label)
DWORD KmtDeleteService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
DWORD KmtStopService(IN PCWSTR ServiceName OPTIONAL, IN OUT SC_HANDLE *ServiceHandle)
DWORD KmtCreateAndStartService(IN PCWSTR ServiceName, IN PCWSTR ServicePath, IN PCWSTR DisplayName OPTIONAL, OUT SC_HANDLE *ServiceHandle, IN BOOLEAN RestartIfRunning)
#define UNREFERENCED_PARAMETER(P)
PULONG MinorVersion OPTIONAL
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCbCatW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
KMT_CALLBACK_INFORMATION_CLASS OperationClass
DWORD KmtRunKernelTest(IN PCSTR TestName)
DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
DWORD WINAPI KmtUserCallbackThread(PVOID Parameter)
static WCHAR TestServiceName[MAX_PATH]
DWORD KmtOpenDriver(VOID)
VOID KmtCloseDriver(VOID)
DWORD KmtSendBufferToDriver(IN DWORD ControlCode, IN OUT PVOID Buffer OPTIONAL, IN DWORD InLength, IN OUT PDWORD OutLength)
DWORD KmtSendUlongToDriver(IN DWORD ControlCode, IN DWORD Value)
static HANDLE TestDeviceHandle
DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String)
DWORD KmtSendToDriver(IN DWORD ControlCode)
DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning)
VOID KmtUnloadDriverKeepService(VOID)
static SC_HANDLE TestServiceHandle
DWORD KmtSendWStringToDriver(IN DWORD ControlCode, IN PCWSTR String)
VOID KmtUnloadDriver(VOID)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
SIZE_T NTAPI VirtualQuery(IN LPCVOID lpAddress, OUT PMEMORY_BASIC_INFORMATION lpBuffer, IN SIZE_T dwLength)
DWORD WINAPI GetLastError(void)
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
_Inout_opt_ PVOID Parameter