locked
unreferend external symbol in visual studio 2017 RRS feed

  • Question

  • #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.

    Thursday, July 12, 2018 5:15 PM

All replies