#ifndef NVAPI_MINIMAL_H1#define NVAPI_MINIMAL_H2typedef uint32_t NvU32;3typedef uint16_t NvU16;4typedef uint8_t NvU8;56#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))78#define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name910NV_DECLARE_HANDLE(NvDRSSessionHandle);11NV_DECLARE_HANDLE(NvDRSProfileHandle);1213#define NVAPI_UNICODE_STRING_MAX 204814#define NVAPI_BINARY_DATA_MAX 409615typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];16typedef char NvAPI_ShortString[64];1718#define NVAPI_SETTING_MAX_VALUES 1001920typedef enum _NVDRS_SETTING_TYPE21{22NVDRS_DWORD_TYPE,23NVDRS_BINARY_TYPE,24NVDRS_STRING_TYPE,25NVDRS_WSTRING_TYPE26} NVDRS_SETTING_TYPE;2728typedef enum _NVDRS_SETTING_LOCATION29{30NVDRS_CURRENT_PROFILE_LOCATION,31NVDRS_GLOBAL_PROFILE_LOCATION,32NVDRS_BASE_PROFILE_LOCATION,33NVDRS_DEFAULT_PROFILE_LOCATION34} NVDRS_SETTING_LOCATION;3536typedef struct _NVDRS_GPU_SUPPORT37{38NvU32 geforce : 1;39NvU32 quadro : 1;40NvU32 nvs : 1;41NvU32 reserved4 : 1;42NvU32 reserved5 : 1;43NvU32 reserved6 : 1;44NvU32 reserved7 : 1;45NvU32 reserved8 : 1;46NvU32 reserved9 : 1;47NvU32 reserved10 : 1;48NvU32 reserved11 : 1;49NvU32 reserved12 : 1;50NvU32 reserved13 : 1;51NvU32 reserved14 : 1;52NvU32 reserved15 : 1;53NvU32 reserved16 : 1;54NvU32 reserved17 : 1;55NvU32 reserved18 : 1;56NvU32 reserved19 : 1;57NvU32 reserved20 : 1;58NvU32 reserved21 : 1;59NvU32 reserved22 : 1;60NvU32 reserved23 : 1;61NvU32 reserved24 : 1;62NvU32 reserved25 : 1;63NvU32 reserved26 : 1;64NvU32 reserved27 : 1;65NvU32 reserved28 : 1;66NvU32 reserved29 : 1;67NvU32 reserved30 : 1;68NvU32 reserved31 : 1;69NvU32 reserved32 : 1;70} NVDRS_GPU_SUPPORT;7172//! Enum to decide on the datatype of setting value.73typedef struct _NVDRS_BINARY_SETTING74{75NvU32 valueLength; //!< valueLength should always be in number of bytes.76NvU8 valueData[NVAPI_BINARY_DATA_MAX];77} NVDRS_BINARY_SETTING;7879typedef struct _NVDRS_SETTING_VALUES80{81NvU32 version; //!< Structure Version82NvU32 numSettingValues; //!< Total number of values available in a setting.83NVDRS_SETTING_TYPE settingType; //!< Type of setting value.84union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.85{86NvU32 u32DefaultValue; //!< Accessing default DWORD value of this setting.87NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting.88//!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in.89NvAPI_UnicodeString wszDefaultValue; //!< Accessing default unicode string value of this setting.90};91union //!< Setting values can be of either DWORD, Binary values or String type,92{ //!< NOT mixed types.93NvU32 u32Value; //!< All possible DWORD values for a setting94NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting95NvAPI_UnicodeString wszValue; //!< Accessing current unicode string value of this setting.96}settingValues[NVAPI_SETTING_MAX_VALUES];97} NVDRS_SETTING_VALUES;9899//! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES100#define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1)101102typedef struct _NVDRS_SETTING_V1103{104NvU32 version; //!< Structure Version105NvAPI_UnicodeString settingName; //!< String name of setting106NvU32 settingId; //!< 32 bit setting Id107NVDRS_SETTING_TYPE settingType; //!< Type of setting value.108NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from.109NvU32 isCurrentPredefined; //!< It is different than 0 if the currentValue is a predefined Value,110//!< 0 if the currentValue is a user value.111NvU32 isPredefinedValid; //!< It is different than 0 if the PredefinedValue union contains a valid value.112union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.113{114NvU32 u32PredefinedValue; //!< Accessing default DWORD value of this setting.115NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting.116//!< Must be allocated by caller with valueLength specifying buffer size,117//!< or only valueLength will be filled in.118NvAPI_UnicodeString wszPredefinedValue; //!< Accessing default unicode string value of this setting.119};120union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.121{122NvU32 u32CurrentValue; //!< Accessing current DWORD value of this setting.123NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting.124//!< Must be allocated by caller with valueLength specifying buffer size,125//!< or only valueLength will be filled in.126NvAPI_UnicodeString wszCurrentValue; //!< Accessing current unicode string value of this setting.127};128} NVDRS_SETTING_V1;129130//! Macro for constructing the version field of ::_NVDRS_SETTING131#define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1)132133typedef NVDRS_SETTING_V1 NVDRS_SETTING;134#define NVDRS_SETTING_VER NVDRS_SETTING_VER1135136typedef struct _NVDRS_APPLICATION_V4137{138NvU32 version; //!< Structure Version139NvU32 isPredefined; //!< Is the application userdefined/predefined140NvAPI_UnicodeString appName; //!< String name of the Application141NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application142NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application143NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found.144//!< When specifying multiple files, separate them using the ':' character.145NvU32 isMetro:1; //!< Windows 8 style app146NvU32 isCommandLine:1; //!< Command line parsing for the application name147NvU32 reserved:30; //!< Reserved. Should be 0.148NvAPI_UnicodeString commandLine; //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1149//!< this contains application's command line as if it was returned by GetCommandLineW.150} NVDRS_APPLICATION_V4;151152#define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4,4)153154typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION;155#define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4156157typedef struct _NVDRS_PROFILE_V1158{159NvU32 version; //!< Structure Version160NvAPI_UnicodeString profileName; //!< String name of the Profile161NVDRS_GPU_SUPPORT gpuSupport; //!< This read-only flag indicates the profile support on either162//!< Quadro, or Geforce, or both.163NvU32 isPredefined; //!< Is the Profile user-defined, or predefined164NvU32 numOfApps; //!< Total number of applications that belong to this profile. Read-only165NvU32 numOfSettings; //!< Total number of settings applied for this Profile. Read-only166} NVDRS_PROFILE_V1;167168typedef NVDRS_PROFILE_V1 NVDRS_PROFILE;169170//! Macro for constructing the version field of ::NVDRS_PROFILE171#define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1,1)172#define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1173174#endif175176177