NVAPI Reference Documentation
NVIDIA
Release 384: June 27
2017

General NVAPI Functions

Functions

NVAPI_INTERFACE NvAPI_Initialize ()
 
NVAPI_INTERFACE NvAPI_Unload ()
 
NVAPI_INTERFACE NvAPI_GetErrorMessage (NvAPI_Status nr, NvAPI_ShortString szDesc)
 
NVAPI_INTERFACE NvAPI_GetInterfaceVersionString (NvAPI_ShortString szDesc)
 

Detailed Description

Function Documentation

NVAPI_INTERFACE NvAPI_GetErrorMessage ( NvAPI_Status  nr,
NvAPI_ShortString  szDesc 
)

This function converts an NvAPI error code into a null terminated string.

SUPPORTED OS: Windows XP and higher

Since
Release: 80
Parameters
nrThe error code to convert
szDescThe string corresponding to the error code
Returns
NULL terminated string (always, never NULL)
NVAPI_INTERFACE NvAPI_GetInterfaceVersionString ( NvAPI_ShortString  szDesc)

This function returns a string describing the version of the NvAPI library. The contents of the string are human readable. Do not assume a fixed format.

SUPPORTED OS: Windows XP and higher

Since
Release: 80
Parameters
szDescUser readable string giving NvAPI version information
Returns
See NvAPI Status Values for the list of possible return values.
NVAPI_INTERFACE NvAPI_Initialize ( )

This function initializes the NvAPI library (if not already initialized) but always increments the ref-counter. This must be called before calling other NvAPI_ functions.

SUPPORTED OS: Windows XP and higher

Since
Release: 80
Return values
NVAPI_ERRORAn error occurred during the initialization process (generic error)
NVAPI_LIBRARYNOTFOUNDFailed to load the NVAPI support library
NVAPI_OKInitialized
See also
NvAPI Status Values
NVAPI_INTERFACE NvAPI_Unload ( )

DESCRIPTION: Decrements the ref-counter and when it reaches ZERO, unloads NVAPI library. This must be called in pairs with NvAPI_Initialize.

SUPPORTED OS: Windows XP and higher

Note: By design, it is not mandatory to call NvAPI_Initialize before calling any NvAPI. When any NvAPI is called without first calling NvAPI_Initialize, the internal refcounter will be implicitly incremented. In such cases, calling NvAPI_Initialize from a different thread will result in incrementing the refcount again and the user has to call NvAPI_Unload twice to unload the library. However, note that the implicit increment of the refcounter happens only once. If the client wants unload functionality, it is recommended to always call NvAPI_Initialize and NvAPI_Unload in pairs.

Unloading NvAPI library is not supported when the library is in a resource locked state. Some functions in the NvAPI library initiates an operation or allocates certain resources and there are corresponding functions available, to complete the operation or free the allocated resources. All such function pairs are designed to prevent unloading NvAPI library.

For example, if NvAPI_Unload is called after NvAPI_XXX which locks a resource, it fails with NVAPI_ERROR. Developers need to call the corresponding NvAPI_YYY to unlock the resources, before calling NvAPI_Unload again.

Return values
NVAPI_ERROROne or more resources are locked and hence cannot unload NVAPI library
NVAPI_OKNVAPI library unloaded
NVAPI_API_IN_USEAt least one API is still being called; hence the driver cannot unload NVAPI library from process


Copyright (c) 2007-2017 NVIDIA Corporation. All rights reserved.

NVIDIA