Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8400501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:34:28+00:00 2026-06-09T21:34:28+00:00

When using the NVAPI I’m having problems with NvAPI_DISP_GetDisplayConfig. I get an AppCrash on

  • 0

When using the NVAPI I’m having problems with NvAPI_DISP_GetDisplayConfig. I get an AppCrash on the second call to NvAPI_DISP_GetDisplayConfig.
Can’t seem to figure out why.

NvU32 count = 0;
status = NvAPI_DISP_GetDisplayConfig(&count, NULL);
if (status != NVAPI_OK) 
    PrintError(status);
printf("Configs: %i\n", count);
NV_DISPLAYCONFIG_PATH_INFO *configinfos = new NV_DISPLAYCONFIG_PATH_INFO[count];
configinfos[0].version = NV_DISPLAYCONFIG_PATH_INFO_VER;
status = NvAPI_DISP_GetDisplayConfig(&count, configinfos);
if (status != NVAPI_OK) 
    PrintError(status);

On my system, count = 2 after the first call.
The notes on NvAPI_DISP_GetDisplayConfig say:

NVAPI_INTERFACE
NvAPI_DISP_GetDisplayConfig(
__inout NvU32 * pathInfoCount,
__out_ecount_full_opt *pathInfoCount NV_DISPLAYCONFIG_PATH_INFO * pathInfo
)

DESCRIPTION: This API lets caller retrieve the current global display
configuration.
USAGE: The caller might have to call this three times to fetch all the required
configuration details as follows:
First Pass: Caller should Call NvAPI_DISP_GetDisplayConfig() with pathInfo set
to NULL to fetch pathInfoCount.
Second Pass: Allocate memory for pathInfo with respect to the number of
pathInfoCount(from First Pass) to fetch //! //! targetInfoCount. If
sourceModeInfo is needed allocate memory or it can be initialized to NULL.
Third Pass(Optional, only required if target information is required): Allocate
memory for targetInfo with respect to number of
targetInfoCount(from Second Pass). SUPPORTED OS: Windows Vista and higher

Thanks.

Edit: I’ve also tried to set configinfos[0].sourceModeInfo = NULL to no avail. I’ve also tried to iterate over the array to set all .version and .sourceModeInfo to no avail (an example in the docs I saw only set version on the first item in the array)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:34:29+00:00Added an answer on June 9, 2026 at 9:34 pm

    This should work for you:

    NvAPI_Status status = NVAPI_OK;
    NvU32 deviceCount = 0;
    NV_DISPLAYCONFIG_PATH_INFO_V2 *  pathInfo = NULL;
    
    status = NvAPI_Initialize();
    if (status == NVAPI_OK) {
        status = NvAPI_DISP_GetDisplayConfig(&deviceCount, pathInfo);
        if ((status == NVAPI_OK) && (deviceCount > 0)) {
            pathInfo = new NV_DISPLAYCONFIG_PATH_INFO_V2[deviceCount];
            for (int i = 0; i < deviceCount; i++)
            {
                pathInfo[i].targetInfo = 0;
                pathInfo[i].targetInfoCount = 0;
                pathInfo[i].version = NV_DISPLAYCONFIG_PATH_INFO_VER2;
                pathInfo[i].sourceModeInfo = 0;
                pathInfo[i].reserved = 0;
            }
    
            status = NvAPI_DISP_GetDisplayConfig(&deviceCount, pathInfo);
    
            if (status == NVAPI_OK) {
                for (int i = 0; i < deviceCount; i++)
                {
                    pathInfo[i].sourceModeInfo = new NV_DISPLAYCONFIG_SOURCE_MODE_INFO_V1;
                    pathInfo[i].sourceModeInfo->reserved = 0;
                    pathInfo[i].targetInfo = new NV_DISPLAYCONFIG_PATH_TARGET_INFO_V2[pathInfo[i].targetInfoCount];
                    for (int j = 0; j < pathInfo[i].targetInfoCount; j++) {
                        pathInfo[i].targetInfo[j].details = 0;
                    }
                }
            }
    
            status = NvAPI_DISP_GetDisplayConfig(&deviceCount, pathInfo);
    
            for (int i = 0; i < deviceCount; i++)
            {
                if (pathInfo[i].sourceModeInfo) delete pathInfo[i].sourceModeInfo;
                if (pathInfo[i].targetInfo) delete [] pathInfo[i].targetInfo;
            }
            delete[] pathInfo;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using the Redis info command, I am able to get all the stats of
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
Can anybody show me simple working example using Qt(export DLL plugin file) and make
From what I gather, Google Chrome can run browser plugins written using NPAPI .
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.