View Single Post
  #1  
Old 07-21-2024, 03:03
Kurapica's Avatar
Kurapica Kurapica is offline
VIP
 
Join Date: Jun 2009
Location: Archives
Posts: 198
Rept. Given: 20
Rept. Rcvd 144 Times in 43 Posts
Thanks Given: 74
Thanks Rcvd at 426 Times in 90 Posts
Kurapica Reputation: 100-199 Kurapica Reputation: 100-199
nVidia drivers or some other OS issue ?

I would like to ask if anyone has noticed this issue, started this July on some Windows machines.

The using of "EnumDisplayDevices" either Ansi or Unicode versions :

Example code : https://stackoverflow.com/questions/9524309/enumdisplaydevices-function-not-working-for-me
Code:
#include <windows.h>
#include <stdio.h>

#pragma comment(lib, "user32.lib")

void DumpDevice(const DISPLAY_DEVICE& dd, size_t nSpaceCount )
{
    printf("%*sDevice Name: %s\n", nSpaceCount, "", dd.DeviceName );
    printf("%*sDevice String: %s\n", nSpaceCount, "", dd.DeviceString );
    printf("%*sState Flags: %x\n", nSpaceCount, "", dd.StateFlags );
    printf("%*sDeviceID: %s\n", nSpaceCount, "", dd.DeviceID );
    printf("%*sDeviceKey: ...%s\n\n", nSpaceCount, "", dd.DeviceKey+42 );
}

int main()
{
    DISPLAY_DEVICE dd;

    dd.cb = sizeof(DISPLAY_DEVICE);

    DWORD deviceNum = 0;
    while( EnumDisplayDevices(NULL, deviceNum, &dd, 0) ){
        DumpDevice( dd, 0 );
        DISPLAY_DEVICE newdd = {0};
        newdd.cb = sizeof(DISPLAY_DEVICE);
        DWORD monitorNum = 0;
        while ( EnumDisplayDevices(dd.DeviceName, monitorNum, &newdd, 0))
        {
            DumpDevice( newdd, 4 );
            monitorNum++;
        }
        puts("");
        deviceNum++;
    }

    return 0;
}

The problems seems to be related to the drivers or some other recent Windows update, The value of "dd.DeviceString"

will have a random suffix : "NVIDIA GeForce GTX 1060 6GB#0x1e00303a45ed6a6a#"

The expected value is "NVIDIA GeForce GTX 1060 6GB" but it adds this "#0x1e00303a45ed6a6a#" value

which seems to be a formatted memory address or something else, anyway it is not supposed to be there and it is definitely not

related to forgetting to Zero-fill the buffer before calling the API.

This value seems to be added in registry too after a fresh driver install and a Windows reboot.

Anyone noticed this weird issue lately with nVidia or AMD ?
Reply With Quote