views:

32

answers:

0

I've got some code that used to get the interface, now it fails all the time. The dwStatus value is getting set to 2.

if (DeviceIoControl(
          ndisUio_,
          IOCTL_NDISUIO_QUERY_BINDING,
          pQueryBinding,
          sizeof(NDISUIO_QUERY_BINDING),
          Buf,
          dwBufLength,
          &dwBytesWritten,
          NULL)) {

        // Get Device name
        ptcDeviceName = (PTCHAR)((PUCHAR)pQueryBinding + pQueryBinding->DeviceNameOffset); 
        DWORD dwStatus;
        DWORD dwOidFlags;

        memset(&intfEntry_, 0, sizeof(intfEntry_));
        intfEntry_.wszGuid = ptcDeviceName ;

        dwStatus = WZCQueryInterface(NULL, INTF_ALL, &intfEntry_, &dwOidFlags);

        if (dwStatus == ERROR_SUCCESS) return true;//all is right in the world
        else return false; //something was not good. 
}