58 "Wrong value for Status, expected: SUCCESS or NOT_FOUND, got: 0x%lx\n",
93 Status = pNtApphelpCacheControl(999, &CacheEntry);
119 skip(
"NtApphelpCacheControl expects a different structure layout\n");
204 DbgPrint(
"RegisterInShimCache: RtlDosPathNameToNtPathName_U failed\n");
211 DbgPrint(
"RegisterInShimCache: CallCacheControl failed\n");
231 status.dwControlsAccepted = 0;
271 status.dwControlsAccepted = 0;
281 strcpy(
ptr,
" NtApphelpCacheControl service");
289 skip(
"Could not create helper service\n");
305 ok(0,
"QueryServiceStatusEx failed waiting for %lu\n",
Status);
310 ok(0,
"Timeout waiting for (%lu) from service, is: %lu.\n",
311 Status, ssp->dwCurrentState);
334 skip(
"Could not start helper service\n");
347 if (!pRegisterServiceCtrlHandlerExA)
349 win_skip(
"RegisterServiceCtrlHandlerExA not available, skipping tests\n");
354 if (!pNtApphelpCacheControl)
356 win_skip(
"NtApphelpCacheControl not available, skipping tests\n");
static void WINAPI service_main(DWORD argc, char **argv)
static void WaitService(SC_HANDLE service_handle, DWORD Status, SERVICE_STATUS_PROCESS *ssp)
@ RegisterShimCacheWithHandle
@ RegisterShimCacheWithoutHandle
static void RunApphelpCacheControlTests(SC_HANDLE service_handle)
static SC_HANDLE InstallService(SC_HANDLE scm_handle)
static PAPPHELP_CACHE_SERVICE_LOOKUP
static DWORD WINAPI service_handler(DWORD ctrl, DWORD event_type, void *event_data, void *context)
NTSTATUS CallCacheControl(UNICODE_STRING *PathName, BOOLEAN WithMapping, APPHELPCACHESERVICECLASS Service)
static HANDLE service_stop_event
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
static BOOLEAN RequestAddition(SC_HANDLE service_handle, BOOLEAN WithMapping)
static LPHANDLER_FUNCTION_EX
static SERVICE_STATUS_HANDLE service_status
int InitEnv(UNICODE_STRING *PathName)
static BOOLEAN RegisterInShimCache(BOOLEAN WithMapping)
void CheckValidation(UNICODE_STRING *PathName)
static char service_name[100]
static SC_HANDLE scm_handle
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define ok_ntstatus(status, expected)
#define FILE_NON_DIRECTORY_FILE
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define NT_SUCCESS(StatCode)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetTickCount(VOID)
#define FILE_SYNCHRONOUS_IO_NONALERT
enum _APPHELPCACHESERVICECLASS APPHELPCACHESERVICECLASS
@ ApphelpCacheServiceLookup
@ ApphelpCacheServiceRemove
@ ApphelpCacheServiceUpdate
@ ApphelpCacheServiceDump
#define OBJ_CASE_INSENSITIVE
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
#define FILE_READ_ATTRIBUTES
#define FILE_SHARE_DELETE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtApphelpCacheControl(_In_ APPHELPCACHESERVICECLASS Service, _In_opt_ PAPPHELP_CACHE_SERVICE_LOOKUP ServiceData)
static SERVICE_STATUS_HANDLE service_handle
BOOL WINAPI DeleteService(SC_HANDLE hService)
BOOL WINAPI StartServiceA(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCSTR *lpServiceArgVectors)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
SC_HANDLE WINAPI CreateServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, LPCSTR lpDisplayName, DWORD dwDesiredAccess, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCSTR lpBinaryPathName, LPCSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCSTR lpDependencies, LPCSTR lpServiceStartName, LPCSTR lpPassword)
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
BOOL WINAPI StartServiceCtrlDispatcherA(const SERVICE_TABLE_ENTRYA *lpServiceStartTable)
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus, LPSERVICE_STATUS lpServiceStatus)
int winetest_get_mainargs(char ***pargv)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
#define STATUS_INVALID_PARAMETER
VERSIONHELPERAPI IsWindows7OrGreater()
#define SERVICE_ACCEPT_STOP
#define SERVICE_STOP_PENDING
#define SERVICE_CONTROL_SHUTDOWN
#define SERVICE_CONTROL_STOP
#define SERVICE_ACCEPT_SHUTDOWN
#define SC_MANAGER_ALL_ACCESS
_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 SERVICE_DEMAND_START
#define SERVICE_WIN32_OWN_PROCESS
#define SERVICE_ERROR_IGNORE