17#define QUERY_ACTCTX_FLAG_VALID (QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX | \
18 QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE | \
19 QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS | \
20 QUERY_ACTCTX_FLAG_NO_ADDREF)
29 if (!ActivationBlock)
return;
32 if (ActivationBlock->ActivationContext)
36 ActivationBlock->ActivationContext =
NULL;
40 RtlFreeHeap(RtlGetProcessHeap(), 0, ActivationBlock);
51 ACTIVATION_CONTEXT_BASIC_INFORMATION ContextInfo;
54 ContextInfo.dwFlags = 0;
55 ContextInfo.hActCtx =
NULL;
58 if (ActivationBlock) *ActivationBlock =
NULL;
80 ActivationContextBasicInformation,
87 DPRINT1(
"SXS: %s - Failure getting active activation context; ntstatus %08lx\n",
93 if (ContextInfo.dwFlags & 1)
97 ContextInfo.hActCtx =
NULL;
101 if (!(
Flags & 2) || (ContextInfo.hActCtx))
107 if (!(*ActivationBlock))
115 (*ActivationBlock)->ActivationContext = ContextInfo.hActCtx;
116 (*ActivationBlock)->Flags = 0;
117 if (
Flags & 1) (*ActivationBlock)->Flags |= 1;
122 ContextInfo.hActCtx =
NULL;
165 Context.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
181 DPRINT1(
"HACK: Passed invalid ACTIVATION_CONTEXT_DATA!\n");
274 if ((
dwFlags & ~DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION) != 0)
283 if (
dwFlags & DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION)
303 if (phActCtx ==
NULL)
336 ULONG NativeFlags = 0;
340 if (pcbWrittenOrRequired) *pcbWrittenOrRequired = 0;
346 dwFlags |= QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX;
349 dwFlags |= QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE;
352 dwFlags |= QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS;
363 DPRINT1(
"SXS: %s() bad flags(passed: 0x%lx, allowed: 0x%lx, bad: 0x%lx)\n",
375 case ActivationContextBasicInformation:
376 case ActivationContextDetailedInformation:
377 case CompatibilityInformationInActivationContext:
378 case RunlevelInformationInActivationContext:
383 case AssemblyDetailedInformationInActivationContext:
384 case FileInformationInAssemblyOfAssemblyInActivationContext:
390 DPRINT1(
"SXS: %s() InfoClass 0x%lx requires SubInstance != NULL\n",
401 DPRINT1(
"SXS: %s() bad InfoClass(0x%lx)\n",
415 DPRINT1(
"SXS: %s() (pvBuffer == NULL) && ((cbBuffer=0x%lu) != 0)\n",
423 if (!pcbWrittenOrRequired)
426 DPRINT1(
"SXS: %s() (pvBuffer == NULL) && (pcbWrittenOrRequired == NULL)\n",
437 case QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX:
440 case QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE:
443 case QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS:
452 DPRINT1(
"SXS: %s(dwFlags=0x%lx) more than one flag in 0x%lx was passed\n",
461 if (
dwFlags & QUERY_ACTCTX_FLAG_NO_ADDREF)
467 DPRINT(
"SXS: %s() Calling Native API with Native Flags %lx for Win32 Flags %lx\n",
477 pcbWrittenOrRequired);
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define NT_SUCCESS(StatCode)
#define INVALID_HANDLE_VALUE
BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
VOID WINAPI AddRefActCtx(IN HANDLE hActCtx)
BOOL WINAPI QueryActCtxW(IN DWORD dwFlags, IN HANDLE hActCtx, IN PVOID pvSubInstance, IN ULONG ulInfoClass, IN PVOID pvBuffer, IN SIZE_T cbBuffer, IN OUT SIZE_T *pcbWrittenOrRequired OPTIONAL)
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
NTSTATUS NTAPI BasepAllocateActivationContextActivationBlock(IN DWORD Flags, IN PVOID CompletionRoutine, IN PVOID CompletionContext, OUT PBASEP_ACTCTX_BLOCK *ActivationBlock)
NTSTATUS NTAPI BasepProbeForDllManifest(IN PVOID DllHandle, IN PCWSTR FullDllName, OUT PVOID *ActCtx)
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
#define QUERY_ACTCTX_FLAG_VALID
VOID NTAPI BasepFreeActivationContextActivationBlock(IN PBASEP_ACTCTX_BLOCK ActivationBlock)
NTSYSAPI NTSTATUS WINAPI RtlActivateActivationContext(DWORD, HANDLE, ULONG_PTR *)
NTSYSAPI NTSTATUS WINAPI RtlZombifyActivationContext(HANDLE)
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
NTSYSAPI void WINAPI RtlDeactivateActivationContext(DWORD, ULONG_PTR)
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
NTSYSAPI NTSTATUS WINAPI RtlCreateActivationContext(HANDLE *, const void *)
NTSYSAPI NTSTATUS WINAPI RtlGetActiveActivationContext(HANDLE *)
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
NTSTATUS NTAPI LdrFindResource_U(_In_ PVOID BaseAddress, _In_ PLDR_RESOURCE_INFO ResourceInfo, _In_ ULONG Level, _Out_ PIMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry)
_In_ PCWSTR _Out_ PVOID * ActCtx
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_ADDRESS
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_HMODULE
#define RTL_DEACTIVATE_ACTIVATION_CONTEXT_FLAG_FORCE_EARLY_DEACTIVATION
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_USE_ACTIVE_ACTIVATION_CONTEXT
#define STATUS_INVALID_PARAMETER_4
#define STATUS_INVALID_PARAMETER_2
#define STATUS_SXS_INVALID_ACTCTXDATA_FORMAT
#define STATUS_RESOURCE_DATA_NOT_FOUND
#define STATUS_INVALID_PARAMETER_1
#define STATUS_INVALID_PARAMETER_3
#define STATUS_INVALID_PARAMETER_5
DWORD BaseSetLastNTError(IN NTSTATUS Status)
PULONG MinorVersion OPTIONAL
base of all file and directory entries
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE _In_opt_ __drv_aliasesMem WDFCONTEXT CompletionContext
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID
_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
_Must_inspect_result_ _In_ ULONG Flags