diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index a0318e6b940..603531358c7 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -1639,6 +1639,65 @@ typedef struct _RTL_GENERIC_TABLE PVOID TableContext; } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE; +typedef struct _UNICODE_PREFIX_TABLE_ENTRY +{ + CSHORT NodeTypeCode; + CSHORT NameLength; + struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree; + struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch; + RTL_SPLAY_LINKS Links; + PUNICODE_STRING Prefix; +} UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY; + +typedef struct _UNICODE_PREFIX_TABLE +{ + CSHORT NodeTypeCode; + CSHORT NameLength; + PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree; + PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry; +} UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE; + +NTSYSAPI +VOID +NTAPI +RtlInitializeUnicodePrefix ( + IN PUNICODE_PREFIX_TABLE PrefixTable +); + +NTSYSAPI +BOOLEAN +NTAPI +RtlInsertUnicodePrefix ( + IN PUNICODE_PREFIX_TABLE PrefixTable, + IN PUNICODE_STRING Prefix, + IN PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry +); + +NTSYSAPI +VOID +NTAPI +RtlRemoveUnicodePrefix ( + IN PUNICODE_PREFIX_TABLE PrefixTable, + IN PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry +); + +NTSYSAPI +PUNICODE_PREFIX_TABLE_ENTRY +NTAPI +RtlFindUnicodePrefix ( + IN PUNICODE_PREFIX_TABLE PrefixTable, + IN PUNICODE_STRING FullName, + IN ULONG CaseInsensitiveIndex +); + +NTSYSAPI +PUNICODE_PREFIX_TABLE_ENTRY +NTAPI +RtlNextUnicodePrefix ( + IN PUNICODE_PREFIX_TABLE PrefixTable, + IN BOOLEAN Restart +); + #undef PRTL_GENERIC_COMPARE_ROUTINE #undef PRTL_GENERIC_ALLOCATE_ROUTINE #undef PRTL_GENERIC_FREE_ROUTINE diff --git a/reactos/include/ddk/winddk.h b/reactos/include/ddk/winddk.h index 6a9e8b8e51e..c41b093dc13 100644 --- a/reactos/include/ddk/winddk.h +++ b/reactos/include/ddk/winddk.h @@ -9205,12 +9205,11 @@ IoReuseIrp( * IN PIRP Irp, * IN PDRIVER_CANCEL CancelRoutine) */ -#define IoSetCancelRoutine(_Irp, \ - _CancelRoutine) \ - ((PDRIVER_CANCEL) InterlockedExchangePointer( \ - (PVOID *) &(_Irp)->CancelRoutine, (PVOID) (_CancelRoutine))) - -/* +#define IoSetCancelRoutine( Irp, NewCancelRoutine ) ( \ + InterlockedExchange( (PLONG)&(Irp)->CancelRoutine, (LONG)(NewCancelRoutine) ) ) + + + /* * VOID * IoSetCompletionRoutine( * IN PIRP Irp, diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 148babfcb75..146175f3a92 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -286,7 +286,7 @@ IopCompleteRequest(IN PKAPC Apc, if (Irp->Flags & IRP_DEALLOCATE_BUFFER) { /* Deallocate it */ - ExFreePoolWithTag(Irp->AssociatedIrp.SystemBuffer, TAG_SYS_BUF); + ExFreePool(Irp->AssociatedIrp.SystemBuffer); } } @@ -976,7 +976,7 @@ IoCancelIrp(IN PIRP Irp) Irp->Cancel = TRUE; /* Clear the cancel routine and get the old one */ - CancelRoutine = IoSetCancelRoutine(Irp, NULL); + CancelRoutine = (PVOID)IoSetCancelRoutine(Irp, NULL); if (CancelRoutine) { /* We had a routine, make sure the IRP isn't completed */