- Add missing definitions to headers.

- Do not use "with tag" when freeing the system buffer, because drivers are allowed to re-allocate their own buffer, which may have a different tag.

svn path=/trunk/; revision=37244
This commit is contained in:
Aleksey Bragin 2008-11-07 17:40:44 +00:00
parent de0a39ef52
commit 31ada60dd5
3 changed files with 66 additions and 8 deletions

View file

@ -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

View file

@ -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,

View file

@ -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 */