Dummy NDIS Miniport Revisited - Help on Installation

Hello,

This message may seem repeated as dummy NDIS miniport has been already discussed sometime ago. While digging the archives, I found one INF file for a miniport sample (from Hassan). I have a similar situation where I have a virtual miniport driver, meant to transport data later to Bluetooth devices. As of now, I am not dealing with the packet transfer but just want to make the skeleton NDIS driver working in terms of installation. I have tried the INF file listed by Hassan, by changing the binary names appropriately.

I have tried many times to get a successful installation of the dummy/virtual adapter, but to no avail so far. Could someone give me a guideline how I can achieve a successful installation?

The driver entry routine for my driver is given below for reference, should this be useful.

NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath )
{
NDIS_MINIPORT_CHARACTERISTICS characteristics;
NTSTATUS ulNtStatus = STATUS_SUCCESS;

DBG_PRINT(( DRIVERNAME “==>DriverEntry\n” ));

// initialize global variables

// Save the name of the service key

RtlCopyUnicodeString(&servkey, RegistryPath);

//
// Initialise the NDIS wrapper.
//

NdisMInitializeWrapper(&g_hBtNdisWrapperHandle, DriverObject, RegistryPath, NULL);

//
// Set up the characteristics table for the intermediate driver.
//

NdisZeroMemory(&characteristics, sizeof(NDIS_MINIPORT_CHARACTERISTICS));

characteristics.MajorNdisVersion = 3;
characteristics.MinorNdisVersion = 0;

characteristics.InitializeHandler = BtNdisInitialize;
characteristics.QueryInformationHandler = BtNdisQueryInformation;
characteristics.SetInformationHandler = BtNdisSetInformation;
characteristics.ResetHandler = BtNdisReset;
characteristics.TransferDataHandler = BtNdisTransferData;
characteristics.HaltHandler = BtNdisHalt;
characteristics.CheckForHangHandler = BtNdisCheckForHang;
characteristics.SendHandler = BtNdisSend;


// Register the intermediate driver with NDIS.
//
ulNtStatus =
NdisMRegisterMiniport(
g_hBtNdisWrapperHandle,
&characteristics,
sizeof(characteristics)
);

done:

// on failure, must call explicitly to do cleanup
if( !NT_SUCCESS( ulNtStatus ) )
NdisTerminateWrapper(g_hBtNdisWrapperHandle, NULL);

DBG_PRINT((DRIVERNAME “<==DriverEntry (NtStatus %#x)\n”, ulNtStatus ));

return ulNtStatus;
}

The INF file is also listed below:
(From original mail - Hassan)

----------------------------- BEGIN INF FILE ----------------------------

[version]
Signature = “$Chicago$”
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %TMT%
Compatible = 1
DriverVer = 03/11/2001,3.00.00.2001

[Manufacturer]
%Manufacturer%=Philips

[Philips]
; DisplayName Section DeviceID
; ----------- ------- --------
%TMPCI.DeviceDesc% = TMPCI.ndi, “TMPCI”
; TriMedia IREF Card

[TMPCI.ndi]
AddReg= TMPCI.id.reg, TMPCIFlags.reg, tmpci.reg, params.reg, TMPCI.ndi.reg

; Windows NT specific entry
[TMPCI.ndi.NT]
Characteristics = 0x81; NCF_VIRTUAL, NCF_HAS_UI
AddReg = TMPCI.id.reg, TMPCIFlags.reg, tmpci.reg, params.reg, TMPCI.ndi.reg
CopyFiles = tmpci.CopyFiles

[TMPCI.ndi.NT.Services]
AddService = TMPCI, 2, TMPCI.Service, common.EventLog

[TMPCI.id.reg]
HKR,Ndi,DeviceID,“MYTMPCI”

[TMPCIFlags.reg]
HKR, Ndi\params\MapRegisters, flag, 1, 20,00,00,00

[tmpci.reg]
HKR, Ndi, Service, 0, “TMPCI”
; use ndis5 as the upper bound because NT supports it
HKR, Ndi\Interfaces, UpperRange, 0, “ndis5”
HKR, Ndi\Interfaces, LowerRange, 0, “ethernet”

[tmpci.Service]
DisplayName = %tmpci.Service.DispName%
ServiceType = 1 ;%SERVICE_KERNEL_DRIVER%
StartType = 3 ;%SERVICE_DEMAND_START%
ErrorControl = 1 ;%SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\tmpci.sys
LoadOrderGroup = NDIS

[common.EventLog]
AddReg = common.AddEventLog.reg

[common.AddEventLog.reg]
HKR, , EventMessageFile, 0x00020000, “%%SystemRoot%%\System32\netevent.dll”
HKR, , TypesSupported, 0x00010001, 7

;-----------------------------------------------------------------------------
; DestinationDirs
;
[tmpci.CopyFiles]
tmpci.sys,2

[SourceDisksNames]
;
; diskid = description[, [tagfile] [, , subdir]]
;
1 = “TriMedia Driver Disk 1”,

[SourceDisksFiles]
;
; filename_on_source = diskID[, [subdir][, size]]
;
tmpci.sys = 1, ; on distribution disk 1

[DestinationDirs]
tmpci.CopyFiles = 12
DefaultDestDirs = 11

[Strings]
TMT = “TriMedia Technologies, Inc”
TMPCI.DeviceDesc = “My Virtual Net Adapter”
----------------------------- END INF FILE ----------------------------

Hope to get some feedback soon.

Thanks,

Jayanta

Dummy NDIS Miniport Revisited - Help on InstallationHave you looked at the NETVMINI sample in the Windows Server 2003 DDK?

Thomas F. Divine
http://www.rawether.net

“Konjengbam J. Singh” wrote in message news:xxxxx@ntdev…
Hello,

This message may seem repeated as dummy NDIS miniport has been already discussed sometime ago. While digging the archives, I found one INF file for a miniport sample (from Hassan). I have a similar situation where I have a virtual miniport driver, meant to transport data later to Bluetooth devices. As of now, I am not dealing with the packet transfer but just want to make the skeleton NDIS driver working in terms of installation. I have tried the INF file listed by Hassan, by changing the binary names appropriately.

I have tried many times to get a successful installation of the dummy/virtual adapter, but to no avail so far. Could someone give me a guideline how I can achieve a successful installation?

The driver entry routine for my driver is given below for reference, should this be useful.

NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath )
{
NDIS_MINIPORT_CHARACTERISTICS characteristics;
NTSTATUS ulNtStatus = STATUS_SUCCESS;

DBG_PRINT(( DRIVERNAME “==>DriverEntry\n” ));

// initialize global variables

// Save the name of the service key

RtlCopyUnicodeString(&servkey, RegistryPath);

//
// Initialise the NDIS wrapper.
//

NdisMInitializeWrapper(&g_hBtNdisWrapperHandle, DriverObject, RegistryPath, NULL);

//
// Set up the characteristics table for the intermediate driver.
//

NdisZeroMemory(&characteristics, sizeof(NDIS_MINIPORT_CHARACTERISTICS));

characteristics.MajorNdisVersion = 3;
characteristics.MinorNdisVersion = 0;

characteristics.InitializeHandler = BtNdisInitialize;
characteristics.QueryInformationHandler = BtNdisQueryInformation;
characteristics.SetInformationHandler = BtNdisSetInformation;
characteristics.ResetHandler = BtNdisReset;
characteristics.TransferDataHandler = BtNdisTransferData;
characteristics.HaltHandler = BtNdisHalt;
characteristics.CheckForHangHandler = BtNdisCheckForHang;
characteristics.SendHandler = BtNdisSend;


// Register the intermediate driver with NDIS.
//
ulNtStatus =
NdisMRegisterMiniport(
g_hBtNdisWrapperHandle,
&characteristics,
sizeof(characteristics)
);

done:

// on failure, must call explicitly to do cleanup
if( !NT_SUCCESS( ulNtStatus ) )
NdisTerminateWrapper(g_hBtNdisWrapperHandle, NULL);

DBG_PRINT((DRIVERNAME “<==DriverEntry (NtStatus %#x)\n”, ulNtStatus ));

return ulNtStatus;
}

The INF file is also listed below:
(From original mail - Hassan)

----------------------------- BEGIN INF FILE ----------------------------

[version]
Signature = “$Chicago$”
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %TMT%
Compatible = 1
DriverVer = 03/11/2001,3.00.00.2001

[Manufacturer]
%Manufacturer%=Philips

[Philips]
; DisplayName Section DeviceID
; ----------- ------- --------
%TMPCI.DeviceDesc% = TMPCI.ndi, “TMPCI”
; TriMedia IREF Card

[TMPCI.ndi]
AddReg= TMPCI.id.reg, TMPCIFlags.reg, tmpci.reg, params.reg, TMPCI.ndi.reg

; Windows NT specific entry
[TMPCI.ndi.NT]
Characteristics = 0x81; NCF_VIRTUAL, NCF_HAS_UI
AddReg = TMPCI.id.reg, TMPCIFlags.reg, tmpci.reg, params.reg, TMPCI.ndi.reg
CopyFiles = tmpci.CopyFiles

[TMPCI.ndi.NT.Services]
AddService = TMPCI, 2, TMPCI.Service, common.EventLog

[TMPCI.id.reg]
HKR,Ndi,DeviceID,“MYTMPCI”

[TMPCIFlags.reg]
HKR, Ndi\params\MapRegisters, flag, 1, 20,00,00,00

[tmpci.reg]
HKR, Ndi, Service, 0, “TMPCI”
; use ndis5 as the upper bound because NT supports it
HKR, Ndi\Interfaces, UpperRange, 0, “ndis5”
HKR, Ndi\Interfaces, LowerRange, 0, “ethernet”

[tmpci.Service]
DisplayName = %tmpci.Service.DispName%
ServiceType = 1 ;%SERVICE_KERNEL_DRIVER%
StartType = 3 ;%SERVICE_DEMAND_START%
ErrorControl = 1 ;%SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\tmpci.sys
LoadOrderGroup = NDIS

[common.EventLog]
AddReg = common.AddEventLog.reg

[common.AddEventLog.reg]
HKR, , EventMessageFile, 0x00020000, “%%SystemRoot%%\System32\netevent.dll”
HKR, , TypesSupported, 0x00010001, 7

;-----------------------------------------------------------------------------
; DestinationDirs
;
[tmpci.CopyFiles]
tmpci.sys,2

[SourceDisksNames]
;
; diskid = description[, [tagfile] [, , subdir]]
;
1 = “TriMedia Driver Disk 1”,

[SourceDisksFiles]
;
; filename_on_source = diskID[, [subdir][, size]]
;
tmpci.sys = 1, ; on distribution disk 1

[DestinationDirs]
tmpci.CopyFiles = 12
DefaultDestDirs = 11

[Strings]
TMT = “TriMedia Technologies, Inc”
TMPCI.DeviceDesc = “My Virtual Net Adapter”
----------------------------- END INF FILE ----------------------------

Hope to get some feedback soon.

Thanks,

Jayanta