nvapi_minimal.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #ifndef NVAPI_MINIMAL_H
  2. #define NVAPI_MINIMAL_H
  3. typedef uint32_t NvU32;
  4. typedef uint16_t NvU16;
  5. typedef uint8_t NvU8;
  6. #define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
  7. #define NV_DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name
  8. NV_DECLARE_HANDLE(NvDRSSessionHandle);
  9. NV_DECLARE_HANDLE(NvDRSProfileHandle);
  10. #define NVAPI_UNICODE_STRING_MAX 2048
  11. #define NVAPI_BINARY_DATA_MAX 4096
  12. typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];
  13. typedef char NvAPI_ShortString[64];
  14. #define NVAPI_SETTING_MAX_VALUES 100
  15. typedef enum _NVDRS_SETTING_TYPE
  16. {
  17. NVDRS_DWORD_TYPE,
  18. NVDRS_BINARY_TYPE,
  19. NVDRS_STRING_TYPE,
  20. NVDRS_WSTRING_TYPE
  21. } NVDRS_SETTING_TYPE;
  22. typedef enum _NVDRS_SETTING_LOCATION
  23. {
  24. NVDRS_CURRENT_PROFILE_LOCATION,
  25. NVDRS_GLOBAL_PROFILE_LOCATION,
  26. NVDRS_BASE_PROFILE_LOCATION,
  27. NVDRS_DEFAULT_PROFILE_LOCATION
  28. } NVDRS_SETTING_LOCATION;
  29. typedef struct _NVDRS_GPU_SUPPORT
  30. {
  31. NvU32 geforce : 1;
  32. NvU32 quadro : 1;
  33. NvU32 nvs : 1;
  34. NvU32 reserved4 : 1;
  35. NvU32 reserved5 : 1;
  36. NvU32 reserved6 : 1;
  37. NvU32 reserved7 : 1;
  38. NvU32 reserved8 : 1;
  39. NvU32 reserved9 : 1;
  40. NvU32 reserved10 : 1;
  41. NvU32 reserved11 : 1;
  42. NvU32 reserved12 : 1;
  43. NvU32 reserved13 : 1;
  44. NvU32 reserved14 : 1;
  45. NvU32 reserved15 : 1;
  46. NvU32 reserved16 : 1;
  47. NvU32 reserved17 : 1;
  48. NvU32 reserved18 : 1;
  49. NvU32 reserved19 : 1;
  50. NvU32 reserved20 : 1;
  51. NvU32 reserved21 : 1;
  52. NvU32 reserved22 : 1;
  53. NvU32 reserved23 : 1;
  54. NvU32 reserved24 : 1;
  55. NvU32 reserved25 : 1;
  56. NvU32 reserved26 : 1;
  57. NvU32 reserved27 : 1;
  58. NvU32 reserved28 : 1;
  59. NvU32 reserved29 : 1;
  60. NvU32 reserved30 : 1;
  61. NvU32 reserved31 : 1;
  62. NvU32 reserved32 : 1;
  63. } NVDRS_GPU_SUPPORT;
  64. //! Enum to decide on the datatype of setting value.
  65. typedef struct _NVDRS_BINARY_SETTING
  66. {
  67. NvU32 valueLength; //!< valueLength should always be in number of bytes.
  68. NvU8 valueData[NVAPI_BINARY_DATA_MAX];
  69. } NVDRS_BINARY_SETTING;
  70. typedef struct _NVDRS_SETTING_VALUES
  71. {
  72. NvU32 version; //!< Structure Version
  73. NvU32 numSettingValues; //!< Total number of values available in a setting.
  74. NVDRS_SETTING_TYPE settingType; //!< Type of setting value.
  75. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  76. {
  77. NvU32 u32DefaultValue; //!< Accessing default DWORD value of this setting.
  78. NVDRS_BINARY_SETTING binaryDefaultValue; //!< Accessing default Binary value of this setting.
  79. //!< Must be allocated by caller with valueLength specifying buffer size, or only valueLength will be filled in.
  80. NvAPI_UnicodeString wszDefaultValue; //!< Accessing default unicode string value of this setting.
  81. };
  82. union //!< Setting values can be of either DWORD, Binary values or String type,
  83. { //!< NOT mixed types.
  84. NvU32 u32Value; //!< All possible DWORD values for a setting
  85. NVDRS_BINARY_SETTING binaryValue; //!< All possible Binary values for a setting
  86. NvAPI_UnicodeString wszValue; //!< Accessing current unicode string value of this setting.
  87. }settingValues[NVAPI_SETTING_MAX_VALUES];
  88. } NVDRS_SETTING_VALUES;
  89. //! Macro for constructing the version field of ::_NVDRS_SETTING_VALUES
  90. #define NVDRS_SETTING_VALUES_VER MAKE_NVAPI_VERSION(NVDRS_SETTING_VALUES,1)
  91. typedef struct _NVDRS_SETTING_V1
  92. {
  93. NvU32 version; //!< Structure Version
  94. NvAPI_UnicodeString settingName; //!< String name of setting
  95. NvU32 settingId; //!< 32 bit setting Id
  96. NVDRS_SETTING_TYPE settingType; //!< Type of setting value.
  97. NVDRS_SETTING_LOCATION settingLocation; //!< Describes where the value in CurrentValue comes from.
  98. NvU32 isCurrentPredefined; //!< It is different than 0 if the currentValue is a predefined Value,
  99. //!< 0 if the currentValue is a user value.
  100. NvU32 isPredefinedValid; //!< It is different than 0 if the PredefinedValue union contains a valid value.
  101. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  102. {
  103. NvU32 u32PredefinedValue; //!< Accessing default DWORD value of this setting.
  104. NVDRS_BINARY_SETTING binaryPredefinedValue; //!< Accessing default Binary value of this setting.
  105. //!< Must be allocated by caller with valueLength specifying buffer size,
  106. //!< or only valueLength will be filled in.
  107. NvAPI_UnicodeString wszPredefinedValue; //!< Accessing default unicode string value of this setting.
  108. };
  109. union //!< Setting can hold either DWORD or Binary value or string. Not mixed types.
  110. {
  111. NvU32 u32CurrentValue; //!< Accessing current DWORD value of this setting.
  112. NVDRS_BINARY_SETTING binaryCurrentValue; //!< Accessing current Binary value of this setting.
  113. //!< Must be allocated by caller with valueLength specifying buffer size,
  114. //!< or only valueLength will be filled in.
  115. NvAPI_UnicodeString wszCurrentValue; //!< Accessing current unicode string value of this setting.
  116. };
  117. } NVDRS_SETTING_V1;
  118. //! Macro for constructing the version field of ::_NVDRS_SETTING
  119. #define NVDRS_SETTING_VER1 MAKE_NVAPI_VERSION(NVDRS_SETTING_V1, 1)
  120. typedef NVDRS_SETTING_V1 NVDRS_SETTING;
  121. #define NVDRS_SETTING_VER NVDRS_SETTING_VER1
  122. typedef struct _NVDRS_APPLICATION_V4
  123. {
  124. NvU32 version; //!< Structure Version
  125. NvU32 isPredefined; //!< Is the application userdefined/predefined
  126. NvAPI_UnicodeString appName; //!< String name of the Application
  127. NvAPI_UnicodeString userFriendlyName; //!< UserFriendly name of the Application
  128. NvAPI_UnicodeString launcher; //!< Indicates the name (if any) of the launcher that starts the Application
  129. NvAPI_UnicodeString fileInFolder; //!< Select this application only if this file is found.
  130. //!< When specifying multiple files, separate them using the ':' character.
  131. NvU32 isMetro:1; //!< Windows 8 style app
  132. NvU32 isCommandLine:1; //!< Command line parsing for the application name
  133. NvU32 reserved:30; //!< Reserved. Should be 0.
  134. NvAPI_UnicodeString commandLine; //!< If isCommandLine is set to 0 this must be an empty. If isCommandLine is set to 1
  135. //!< this contains application's command line as if it was returned by GetCommandLineW.
  136. } NVDRS_APPLICATION_V4;
  137. #define NVDRS_APPLICATION_VER_V4 MAKE_NVAPI_VERSION(NVDRS_APPLICATION_V4,4)
  138. typedef NVDRS_APPLICATION_V4 NVDRS_APPLICATION;
  139. #define NVDRS_APPLICATION_VER NVDRS_APPLICATION_VER_V4
  140. typedef struct _NVDRS_PROFILE_V1
  141. {
  142. NvU32 version; //!< Structure Version
  143. NvAPI_UnicodeString profileName; //!< String name of the Profile
  144. NVDRS_GPU_SUPPORT gpuSupport; //!< This read-only flag indicates the profile support on either
  145. //!< Quadro, or Geforce, or both.
  146. NvU32 isPredefined; //!< Is the Profile user-defined, or predefined
  147. NvU32 numOfApps; //!< Total number of applications that belong to this profile. Read-only
  148. NvU32 numOfSettings; //!< Total number of settings applied for this Profile. Read-only
  149. } NVDRS_PROFILE_V1;
  150. typedef NVDRS_PROFILE_V1 NVDRS_PROFILE;
  151. //! Macro for constructing the version field of ::NVDRS_PROFILE
  152. #define NVDRS_PROFILE_VER1 MAKE_NVAPI_VERSION(NVDRS_PROFILE_V1,1)
  153. #define NVDRS_PROFILE_VER NVDRS_PROFILE_VER1
  154. #endif