mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:23:32 +00:00
- Fix default buffer size for user-mode RtlQueryRegistryValues queries, this removes warnings on debug log about buffer being too small (it was!).
- Remove ARC tree dump since this code has now been proven to work. - Sync PointerFree with WINE, removing the unhandled data type=warning. svn path=/trunk/; revision=31172
This commit is contained in:
parent
93675d12ab
commit
697723f229
5 changed files with 19 additions and 83 deletions
|
@ -13,6 +13,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -904,36 +904,24 @@ void WINAPI PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
pFormat += 2;
|
pFormat += 2;
|
||||||
if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat;
|
if (attr & RPC_FC_P_SIMPLEPOINTER) desc = pFormat;
|
||||||
else desc = pFormat + *(const SHORT*)pFormat;
|
else desc = pFormat + *(const SHORT*)pFormat;
|
||||||
if (attr & RPC_FC_P_DEREF) {
|
|
||||||
Pointer = *(unsigned char**)Pointer;
|
|
||||||
TRACE("deref => %p\n", Pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Pointer) return;
|
if (!Pointer) return;
|
||||||
|
|
||||||
|
if (attr & RPC_FC_P_DEREF) {
|
||||||
|
Pointer = *(unsigned char**)Pointer;
|
||||||
|
TRACE("deref => %p\n", Pointer);
|
||||||
|
}
|
||||||
|
|
||||||
m = NdrFreer[*desc & NDR_TABLE_MASK];
|
m = NdrFreer[*desc & NDR_TABLE_MASK];
|
||||||
if (m) m(pStubMsg, Pointer, desc);
|
if (m) m(pStubMsg, Pointer, desc);
|
||||||
|
|
||||||
/* hmm... is this sensible?
|
/* we should check if the memory comes from NdrAllocate,
|
||||||
* perhaps we should check if the memory comes from NdrAllocate,
|
|
||||||
* and deallocate only if so - checking if the pointer is between
|
* and deallocate only if so - checking if the pointer is between
|
||||||
* BufferStart and BufferEnd is probably no good since the buffer
|
* BufferStart and BufferEnd will not always work since the buffer
|
||||||
* may be reallocated when the server wants to marshal the reply */
|
* may be reallocated when the server wants to marshal the reply */
|
||||||
switch (*desc) {
|
if (Pointer >= (unsigned char *)pStubMsg->RpcMsg->Buffer ||
|
||||||
case RPC_FC_BOGUS_STRUCT:
|
Pointer <= (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength)
|
||||||
case RPC_FC_BOGUS_ARRAY:
|
goto notfree;
|
||||||
case RPC_FC_USER_MARSHAL:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FIXME("unhandled data type=%02x\n", *desc);
|
|
||||||
case RPC_FC_CARRAY:
|
|
||||||
case RPC_FC_C_CSTRING:
|
|
||||||
case RPC_FC_C_WSTRING:
|
|
||||||
if (pStubMsg->ReuseBuffer) goto notfree;
|
|
||||||
break;
|
|
||||||
case RPC_FC_IP:
|
|
||||||
goto notfree;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attr & RPC_FC_P_ONSTACK) {
|
if (attr & RPC_FC_P_ONSTACK) {
|
||||||
TRACE("not freeing stack ptr %p\n", Pointer);
|
TRACE("not freeing stack ptr %p\n", Pointer);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
|
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
|
||||||
|
|
||||||
|
extern SIZE_T RtlpAllocDeallocQueryBufferSize;
|
||||||
|
|
||||||
/* DATA **********************************************************************/
|
/* DATA **********************************************************************/
|
||||||
|
|
||||||
PCWSTR RtlpRegPaths[RTL_REGISTRY_MAXIMUM] =
|
PCWSTR RtlpRegPaths[RTL_REGISTRY_MAXIMUM] =
|
||||||
|
@ -970,7 +972,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PKEY_VALUE_FULL_INFORMATION KeyValueInfo = NULL;
|
PKEY_VALUE_FULL_INFORMATION KeyValueInfo = NULL;
|
||||||
HANDLE KeyHandle, CurrentKey;
|
HANDLE KeyHandle, CurrentKey;
|
||||||
SIZE_T BufferSize = 128, InfoSize;
|
SIZE_T BufferSize, InfoSize;
|
||||||
UNICODE_STRING KeyPath, KeyValueName;
|
UNICODE_STRING KeyPath, KeyValueName;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
ULONG i, Value;
|
ULONG i, Value;
|
||||||
|
@ -985,6 +987,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
||||||
(RelativeTo & RTL_REGISTRY_HANDLE) ? NULL : Path);
|
(RelativeTo & RTL_REGISTRY_HANDLE) ? NULL : Path);
|
||||||
|
|
||||||
/* Allocate a query buffer */
|
/* Allocate a query buffer */
|
||||||
|
BufferSize = RtlpAllocDeallocQueryBufferSize;
|
||||||
KeyValueInfo = RtlpAllocDeallocQueryBuffer(&BufferSize, NULL, 0, &Status);
|
KeyValueInfo = RtlpAllocDeallocQueryBuffer(&BufferSize, NULL, 0, &Status);
|
||||||
if (!KeyValueInfo)
|
if (!KeyValueInfo)
|
||||||
{
|
{
|
||||||
|
|
|
@ -207,37 +207,10 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
||||||
ULONG Interface = InterfaceType, Bus = BusNumber, i;
|
ULONG Interface = InterfaceType, Bus = BusNumber, i;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE NewHandle;
|
HANDLE NewHandle;
|
||||||
static ULONG t, tabLevel;
|
|
||||||
PCHAR InterfaceStrings[MaximumInterfaceType + 1] =
|
|
||||||
{
|
|
||||||
"Internal",
|
|
||||||
"Isa",
|
|
||||||
"Eisa",
|
|
||||||
"MicroChannel",
|
|
||||||
"TurboChannel",
|
|
||||||
"PCIBus",
|
|
||||||
"VMEBus",
|
|
||||||
"NuBus",
|
|
||||||
"PCMCIABus",
|
|
||||||
"CBus",
|
|
||||||
"MPIBus",
|
|
||||||
"MPSABus",
|
|
||||||
"ProcessorInternal",
|
|
||||||
"InternalPowerBus",
|
|
||||||
"PNPISABus",
|
|
||||||
"PNPBus",
|
|
||||||
"Unknown"
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Loop each entry */
|
/* Loop each entry */
|
||||||
while (CurrentEntry)
|
while (CurrentEntry)
|
||||||
{
|
{
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Dumping node @ 0x%p\n", CurrentEntry);
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Parent @ 0x%p Sibling @ 0x%p Child @ 0x%p\n",
|
|
||||||
CurrentEntry->Parent, CurrentEntry->Sibling, CurrentEntry->Child);
|
|
||||||
|
|
||||||
/* Check if this is an adapter */
|
/* Check if this is an adapter */
|
||||||
Component = &CurrentEntry->ComponentEntry;
|
Component = &CurrentEntry->ComponentEntry;
|
||||||
if ((Component->Class == AdapterClass) &&
|
if ((Component->Class == AdapterClass) &&
|
||||||
|
@ -303,34 +276,6 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump information on the component */
|
/* Dump information on the component */
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Component Type: %wZ\n", &CmTypeName[Component->Type]);
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Class: %wZ\n", &CmClassName[Component->Class]);
|
|
||||||
if (Component->Class != SystemClass)
|
|
||||||
{
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Device Index: %lx\n", DeviceIndexTable[Component->Type]);
|
|
||||||
}
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Component Information:\n");
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("\tFlags: %lx\n", Component->Flags);
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("\tVersion: %lx\n", Component->Version);
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("\tAffinity: %lx\n", Component->AffinityMask);
|
|
||||||
if (Component->IdentifierLength)
|
|
||||||
{
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Identifier: %S\n", Component->Identifier);
|
|
||||||
}
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Configuration Data: %p\n", CurrentEntry->ConfigurationData);
|
|
||||||
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
|
|
||||||
DbgPrint("Interface Type: %s Bus Number: %d\n\n",
|
|
||||||
InterfaceStrings[Interface],
|
|
||||||
Bus);
|
|
||||||
|
|
||||||
/* Setup the hardware node */
|
/* Setup the hardware node */
|
||||||
Status = CmpInitializeRegistryNode(CurrentEntry,
|
Status = CmpInitializeRegistryNode(CurrentEntry,
|
||||||
|
@ -345,12 +290,10 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
||||||
if (CurrentEntry->Child)
|
if (CurrentEntry->Child)
|
||||||
{
|
{
|
||||||
/* Recurse child */
|
/* Recurse child */
|
||||||
tabLevel++;
|
|
||||||
Status = CmpSetupConfigurationTree(CurrentEntry->Child,
|
Status = CmpSetupConfigurationTree(CurrentEntry->Child,
|
||||||
NewHandle,
|
NewHandle,
|
||||||
Interface,
|
Interface,
|
||||||
Bus);
|
Bus);
|
||||||
tabLevel--;
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Fail */
|
/* Fail */
|
||||||
|
@ -433,8 +376,6 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
if (LoaderBlock->ConfigurationRoot)
|
if (LoaderBlock->ConfigurationRoot)
|
||||||
{
|
{
|
||||||
/* Setup the configuration tree */
|
/* Setup the configuration tree */
|
||||||
DPRINT1("ARC Hardware Tree Received @ 0x%p. Dumping HW Info:\n\n",
|
|
||||||
LoaderBlock->ConfigurationRoot);
|
|
||||||
Status = CmpSetupConfigurationTree(LoaderBlock->ConfigurationRoot,
|
Status = CmpSetupConfigurationTree(LoaderBlock->ConfigurationRoot,
|
||||||
KeyHandle,
|
KeyHandle,
|
||||||
-1,
|
-1,
|
||||||
|
@ -455,3 +396,4 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ typedef struct _RTL_RANGE_ENTRY
|
||||||
} RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY;
|
} RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY;
|
||||||
|
|
||||||
PAGED_LOOKASIDE_LIST RtlpRangeListEntryLookasideList;
|
PAGED_LOOKASIDE_LIST RtlpRangeListEntryLookasideList;
|
||||||
|
SIZE_T RtlpAllocDeallocQueryBufferSize = 128;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue