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);
#define TAG_RTLREGISTRY TAG('R', 'q', 'r', 'v')
+extern SIZE_T RtlpAllocDeallocQueryBufferSize;
+
/* DATA **********************************************************************/
PCWSTR RtlpRegPaths[RTL_REGISTRY_MAXIMUM] =
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;
(RelativeTo & RTL_REGISTRY_HANDLE) ? NULL : Path);
/* Allocate a query buffer */
+ BufferSize = RtlpAllocDeallocQueryBufferSize;
KeyValueInfo = RtlpAllocDeallocQueryBuffer(&BufferSize, NULL, 0, &Status);
if (!KeyValueInfo)
{
ULONG Interface = InterfaceType, Bus = BusNumber, i;\r
NTSTATUS Status;\r
HANDLE NewHandle;\r
- static ULONG t, tabLevel;\r
- PCHAR InterfaceStrings[MaximumInterfaceType + 1] =\r
- {\r
- "Internal",\r
- "Isa",\r
- "Eisa",\r
- "MicroChannel",\r
- "TurboChannel",\r
- "PCIBus",\r
- "VMEBus",\r
- "NuBus",\r
- "PCMCIABus",\r
- "CBus",\r
- "MPIBus",\r
- "MPSABus",\r
- "ProcessorInternal",\r
- "InternalPowerBus",\r
- "PNPISABus",\r
- "PNPBus",\r
- "Unknown"\r
- };\r
\r
/* Loop each entry */\r
while (CurrentEntry)\r
{\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Dumping node @ 0x%p\n", CurrentEntry);\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Parent @ 0x%p Sibling @ 0x%p Child @ 0x%p\n",\r
- CurrentEntry->Parent, CurrentEntry->Sibling, CurrentEntry->Child);\r
-\r
/* Check if this is an adapter */\r
Component = &CurrentEntry->ComponentEntry;\r
if ((Component->Class == AdapterClass) &&\r
}\r
\r
/* Dump information on the component */\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Component Type: %wZ\n", &CmTypeName[Component->Type]);\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Class: %wZ\n", &CmClassName[Component->Class]);\r
- if (Component->Class != SystemClass)\r
- {\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Device Index: %lx\n", DeviceIndexTable[Component->Type]); \r
- }\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Component Information:\n");\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("\tFlags: %lx\n", Component->Flags);\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("\tVersion: %lx\n", Component->Version);\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("\tAffinity: %lx\n", Component->AffinityMask);\r
- if (Component->IdentifierLength)\r
- {\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Identifier: %S\n", Component->Identifier);\r
- }\r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Configuration Data: %p\n", CurrentEntry->ConfigurationData); \r
- for (t = 0; t < tabLevel; t++) DbgPrint("\t");\r
- DbgPrint("Interface Type: %s Bus Number: %d\n\n",\r
- InterfaceStrings[Interface],\r
- Bus);\r
- \r
+\r
/* Setup the hardware node */\r
Status = CmpInitializeRegistryNode(CurrentEntry,\r
ParentHandle,\r
if (CurrentEntry->Child)\r
{\r
/* Recurse child */\r
- tabLevel++;\r
Status = CmpSetupConfigurationTree(CurrentEntry->Child,\r
NewHandle,\r
Interface,\r
Bus);\r
- tabLevel--;\r
if (!NT_SUCCESS(Status))\r
{\r
/* Fail */\r
if (LoaderBlock->ConfigurationRoot)\r
{\r
/* Setup the configuration tree */\r
- DPRINT1("ARC Hardware Tree Received @ 0x%p. Dumping HW Info:\n\n",\r
- LoaderBlock->ConfigurationRoot);\r
Status = CmpSetupConfigurationTree(LoaderBlock->ConfigurationRoot,\r
KeyHandle,\r
-1,\r
\r
\r
\r
+\r