mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +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
|
||||
#include <debug.h>
|
||||
|
||||
SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
|
||||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -904,36 +904,24 @@ void WINAPI PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
|
|||
pFormat += 2;
|
||||
if (attr & RPC_FC_P_SIMPLEPOINTER) desc = 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 (attr & RPC_FC_P_DEREF) {
|
||||
Pointer = *(unsigned char**)Pointer;
|
||||
TRACE("deref => %p\n", Pointer);
|
||||
}
|
||||
|
||||
m = NdrFreer[*desc & NDR_TABLE_MASK];
|
||||
if (m) m(pStubMsg, Pointer, desc);
|
||||
|
||||
/* hmm... is this sensible?
|
||||
* perhaps we should check if the memory comes from NdrAllocate,
|
||||
/* we should check if the memory comes from NdrAllocate,
|
||||
* 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 */
|
||||
switch (*desc) {
|
||||
case RPC_FC_BOGUS_STRUCT:
|
||||
case RPC_FC_BOGUS_ARRAY:
|
||||
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 (Pointer >= (unsigned char *)pStubMsg->RpcMsg->Buffer ||
|
||||
Pointer <= (unsigned char *)pStubMsg->RpcMsg->Buffer + pStubMsg->BufferLength)
|
||||
goto notfree;
|
||||
|
||||
if (attr & RPC_FC_P_ONSTACK) {
|
||||
TRACE("not freeing stack ptr %p\n", Pointer);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
|
||||
|
||||
extern SIZE_T RtlpAllocDeallocQueryBufferSize;
|
||||
|
||||
/* DATA **********************************************************************/
|
||||
|
||||
PCWSTR RtlpRegPaths[RTL_REGISTRY_MAXIMUM] =
|
||||
|
@ -970,7 +972,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
|||
NTSTATUS Status;
|
||||
PKEY_VALUE_FULL_INFORMATION KeyValueInfo = NULL;
|
||||
HANDLE KeyHandle, CurrentKey;
|
||||
SIZE_T BufferSize = 128, InfoSize;
|
||||
SIZE_T BufferSize, InfoSize;
|
||||
UNICODE_STRING KeyPath, KeyValueName;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
ULONG i, Value;
|
||||
|
@ -985,6 +987,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
|||
(RelativeTo & RTL_REGISTRY_HANDLE) ? NULL : Path);
|
||||
|
||||
/* Allocate a query buffer */
|
||||
BufferSize = RtlpAllocDeallocQueryBufferSize;
|
||||
KeyValueInfo = RtlpAllocDeallocQueryBuffer(&BufferSize, NULL, 0, &Status);
|
||||
if (!KeyValueInfo)
|
||||
{
|
||||
|
|
|
@ -207,37 +207,10 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
|||
ULONG Interface = InterfaceType, Bus = BusNumber, i;
|
||||
NTSTATUS Status;
|
||||
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 */
|
||||
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 */
|
||||
Component = &CurrentEntry->ComponentEntry;
|
||||
if ((Component->Class == AdapterClass) &&
|
||||
|
@ -303,35 +276,7 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
|||
}
|
||||
|
||||
/* 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 */
|
||||
Status = CmpInitializeRegistryNode(CurrentEntry,
|
||||
ParentHandle,
|
||||
|
@ -345,12 +290,10 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
|||
if (CurrentEntry->Child)
|
||||
{
|
||||
/* Recurse child */
|
||||
tabLevel++;
|
||||
Status = CmpSetupConfigurationTree(CurrentEntry->Child,
|
||||
NewHandle,
|
||||
Interface,
|
||||
Bus);
|
||||
tabLevel--;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Fail */
|
||||
|
@ -433,8 +376,6 @@ CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
if (LoaderBlock->ConfigurationRoot)
|
||||
{
|
||||
/* Setup the configuration tree */
|
||||
DPRINT1("ARC Hardware Tree Received @ 0x%p. Dumping HW Info:\n\n",
|
||||
LoaderBlock->ConfigurationRoot);
|
||||
Status = CmpSetupConfigurationTree(LoaderBlock->ConfigurationRoot,
|
||||
KeyHandle,
|
||||
-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;
|
||||
|
||||
PAGED_LOOKASIDE_LIST RtlpRangeListEntryLookasideList;
|
||||
SIZE_T RtlpAllocDeallocQueryBufferSize = 128;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
|
Loading…
Reference in a new issue