Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
2.4 KiB

  1. #if !defined(FUSION_INC_FUSIONNTDLL_H_INCLUDED_)
  2. #define FUSION_INC_FUSIONNTDLL_H_INCLUDED_
  3. #pragma once
  4. #if !defined(FUSION_STATIC_NTDLL)
  5. #if FUSION_WIN
  6. #define FUSION_STATIC_NTDLL 1
  7. #else
  8. #define FUSION_STATIC_NTDLL 0
  9. #endif // FUSION_WIN
  10. #endif // !defined(FUSION_STATIC_NTDLL)
  11. void
  12. FusionpInitializeNTDLLPtr(
  13. PVOID *ppfn,
  14. PCSTR szFunctionName
  15. );
  16. #if FUSION_STATIC_NTDLL
  17. #define FUSION_WRAP_NTDLL_FN(_rt, _api, _ai, _ao) inline _rt Fusionp ## _api _ai { return ::_api _ao; }
  18. #else
  19. #define FUSION_WRAP_NTDLL_FN(_rt, _api, _ai, _ao) \
  20. extern _rt (NTAPI * g_Fusionp ## _api) _ai; \
  21. inline _rt Fusionp ## _api _ai { return (*g_Fusionp ## _api) _ao; }
  22. #endif
  23. FUSION_WRAP_NTDLL_FN(WCHAR, RtlUpcaseUnicodeChar, (WCHAR wch), (wch))
  24. FUSION_WRAP_NTDLL_FN(WCHAR, RtlDowncaseUnicodeChar, (WCHAR wch), (wch))
  25. FUSION_WRAP_NTDLL_FN(ULONG, vDbgPrintExWithPrefix, (PCSTR Prefix, ULONG ComponentId, ULONG Level, PCSTR Format, va_list arglist), ((PCH) Prefix, ComponentId, Level, (PCH) Format, arglist))
  26. FUSION_WRAP_NTDLL_FN(DWORD, RtlNtStatusToDosError, (NTSTATUS st), (st))
  27. FUSION_WRAP_NTDLL_FN(NTSTATUS, RtlHashUnicodeString, (PCUNICODE_STRING String, BOOLEAN CaseInSensitive, ULONG HashAlgorithm, PULONG HashValue), (String, CaseInSensitive, HashAlgorithm, HashValue))
  28. FUSION_WRAP_NTDLL_FN(NTSTATUS, RtlExpandEnvironmentStrings_U, (PVOID Environment, PUNICODE_STRING Source, PUNICODE_STRING Destination, PULONG ReturnedLength), (Environment, Source, Destination, ReturnedLength))
  29. FUSION_WRAP_NTDLL_FN(NTSTATUS, NtQueryDebugFilterState, (ULONG ComponentId, ULONG Level), (ComponentId, Level))
  30. FUSION_WRAP_NTDLL_FN(LONG, RtlCompareUnicodeString, (PCUNICODE_STRING String1, PCUNICODE_STRING String2, BOOLEAN CaseInSensitive), ((PUNICODE_STRING) String1, (PUNICODE_STRING) String2, CaseInSensitive));
  31. FUSION_WRAP_NTDLL_FN(LONG, RtlUnhandledExceptionFilter, (struct _EXCEPTION_POINTERS *ExceptionInfo), (ExceptionInfo))
  32. FUSION_WRAP_NTDLL_FN(NTSTATUS, NtAllocateLocallyUniqueId, (PLUID Luid), (Luid))
  33. #if DBG
  34. FUSION_WRAP_NTDLL_FN(VOID, RtlAssert, (PVOID FailedAssertion, PVOID FileName, ULONG LineNumber, PCSTR Message), (FailedAssertion, FileName, LineNumber, (PCHAR) Message))
  35. #endif // DBG
  36. inline ULONG FusionpDbgPrint(PCSTR Format, ...) { va_list ap; va_start(ap, Format); ULONG uRetVal = ::FusionpvDbgPrintExWithPrefix("", DPFLTR_FUSION_ID, 0, Format, ap); va_end(ap); return uRetVal; }
  37. #endif // FUSION_INC_FUSIONNTDLL_H_INCLUDED_