Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

OSR Seminars


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 8  
12 Jul 18 13:40
singania
xxxxxx@outlook.com
Join Date: 12 Jul 2018
Posts To This List: 7
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

#include "Miniport.h" DRIVEREXTN DriverExtn; NDIS_HANDLE Handle; NDIS_STATUS DriverEntry( _In_ PVOID DriverObject, _In_ PVOID RegistryPath ) { NDIS_STATUS Status = NDIS_STATUS_SUCCESS; NDIS_MINIPORT_DRIVER_CHARACTERISTICS MPChar; NdisZeroMemory(&MPChar, sizeof(MPChar)); MPChar.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS; MPChar.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3; MPChar.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3; MPChar.MajorNdisVersion = NDIS_MAJOR_VERSION; MPChar.MinorNdisVersion = NDIS_MINOR_VERSION; MPChar.MajorDriverVersion = MAJOR_DRIVER_VERSION; MPChar.MinorDriverVersion = MINOR_DRIVER_VERISON; MPChar.Flags = 0; #if 0 MPChar.SetOptionsHandler = NULL; MPChar.InitializeHandlerEx = MPInitializeEx; MPChar.HaltHandlerEx = MPHaltEx; MPChar.UnloadHandler = DriverUnload; MPChar.PauseHandler = MPPause; MPChar.RestartHandler = MPRestart; MPChar.OidRequestHandler = MPOidRequest; MPChar.SendNetBufferListsHandler = MPSendNetBufferLists; MPChar.ReturnNetBufferListsHandler = MPReturnNetBufferLists; MPChar.CancelSendHandler = MPCancelSend; MPChar.CheckForHangHandlerEx = NULL; MPChar.ResetHandlerEx = NULL; MPChar.DevicePnPEventNotifyHandler = MPDevicePnpEventNotify; MPChar.ShutdownHandlerEx = MPShutdownEx; MPChar.CancelOidRequestHandler = MPCancelOidRequest; MPChar.SynchronousOidRequestHandler = MPSynchronousOidRequest; #endif Status = NdisMRegisterMiniportDriver(DriverObject, RegistryPath, &DriverExtn, &MPChar, &Handle); if (Status != NDIS_STATUS_SUCCESS) { DriverUnload(DriverObject); return Status; } DriverExtn.Flags |= NDIS_REGISTER_SUCCESS; return Status; } VOID DriverUnload( _In_ PDRIVER_OBJECT DriverObject ) { UNREFERENCED_PARAMETER(DriverObject); if (DriverExtn.Flags & NDIS_REGISTER_SUCCESS) { NdisMDeregisterMiniportDriver(Handle); } } Compilation on visual studio 2017(professional) throws linker error Error LNK2019 unresolved external symbol NdisMRegisterMiniportDriver referenced in function DriverEntry Error LNK2019 unresolved external symbol NdisMDeregisterMiniportDriver referenced in function DriverUnload Error LNK1120 2 unresolved externals Miniport Using WDK10 and ndis.h is included in Miniport.h. What could be the issue?Any helpful information is much appreciated.
  Message 2 of 8  
12 Jul 18 13:59
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10220
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

Are you linking against ndis.lib? -----Original Message----- From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> On Behalf Of xxxxx@outlook.com Sent: Thursday, July 12, 2018 10:40 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: [ntdev] unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017 #include "Miniport.h" DRIVEREXTN DriverExtn; NDIS_HANDLE Handle; NDIS_STATUS DriverEntry( _In_ PVOID DriverObject, _In_ PVOID RegistryPath ) { NDIS_STATUS Status = NDIS_STATUS_SUCCESS; NDIS_MINIPORT_DRIVER_CHARACTERISTICS MPChar; NdisZeroMemory(&MPChar, sizeof(MPChar)); MPChar.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS; MPChar.Header.Size = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3; MPChar.Header.Revision = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_3; MPChar.MajorNdisVersion = NDIS_MAJOR_VERSION; MPChar.MinorNdisVersion = NDIS_MINOR_VERSION; MPChar.MajorDriverVersion = MAJOR_DRIVER_VERSION; MPChar.MinorDriverVersion = MINOR_DRIVER_VERISON; MPChar.Flags = 0; #if 0 MPChar.SetOptionsHandler = NULL; MPChar.InitializeHandlerEx = MPInitializeEx; MPChar.HaltHandlerEx = MPHaltEx; MPChar.UnloadHandler = DriverUnload; MPChar.PauseHandler = MPPause; MPChar.RestartHandler = MPRestart; MPChar.OidRequestHandler = MPOidRequest; MPChar.SendNetBufferListsHandler = MPSendNetBufferLists; MPChar.ReturnNetBufferListsHandler = MPReturnNetBufferLists; MPChar.CancelSendHandler = MPCancelSend; MPChar.CheckForHangHandlerEx = NULL; MPChar.ResetHandlerEx = NULL; MPChar.DevicePnPEventNotifyHandler = MPDevicePnpEventNotify; MPChar.ShutdownHandlerEx = MPShutdownEx; MPChar.CancelOidRequestHandler = MPCancelOidRequest; MPChar.SynchronousOidRequestHandler = MPSynchronousOidRequest; #endif Status = NdisMRegisterMiniportDriver(DriverObject, RegistryPath, &DriverExtn, &MPChar, &Handle); if (Status != NDIS_STATUS_SUCCESS) { DriverUnload(DriverObject); return Status; } DriverExtn.Flags |= NDIS_REGISTER_SUCCESS; return Status; } VOID DriverUnload( _In_ PDRIVER_OBJECT DriverObject ) { UNREFERENCED_PARAMETER(DriverObject); if (DriverExtn.Flags & NDIS_REGISTER_SUCCESS) { NdisMDeregisterMiniportDriver(Handle); } } Compilation on visual studio 2017(professional) throws linker error Error LNK2019 unresolved external symbol NdisMRegisterMiniportDriver referenced in function DriverEntry Error LNK2019 unresolved external symbol NdisMDeregisterMiniportDriver referenced in function DriverUnload Error LNK1120 2 unresolved externals Miniport Using WDK10 and ndis.h is included in Miniport.h. What could be the issue?Any helpful information is much appreciated. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&amp;data=3D02%7C01%7CDoron.Holan%40microsoft.com %7C123baa3132c745a169c608d5e81e708d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C 636670139795788974&amp;sdata=3Dgjo4jQf8vWxdookTBWrGoYDEmooRV%2BAkrDucWLd%2F30E%3D &amp;reserved=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&amp;data=02%7C01%7CDoron.Holan%40microsoft.com%7C123baa3132c745a169c608d5e 81e708d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636670139795788974&amp;sdata =lOWHmYNrboeXrEV%2FVqBpHLmW58Awbp9FYK8O2dpaHe4%3D&amp;reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&amp;data=02%7C01%7CDoron.Holan%40microsoft.com%7 C123baa3132c745a169c608d5e81e708d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 6670139795788974&amp;sdata=7rIgWPQpcbZ0FTdUIUy0hFQAZTX7Q1w%2BFEXk%2FE0boTI%3D&amp ;reserved=0>
  Message 3 of 8  
12 Jul 18 23:30
singania
xxxxxx@outlook.com
Join Date: 12 Jul 2018
Posts To This List: 7
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

Won't the ndis.lib be part of winddk 10 integrated with the visual studio?
  Message 4 of 8  
13 Jul 18 00:01
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10220
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

Yes, but it is not on the linker command line by default. -----Original Message----- From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> On Behalf Of xxxxx@outlook.com Sent: Thursday, July 12, 2018 8:30 PM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: RE:[ntdev] unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017 Won't the ndis.lib be part of winddk 10 integrated with the visual studio?=20 --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&amp;data=3D02%7C01%7CDoron.Holan%40microsoft.com %7Cbb0464b1192d404f703708d5e870e4d4%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C 636670493927247702&amp;sdata=3Dt8sV2jEsD1OIGDc%2FKTqILNKzd0kJQzaSlBvc5kBc8ZM%3D&a mp;reserved=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&amp;data=02%7C01%7CDoron.Holan%40microsoft.com%7Cbb0464b1192d404f703708d5e 870e4d4%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636670493927247702&amp;sdata =Wufv1UiMQOv0kPQtZ7ITRRxCioMZgYg%2FpZnDPGTgMmg%3D&amp;reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&amp;data=02%7C01%7CDoron.Holan%40microsoft.com%7 Cbb0464b1192d404f703708d5e870e4d4%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 6670493927247702&amp;sdata=7cdoNd8NHNMMYzndLIe9%2BTSW5El%2BVC%2BpA4r%2BWwNaP00%3D &amp;reserved=0>
  Message 5 of 8  
13 Jul 18 02:54
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 12008
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

On Jul 12, 2018, at 8:29 PM, xxxxx@outlook.com <xxxxx@lists.osr.com> wrote: > > Won't the ndis.lib be part of winddk 10 integrated with the visual studio? Are you clear on the differences between ndis.h and ndis.lib, in how they are used and how they are located? ??? Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 6 of 8  
13 Jul 18 04:25
singania
xxxxxx@outlook.com
Join Date: 12 Jul 2018
Posts To This List: 7
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

Thanks Doron. Adding dependency manually worked.
  Message 7 of 8  
13 Jul 18 04:28
singania
xxxxxx@outlook.com
Join Date: 12 Jul 2018
Posts To This List: 7
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

Tim, All the libs are part of wdk and it is integrated with visual studio. I presumed, the IDE will be able to link it automatically during compile.
  Message 8 of 8  
13 Jul 18 14:45
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 12008
unreferend external symbol NdisMRegisterMiniportDriver in visual studio 2017

xxxxx@outlook.com wrote: > All the libs are part of wdk and it is integrated with visual studio. I presumed, the IDE will be able to link it automatically during compile. Yes, but just like you have to use #include to tell the compiler which include files you need, you have to use linker directives to tell the linker which libraries you need. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 19:28.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license