Пытаюсь узнать список минипортов, для этого регистрирую свой протокол, и строю свой итератор по протоколам, и пытаюсь достать имена минипортов соответствующих каждому протоколу, но получаю лог. Почему все имена либо пустые, либо вопросы? Код (Text): TestDriver: NdisRegisterProtocolDriver Complete 0x0 TestDriver: ProtocolName: RSPNDR TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: OpenBlock==NULL TestDriver: ProtocolName: WANARPV6 TestDriver: MiniportBlock->DeviceName: TestDriver: MiniportBlock==NULL TestDriver: OpenBlock==NULL TestDriver: ProtocolName: NDPROXY TestDriver: MiniportBlock->DeviceName: TestDriver: MiniportBlock==NULL TestDriver: MiniportBlock->DeviceName: TestDriver: MiniportBlock==NULL TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: OpenBlock==NULL TestDriver: ProtocolName: NDISWAN TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: OpenBlock==NULL TestDriver: ProtocolName: TCPIPTUNNEL TestDriver: OpenBlock==NULL TestDriver: ProtocolName: TCPIP TestDriver: MiniportBlock->DeviceName: ???? TestDriver: MiniportBlock==NULL TestDriver: OpenBlock==NULL TestDriver: ProtocolChain == NULL 0x7 TestDriver: NdisDeregisterProtocolDriver код моего драйвера. в чем может быть ошибка? Код (Text): NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { UNICODE_STRING DeviceName,Win32Device; PDEVICE_OBJECT DeviceObject = NULL; NTSTATUS status; unsigned i; NDIS_PROTOCOL_DRIVER_CHARACTERISTICS protocolChar; NDIS_STRING protoName = NDIS_STRING_CONST("MyOwnProtokol"); NDIS_STATUS NdisStatus; CHAR* ProtocolChain; ULONG offset; ULONG len; NDIS_OPEN_BLOCK_VISTA_SP1* OpenBlock; PNDIS60_VISTA_SP1_ADAPTER_BLOCK MiniportBlock; IFDEBUG(DbgPrint("TestDriver: Loading...\n")); NdisZeroMemory(&protocolChar,sizeof(NDIS_PROTOCOL_DRIVER_CHARACTERISTICS)); protocolChar.Header.Type = NDIS_OBJECT_TYPE_PROTOCOL_DRIVER_CHARACTERISTICS, protocolChar.Header.Size = sizeof(NDIS_PROTOCOL_DRIVER_CHARACTERISTICS); protocolChar.Header.Revision = NDIS_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_1; protocolChar.MajorNdisVersion = 0x06; protocolChar.MinorNdisVersion = 0x00; protocolChar.Name = protoName; protocolChar.SetOptionsHandler = MyProtocolSetOptions; protocolChar.OpenAdapterCompleteHandlerEx = MyNdisprotOpenAdapterComplete; protocolChar.CloseAdapterCompleteHandlerEx = MyNdisprotCloseAdapterComplete; protocolChar.SendNetBufferListsCompleteHandler = MyNdisprotSendComplete; protocolChar.OidRequestCompleteHandler = MyNdisprotRequestComplete; protocolChar.StatusHandlerEx = NULL; protocolChar.UninstallHandler = NULL; protocolChar.ReceiveNetBufferListsHandler = MyNdisprotReceiveNetBufferLists; protocolChar.NetPnPEventHandler = ProtocolNetPnPEvent; protocolChar.BindAdapterHandlerEx = MyNdisprotBindAdapter; protocolChar.UnbindAdapterHandlerEx = MyNdisprotUnbindAdapter; __try { NdisStatus = NdisRegisterProtocolDriver(NULL,&protocolChar,&ourProtocolHandle); if(NdisStatus!=NDIS_STATUS_SUCCESS) { IFDEBUG(DbgPrint("TestDriver: NdisRegisterProtocolDriver Uncomplete 0x%x\n",NdisStatus)); return STATUS_SUCCESS; } } __except(EXCEPTION_EXECUTE_HANDLER) { IFDEBUG(DbgPrint("TestDriver: Exception raised in NdisRegisterProtocolDriver...\n")); } ProtocolChain = (CHAR*)ourProtocolHandle; __try { if (ourProtocolHandle!=NULL) { NdisDeregisterProtocolDriver(ourProtocolHandle); IFDEBUG(DbgPrint("TestDriver: NdisDeregisterProtocolDriver\n")); } } __except(EXCEPTION_EXECUTE_HANDLER) { IFDEBUG(DbgPrint("TestDriver: Exception raised in NdisDeregisterProtocolDriver...\n")); } IFDEBUG(DbgPrint("TestDriver: NdisRegisterProtocolDriver Complete 0x%x\n",NdisStatus)); i=0; __try { while(1) { i++; offset = 0x08; if (ProtocolChain == NULL) { IFDEBUG(DbgPrint("TestDriver: ProtocolChain == NULL 0x%x\n",i)); break; } ProtocolChain = ((CHAR**)(ProtocolChain + offset))[0]; IFDEBUG(DbgPrint("TestDriver: ProtocolName: %ws\n",((NDIS_PROTOCOL_BLOCK_VISTA_SP1*)ProtocolChain)->Name.Buffer)); OpenBlock = ((NDIS_PROTOCOL_BLOCK_VISTA_SP1*)ProtocolChain)->OpenQueue; while(1) { if( OpenBlock == NULL ) { IFDEBUG(DbgPrint("TestDriver: OpenBlock==NULL\n")); break; } MiniportBlock = (PNDIS60_VISTA_SP1_ADAPTER_BLOCK)(OpenBlock->MiniportHandle); while(1) { if( MiniportBlock == NULL ) { IFDEBUG(DbgPrint("TestDriver: MiniportBlock==NULL\n")); break; } IFDEBUG(DbgPrint("TestDriver: MiniportBlock->DeviceName: %ws\n", MiniportBlock->DeviceName.Buffer)); MiniportBlock = (PNDIS60_VISTA_SP1_ADAPTER_BLOCK)(MiniportBlock->NextGlobalAdapter); } OpenBlock = OpenBlock->ProtocolNextOpen; } ProtocolChain = (CHAR*) (((NDIS_PROTOCOL_BLOCK_VISTA_SP1*)ProtocolChain)->NextProtocol); } } __except(EXCEPTION_EXECUTE_HANDLER) { IFDEBUG(DbgPrint("TestDriver: Exception raised in Prot Iterator...\n")); } RtlInitUnicodeString(&DeviceName,L"\\Device\\DriverTest"); RtlInitUnicodeString(&Win32Device,L"\\DosDevices\\DriverTest"); for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) DriverObject->MajorFunction[i] = DriverTestDefaultHandler; DriverObject->MajorFunction[IRP_MJ_CREATE] = DriverTestCreateClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = DriverTestCreateClose; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DeviceControlHandler; DriverObject->DriverUnload = DriverTestUnload; status = IoCreateDevice(DriverObject, 0, &DeviceName, FILE_DEVICE_UNKNOWN, 0, FALSE, &DeviceObject); if (!NT_SUCCESS(status)) return status; if (!DeviceObject) return STATUS_UNEXPECTED_IO_ERROR; DeviceObject->Flags |= DO_DIRECT_IO; DeviceObject->AlignmentRequirement = FILE_WORD_ALIGNMENT; status = IoCreateSymbolicLink(&Win32Device, &DeviceName); DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; return STATUS_SUCCESS; }