diff --git a/README.md b/README.md index c26011e..47c1fa5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NVIDIA GeForce NOW SDK Release 1.10 +# NVIDIA GeForce NOW SDK Release 1.11 ## At a Glance @@ -10,13 +10,12 @@ Please refer to the [SDK GFN Primer](./doc/SDK-GFN-PRIMER.pdf) for a more detail ### What's New in This Release -* The API `gfnIsRunningInCloudSecure` no longer requires elevation to call successfully -* Updated Cloud Check Integration Guide for new API requirements +* The API `getSessionInfo` is extended to include session ID and RTX enabled flag information * Bug fixes and other minor improvements -## Developer Content Portal +## GeForce NOW Developer Portal -* If your organization or game isn't yet registered with NVIDIA, visit the [Developer Content Portal](https://portal-developer.nvidia.com/) to create accounts and complete game registration. +* Please [contact us](mailto:gdp-queries@nvidia.com) to register your organization or game with the GeForce NOW Developer Portal. ## Development Guide diff --git a/doc/SDK-GFN-PRIMER.pdf b/doc/SDK-GFN-PRIMER.pdf index f797ad9..09dba10 100644 Binary files a/doc/SDK-GFN-PRIMER.pdf and b/doc/SDK-GFN-PRIMER.pdf differ diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html index 120513c..216c9d5 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h.html @@ -136,10 +136,6 @@ #define AUTH_NVIDIA_JWT   8  One of the possible values of AuthType_t. JSON Web Token.
  - -#define GfnClientInfoVersion   (2) - Deprecated, usage will be ignored.
#define IP_V4_SIZE   (17)   @@ -152,6 +148,9 @@ #define LOCALE_SIZE   (6)   + +#define SESSION_ID_SIZE   (38) +  diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html index 3a9284b..e761aed 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___c_a_p_i_8h_source.html @@ -89,17 +89,18 @@
GfnRuntimeSdk_CAPI.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C API declarations for GFN Runtime SDK
32 //
33 // ===============================================================================================
39 
274 #ifndef GFN_SDK_RUNTIME_CAPI_H
275 #define GFN_SDK_RUNTIME_CAPI_H
276 
277 
278 #include "GfnSdk.h"
279 
280 // Defining GfnRuntimeError for backwards compatibility
281 #define GfnRuntimeError GfnError
282 
284 #define AUTH_NVIDIA_DEFAULT 7
285 #define AUTH_NVIDIA_JWT 8
287 
288 #ifdef __cplusplus
289  extern "C"
290  {
291 #endif
292  // ============================================================================================
293  // Constants/Enums
294  // ============================================================================================
295 
300  {
304 
309  {
315 
317  typedef struct StartStreamResponse
318  {
319  bool downloaded;
321 
323  typedef void(GFN_CALLBACK *StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse*, void* context);
324 
326  typedef void(GFN_CALLBACK* StopStreamCallbackSig)(GfnRuntimeError, void* context);
327 
329  typedef unsigned int AuthType_t;
330 
332  typedef struct StartStreamInput
333  {
334  unsigned int uiTitleId;
335  const char* pchAuthToken;
336  AuthType_t tokenType;
337  const char* pchPartnerData;
338  const char* pchPartnerSecureData;
340 
343  {
344  const char* pchPlatformAppId;
345  const char* pchBuildPath;
346  const char* pchMetadataPath;
348 
350  typedef enum GfnStreamStatus
351  {
360  } GfnStreamStatus;
361 
363  inline const char* GfnStreamStatusToString(GfnStreamStatus status)
364  {
365  switch (status)
366  {
367  case GfnStreamStatusInit: return "Init";
368  case GfnStreamStatusNetworkTest: return "NetworkTest";
369  case GfnStreamStatusLoading: return "Loading";
370  case GfnStreamStatusStreaming: return "Streaming";
371  case GfnStreamStatusDone: return "Done";
372  case GfnStreamStatusError: return "Error";
373  case GfnStreamStatusGotInputFocus: return "GotInputFocus";
374  case GfnStreamStatusLostInputFocus: return "LostInputFocus";
375  }
376  return "Unknown GfnStreamStatus";
377  }
378 
379 
382  typedef enum GfnActionType
383  {
387  } GfnActionType;
388 
389 
390  #define GfnClientInfoVersion (2)
391  #define IP_V4_SIZE (17) // INET_ADDRSTRLEN + NULL
392  #define IP_V6_SIZE (49) // INET6_ADDRSTRLEN + NULL
393  #define CC_SIZE (3) // ISO 3166-1 Alpha-2
394  #define LOCALE_SIZE (6) // ISO 639-1 Alpha-2
395 
397  typedef enum GfnOsType
398  {
399  gfnUnknownOs = 0,
400  gfnWindows = 1,
401  gfnMacOs = 2,
402  gfnShield = 3,
403  gfnAndroid = 4,
404  gfnIOs = 5,
405  gfnIPadOs = 6,
406  gfnChromeOs = 7,
407  gfnLinux = 8,
408  gfnTizen = 9,
409  gfnWebOs = 10,
410  gfnTvOs = 11,
411  gfnOsTypeMax = 11
412  } GfnOsType;
413 
415  typedef struct
416  {
417  unsigned int version;
419  char ipV4[IP_V4_SIZE];
420  char country[CC_SIZE];
421  char locale[LOCALE_SIZE];
422  unsigned int RTDAverageLatencyMs;
423  } GfnClientInfo;
424 
427  {
428  gfnOs = 0,
431 
433  typedef struct GfnClientInfoUpdateData
434  {
435  unsigned int version;
437  union
438  {
440  } data;
442 
445  {
449 
452  {
453  unsigned int version;
455  union
456  {
457  unsigned int RTDAverageLatencyMs;
458  } data;
460 
461 
463  typedef struct
464  {
465  unsigned int sessionMaxDurationSec;
466  unsigned int sessionTimeRemainingSec;
467  } GfnSessionInfo;
468 
469  // ============================================================================================
470  // Callback signatures
471  // ============================================================================================
472 
473  // Callbacks that client code should implement and register via the appropriate callback
474  // registration function (listed as part of the C API below).
482  typedef GfnApplicationCallbackResult(GFN_CALLBACK *StreamStatusCallbackSig)(GfnStreamStatus status, void* pUserContext);
487  typedef GfnApplicationCallbackResult(GFN_CALLBACK* SessionInitCallbackSig)(const char* partnerInfoMutable, void* pUserContext);
492 
493  // ============================================================================================
494  // C API
495  // ============================================================================================
496 
497  // ============================================================================================
498  // SDK Initialization / Shutdown
499 
503 
525 
537 
542 
563  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void* pUserContext);
564 
587  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* pUserContext);
588 
611  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void* pUserContext);
613 
632  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* pUserContext);
634 
651  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* pUserContext);
653 
671  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* pUserContext);
689  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* pUserContext);
691 
709  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* pUserContext);
711 
712  // ============================================================================================
713  // Application -> Geforce NOW SDK communication
714  // The application should call these methods at the appropriate locations.
719 
746 
775 
793  NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char* pchPlatformAppId);
794 
815  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char** ppchPlatformAppIds);
816 
839  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char* pchPlatformAppId);
840 
861  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char* pchPlatformId, const char* pchPlatformAppId);
862 
892  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char** ppchClientIp);
893 
915  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char** ppchLanguageCode);
916 
936  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char* pchCountryCode, unsigned int length);
949 
955  NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo* clientInfo);
956 
968 
974  NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo* sessionInfo);
975 
990  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStartStreamAsync(const StartStreamInput * pStartStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
991 
1011  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput* pStartStreamInput, StartStreamResponse* response);
1012 
1028  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void);
1029 
1044  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1045 
1065  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char** ppchPartnerData);
1066 
1086  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char** ppchPartnerSecureData);
1087 
1103  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char** ppchData);
1104 
1105 
1121  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char * status);
1122 
1145  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1147 #ifdef __cplusplus
1148  } // extern "C"
1149 #endif
1150 
1151 
1152 #endif // GFN_SDK_RUNTIME_CAPI_H
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:476
-
GfnOsType
Types of operating systems that can be reported by the SDK.
Definition: GfnRuntimeSdk_CAPI.h:397
-
An update notification for a piece of client info data.
Definition: GfnRuntimeSdk_CAPI.h:433
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C API declarations for GFN Runtime SDK
32 //
33 // ===============================================================================================
39 
285 #ifndef GFN_SDK_RUNTIME_CAPI_H
286 #define GFN_SDK_RUNTIME_CAPI_H
287 
288 
289 #include "GfnSdk.h"
290 
291 // Defining GfnRuntimeError for backwards compatibility
292 #define GfnRuntimeError GfnError
293 
295 #define AUTH_NVIDIA_DEFAULT 7
296 #define AUTH_NVIDIA_JWT 8
298 
299 #ifdef __cplusplus
300  extern "C"
301  {
302 #endif
303  // ============================================================================================
304  // Constants/Enums
305  // ============================================================================================
306 
311  {
315 
320  {
326 
328  typedef struct StartStreamResponse
329  {
330  bool downloaded;
332 
334  typedef void(GFN_CALLBACK *StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse*, void* context);
335 
337  typedef void(GFN_CALLBACK* StopStreamCallbackSig)(GfnRuntimeError, void* context);
338 
340  typedef unsigned int AuthType_t;
341 
343  typedef struct StartStreamInput
344  {
345  unsigned int uiTitleId;
346  const char* pchAuthToken;
347  AuthType_t tokenType;
348  const char* pchPartnerData;
349  const char* pchPartnerSecureData;
351 
354  {
355  const char* pchPlatformAppId;
356  const char* pchBuildPath;
357  const char* pchMetadataPath;
359 
361  typedef enum GfnStreamStatus
362  {
371  } GfnStreamStatus;
372 
374  inline const char* GfnStreamStatusToString(GfnStreamStatus status)
375  {
376  switch (status)
377  {
378  case GfnStreamStatusInit: return "Init";
379  case GfnStreamStatusNetworkTest: return "NetworkTest";
380  case GfnStreamStatusLoading: return "Loading";
381  case GfnStreamStatusStreaming: return "Streaming";
382  case GfnStreamStatusDone: return "Done";
383  case GfnStreamStatusError: return "Error";
384  case GfnStreamStatusGotInputFocus: return "GotInputFocus";
385  case GfnStreamStatusLostInputFocus: return "LostInputFocus";
386  }
387  return "Unknown GfnStreamStatus";
388  }
389 
390 
393  typedef enum GfnActionType
394  {
398  } GfnActionType;
399 
400 
401  #define IP_V4_SIZE (17) // INET_ADDRSTRLEN + NULL
402  #define IP_V6_SIZE (49) // INET6_ADDRSTRLEN + NULL
403  #define CC_SIZE (3) // ISO 3166-1 Alpha-2
404  #define LOCALE_SIZE (6) // ISO 639-1 Alpha-2
405  #define SESSION_ID_SIZE (38)
406 
408  typedef enum GfnOsType
409  {
410  gfnUnknownOs = 0,
411  gfnWindows = 1,
412  gfnMacOs = 2,
413  gfnShield = 3,
414  gfnAndroid = 4,
415  gfnIOs = 5,
416  gfnIPadOs = 6,
417  gfnChromeOs = 7,
418  gfnLinux = 8,
419  gfnTizen = 9,
420  gfnWebOs = 10,
421  gfnTvOs = 11,
422  gfnOsTypeMax = 11
423  } GfnOsType;
424 
426  typedef struct
427  {
428  unsigned int version;
430  char ipV4[IP_V4_SIZE];
431  char country[CC_SIZE];
432  char locale[LOCALE_SIZE];
433  unsigned int RTDAverageLatencyMs;
434  } GfnClientInfo;
435 
438  {
439  gfnOs = 0,
442 
444  typedef struct GfnClientInfoUpdateData
445  {
446  unsigned int version;
448  union
449  {
451  } data;
453 
456  {
460 
463  {
464  unsigned int version;
466  union
467  {
468  unsigned int RTDAverageLatencyMs;
469  } data;
471 
472 
474  typedef struct
475  {
476  unsigned int sessionMaxDurationSec;
477  unsigned int sessionTimeRemainingSec;
478  char sessionId[SESSION_ID_SIZE];
480  } GfnSessionInfo;
481 
482  // ============================================================================================
483  // Callback signatures
484  // ============================================================================================
485 
486  // Callbacks that client code should implement and register via the appropriate callback
487  // registration function (listed as part of the C API below).
495  typedef GfnApplicationCallbackResult(GFN_CALLBACK *StreamStatusCallbackSig)(GfnStreamStatus status, void* pUserContext);
500  typedef GfnApplicationCallbackResult(GFN_CALLBACK* SessionInitCallbackSig)(const char* partnerInfoMutable, void* pUserContext);
505 
506  // ============================================================================================
507  // C API
508  // ============================================================================================
509 
510  // ============================================================================================
511  // SDK Initialization / Shutdown
512 
516 
538 
550 
555 
576  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void* pUserContext);
577 
600  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* pUserContext);
601 
624  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void* pUserContext);
626 
645  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* pUserContext);
647 
664  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* pUserContext);
666 
684  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* pUserContext);
702  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* pUserContext);
704 
722  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* pUserContext);
724 
725  // ============================================================================================
726  // Application -> Geforce NOW SDK communication
727  // The application should call these methods at the appropriate locations.
732 
759 
787 
805  NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char* pchPlatformAppId);
806 
827  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char** ppchPlatformAppIds);
828 
851  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char* pchPlatformAppId);
852 
873  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char* pchPlatformId, const char* pchPlatformAppId);
874 
904  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char** ppchClientIp);
905 
927  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char** ppchLanguageCode);
928 
948  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char* pchCountryCode, unsigned int length);
961 
967  NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo* clientInfo);
968 
981 
993  NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo* sessionInfo);
994 
1009  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStartStreamAsync(const StartStreamInput * pStartStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1010 
1030  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput* pStartStreamInput, StartStreamResponse* response);
1031 
1047  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void);
1048 
1063  NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
1064 
1084  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char** ppchPartnerData);
1085 
1105  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char** ppchPartnerSecureData);
1106 
1122  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char** ppchData);
1123 
1124 
1140  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char * status);
1141 
1164  NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
1166 #ifdef __cplusplus
1167  } // extern "C"
1168 #endif
1169 
1170 
1171 #endif // GFN_SDK_RUNTIME_CAPI_H
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:489
+
GfnOsType
Types of operating systems that can be reported by the SDK.
Definition: GfnRuntimeSdk_CAPI.h:408
+
An update notification for a piece of client info data.
Definition: GfnRuntimeSdk_CAPI.h:444
+
unsigned int sessionTimeRemainingSec
Nominal time remaining in the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:477
NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo *sessionInfo)
-
Client is actively streaming.
Definition: GfnRuntimeSdk_CAPI.h:355
-
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:463
-
GfnApplicationCallbackResult
Returned by callbacks the application registers with the Geforce NOW Runtime SDK, or passes in to asy...
Definition: GfnRuntimeSdk_CAPI.h:299
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:417
-
GfnNetworkStatusChangeType
The type of network status data which changed. This enum will likely be expanded over time...
Definition: GfnRuntimeSdk_CAPI.h:444
-
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:326
-
const char * pchPartnerSecureData
Optional secure partner data that is guaranteed to be protected through the GFN pipeline.
Definition: GfnRuntimeSdk_CAPI.h:338
+
Client is actively streaming.
Definition: GfnRuntimeSdk_CAPI.h:366
+
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:474
+
GfnApplicationCallbackResult
Returned by callbacks the application registers with the Geforce NOW Runtime SDK, or passes in to asy...
Definition: GfnRuntimeSdk_CAPI.h:310
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:428
+
GfnNetworkStatusChangeType
The type of network status data which changed. This enum will likely be expanded over time...
Definition: GfnRuntimeSdk_CAPI.h:455
+
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:337
+
const char * pchPartnerSecureData
Optional secure partner data that is guaranteed to be protected through the GFN pipeline.
Definition: GfnRuntimeSdk_CAPI.h:349
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId)
struct TitleInstallationInformation TitleInstallationInformation
Input to the function registered via gfnRegisterInstallCallback (if any).
@@ -108,93 +109,95 @@
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnAppReady(bool success, const char *status)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnInitializeRuntimeSdk(GfnDisplayLanguage displayLanguage)
-
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:478
+
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:491
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnFree(const char **ppchData)
-
const char * GfnStreamStatusToString(GfnStreamStatus status)
Converts a GfnStreamStatus enum to a human-readable string.
Definition: GfnRuntimeSdk_CAPI.h:363
-
Considered to be running in GFN Cloud, using software and hardware heuristics that are near impossibl...
Definition: GfnRuntimeSdk_CAPI.h:313
+
const char * GfnStreamStatusToString(GfnStreamStatus status)
Converts a GfnStreamStatus enum to a human-readable string.
Definition: GfnRuntimeSdk_CAPI.h:374
+
Considered to be running in GFN Cloud, using software and hardware heuristics that are near impossibl...
Definition: GfnRuntimeSdk_CAPI.h:324
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerData(const char **ppchPartnerData)
-
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:457
+
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:468
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientCountryCode(char *pchCountryCode, unsigned int length)
-
const char * pchMetadataPath
Optionally contains the path at which game metadata can be found, else NULL.
Definition: GfnRuntimeSdk_CAPI.h:346
+
const char * pchMetadataPath
Optionally contains the path at which game metadata can be found, else NULL.
Definition: GfnRuntimeSdk_CAPI.h:357
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetTitlesAvailable(const char **ppchPlatformAppIds)
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:182
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetupTitle(const char *pchPlatformAppId)
struct to reference a rect
Definition: GfnSdk.h:240
-
unsigned int uiTitleId
GFN-sourced game-specific unique identifier.
Definition: GfnRuntimeSdk_CAPI.h:334
-
Considered to be running in GFN Cloud, using software and network heuristics that are difficult to ci...
Definition: GfnRuntimeSdk_CAPI.h:312
-
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:482
-
AuthType_t tokenType
Token identifier.
Definition: GfnRuntimeSdk_CAPI.h:336
-
Client has successfully finished streaming.
Definition: GfnRuntimeSdk_CAPI.h:356
-
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:323
+
unsigned int uiTitleId
GFN-sourced game-specific unique identifier.
Definition: GfnRuntimeSdk_CAPI.h:345
+
Considered to be running in GFN Cloud, using software and network heuristics that are difficult to ci...
Definition: GfnRuntimeSdk_CAPI.h:323
+
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:495
+
AuthType_t tokenType
Token identifier.
Definition: GfnRuntimeSdk_CAPI.h:347
+
Client has successfully finished streaming.
Definition: GfnRuntimeSdk_CAPI.h:367
+
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:334
struct GfnClientInfoUpdateData GfnClientInfoUpdateData
An update notification for a piece of client info data.
-
Action to specify an editable text box rect on screen.
Definition: GfnRuntimeSdk_CAPI.h:385
-
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:415
-
Client has gained input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:358
+
Action to specify an editable text box rect on screen.
Definition: GfnRuntimeSdk_CAPI.h:396
+
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:426
+
Client has gained input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:369
struct StartStreamResponse StartStreamResponse
Output response when streaming has started.
enum GfnClientInfoChangeType GfnClientDataChangeType
Type of data which changed. This enum will be expanded over time.
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *pUserContext)
NVGFNSDK_EXPORT void NVGFNSDKApi gfnShutdownRuntimeSdk()
-
Sentinel value, do not use.
Definition: GfnRuntimeSdk_CAPI.h:386
-
An update notification for a piece of network status data. This structure will likely be expanded ove...
Definition: GfnRuntimeSdk_CAPI.h:451
-
No event.
Definition: GfnRuntimeSdk_CAPI.h:384
-
const char * pchBuildPath
The path at which game build files can be found.
Definition: GfnRuntimeSdk_CAPI.h:345
-
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:308
+
Sentinel value, do not use.
Definition: GfnRuntimeSdk_CAPI.h:397
+
An update notification for a piece of network status data. This structure will likely be expanded ove...
Definition: GfnRuntimeSdk_CAPI.h:462
+
No event.
Definition: GfnRuntimeSdk_CAPI.h:395
+
unsigned int sessionMaxDurationSec
Maximum total time allowed for the session in seconds.
Definition: GfnRuntimeSdk_CAPI.h:476
+
const char * pchBuildPath
The path at which game build files can be found.
Definition: GfnRuntimeSdk_CAPI.h:356
+
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:319
NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsTitleAvailable(const char *pchPlatformAppId)
NVGFNSDK_EXPORT GfnRuntimeError gfnGetClientInfo(GfnClientInfo *clientInfo)
-
Change in OS of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:428
-
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:491
+
Change in OS of GFN Client.
Definition: GfnRuntimeSdk_CAPI.h:439
+
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:504
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientLanguageCode(const char **ppchLanguageCode)
-
unsigned int AuthType_t
Type of token to use for GFN session. Valid values include AUTH_NVIDIA_DEFAULT and AUTH_NVIDIA_JWT...
Definition: GfnRuntimeSdk_CAPI.h:329
-
Client has stopped streaming and has entered an error state.
Definition: GfnRuntimeSdk_CAPI.h:357
-
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:489
-
GfnClientDataChangeType updateType
Type of GFN Client data that changed.
Definition: GfnRuntimeSdk_CAPI.h:436
+
unsigned int AuthType_t
Type of token to use for GFN session. Valid values include AUTH_NVIDIA_DEFAULT and AUTH_NVIDIA_JWT...
Definition: GfnRuntimeSdk_CAPI.h:340
+
Client has stopped streaming and has entered an error state.
Definition: GfnRuntimeSdk_CAPI.h:368
+
bool sessionRTXEnabled
Defines if RTX support is enabled for the session.
Definition: GfnRuntimeSdk_CAPI.h:479
+
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:502
+
GfnClientDataChangeType updateType
Type of GFN Client data that changed.
Definition: GfnRuntimeSdk_CAPI.h:447
NVGFNSDK_EXPORT void NVGFNSDKApi gfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs)
-
Input to the function registered via gfnRegisterInstallCallback (if any).
Definition: GfnRuntimeSdk_CAPI.h:342
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:435
-
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:382
-
Sentinel value for GfnClientInfoChangeType.
Definition: GfnRuntimeSdk_CAPI.h:429
-
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:480
-
Initial default state.
Definition: GfnRuntimeSdk_CAPI.h:352
-
GfnNetworkStatusChangeType updateType
Network Status Update type.
Definition: GfnRuntimeSdk_CAPI.h:454
-
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:484
+
Input to the function registered via gfnRegisterInstallCallback (if any).
Definition: GfnRuntimeSdk_CAPI.h:353
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:446
+
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:393
+
Sentinel value for GfnClientInfoChangeType.
Definition: GfnRuntimeSdk_CAPI.h:440
+
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:493
+
Initial default state.
Definition: GfnRuntimeSdk_CAPI.h:363
+
GfnNetworkStatusChangeType updateType
Network Status Update type.
Definition: GfnRuntimeSdk_CAPI.h:465
+
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:497
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *pUserContext)
-
GfnClientInfoChangeType
Type of data which changed. This enum will be expanded over time.
Definition: GfnRuntimeSdk_CAPI.h:426
-
Client is running a network test to determine the best zone.
Definition: GfnRuntimeSdk_CAPI.h:353
-
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:439
-
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:487
+
GfnClientInfoChangeType
Type of data which changed. This enum will be expanded over time.
Definition: GfnRuntimeSdk_CAPI.h:437
+
Client is running a network test to determine the best zone.
Definition: GfnRuntimeSdk_CAPI.h:364
+
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:450
+
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:500
NVGFNSDK_EXPORT bool NVGFNSDKApi gfnIsRunningInCloud()
struct StartStreamInput StartStreamInput
Input data for gfnStartStream.
-
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:453
+
unsigned int version
Deprecated, value will be ignored.
Definition: GfnRuntimeSdk_CAPI.h:464
#define NVGFNSDK_EXPORT
Future support.
Definition: GfnSdk.h:63
-
Considered to be running in GFN Cloud, using software heuristics that are not guaranteed against circ...
Definition: GfnRuntimeSdk_CAPI.h:311
+
Considered to be running in GFN Cloud, using software heuristics that are not guaranteed against circ...
Definition: GfnRuntimeSdk_CAPI.h:322
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetClientIp(const char **ppchClientIp)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStartStream(StartStreamInput *pStartStreamInput, StartStreamResponse *response)
-
bool downloaded
True if Geforce NOW client components were downloaded from the release site.
Definition: GfnRuntimeSdk_CAPI.h:319
+
bool downloaded
True if Geforce NOW client components were downloaded from the release site.
Definition: GfnRuntimeSdk_CAPI.h:330
#define GFN_CALLBACK
Future support.
Definition: GfnSdk.h:61
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnStopStream(void)
-
Change in RTDAverageLatency.
Definition: GfnRuntimeSdk_CAPI.h:446
-
GfnStreamStatus
Possible states of the client streamer.
Definition: GfnRuntimeSdk_CAPI.h:350
+
Change in RTDAverageLatency.
Definition: GfnRuntimeSdk_CAPI.h:457
+
GfnStreamStatus
Possible states of the client streamer.
Definition: GfnRuntimeSdk_CAPI.h:361
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *pUserContext)
-
Return to indicate that a callback has performed the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:301
-
Not considered to be running in GFN cloud, as it looks like a client/local system.
Definition: GfnRuntimeSdk_CAPI.h:310
+
Return to indicate that a callback has performed the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:312
+
Not considered to be running in GFN cloud, as it looks like a client/local system.
Definition: GfnRuntimeSdk_CAPI.h:321
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *pUserContext)
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext)
-
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:317
+
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:328
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone)
-
const char * pchPartnerData
Optional non-secure partner data that is passed to the streaming cloud instance and can be retrieved ...
Definition: GfnRuntimeSdk_CAPI.h:337
+
const char * pchPartnerData
Optional non-secure partner data that is passed to the streaming cloud instance and can be retrieved ...
Definition: GfnRuntimeSdk_CAPI.h:348
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnGetPartnerSecureData(const char **ppchPartnerSecureData)
-
Sentinel value for GfnNetworkStatusChangeType.
Definition: GfnRuntimeSdk_CAPI.h:447
+
Sentinel value for GfnNetworkStatusChangeType.
Definition: GfnRuntimeSdk_CAPI.h:458
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance)
-
const char * pchAuthToken
NVIDIA IDM Token string.
Definition: GfnRuntimeSdk_CAPI.h:335
+
const char * pchAuthToken
NVIDIA IDM Token string.
Definition: GfnRuntimeSdk_CAPI.h:346
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext)
-
Client is loading the game.
Definition: GfnRuntimeSdk_CAPI.h:354
+
Client is loading the game.
Definition: GfnRuntimeSdk_CAPI.h:365
NVGFNSDK_EXPORT GfnRuntimeError NVGFNSDKApi gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext)
-
Client has lost input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:359
-
const char * pchPlatformAppId
Platform application ID passed into the API.
Definition: GfnRuntimeSdk_CAPI.h:344
-
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:422
-
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:418
-
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:332
-
Return to indicate that a callback did not perform the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:302
+
Client has lost input focus to the streamer window.
Definition: GfnRuntimeSdk_CAPI.h:370
+
const char * pchPlatformAppId
Platform application ID passed into the API.
Definition: GfnRuntimeSdk_CAPI.h:355
+
unsigned int RTDAverageLatencyMs
Round Trip Delay - Average Latency in milliseconds.
Definition: GfnRuntimeSdk_CAPI.h:433
+
GfnOsType osType
Operating System type.
Definition: GfnRuntimeSdk_CAPI.h:429
+
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:343
+
Return to indicate that a callback did not perform the requested operation.
Definition: GfnRuntimeSdk_CAPI.h:313
#define NVGFNSDKApi
Future support.
Definition: GfnSdk.h:65
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html index 7c3b3f2..63903eb 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_runtime_sdk___wrapper_8h_source.html @@ -89,41 +89,41 @@
GfnRuntimeSdk_Wrapper.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C-based wrapper API declarations for GFN Runtime SDK APIs
32 //
33 // ===============================================================================================
39 
222 #include "GfnRuntimeSdk_CAPI.h"
223 
224 #ifdef _WIN32
225  #ifndef WIN32_LEAN_AND_MEAN
226  #define WIN32_LEAN_AND_MEAN
227  #endif
228  #include <windows.h>
230  extern HMODULE g_gfnSdkModule;
231 #endif
232 
233 #ifdef __cplusplus
234 extern "C"
235 {
236 #endif
237 
262  GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language);
263 
265  #define GfnInitializeSdkFromPath GfnInitializeSdkFromPathA
266 
287  GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath);
288 
309  GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath);
310 
323  GfnRuntimeError GfnShutdownSdk(void);
324 
354  GfnRuntimeError GfnIsRunningInCloud(bool* runningInCloud);
355 
384  GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance* assurance);
385 
406  GfnRuntimeError GfnGetClientIpV4(const char** clientIp);
407 
429  GfnRuntimeError GfnGetClientLanguageCode(const char** languageCode);
430 
450  GfnRuntimeError GfnGetClientCountryCode(char* countryCode, unsigned int length);
451 
470  GfnRuntimeError GfnGetClientInfo(GfnClientInfo* clientInfo);
471 
489  GfnRuntimeError GfnGetSessionInfo(GfnSessionInfo* sessionInfo);
490 
511  GfnRuntimeError GfnGetPartnerData(const char** partnerData);
512 
533  GfnRuntimeError GfnGetPartnerSecureData(const char** partnerSecureData);
534 
559  GfnRuntimeError GfnIsTitleAvailable(const char* platformAppId, bool* isAvailable);
560 
585  GfnRuntimeError GfnGetTitlesAvailable(const char** platformAppIds);
586 
603  GfnRuntimeError GfnFree(const char** data);
604 
605 
626  GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* userContext);
627 
648  GfnRuntimeError GfnStartStream(StartStreamInput* startStreamInput, StartStreamResponse* response);
649 
675  GfnRuntimeError GfnStartStreamAsync(const StartStreamInput* startStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
676 
693  GfnRuntimeError GfnStopStream(void);
694 
720  GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
721 
740  GfnRuntimeError GfnSetupTitle(const char* platformAppId);
741 
760  GfnRuntimeError GfnTitleExited(const char* platformId, const char* platformAppId);
761 
784  GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void* userContext);
785 
808  GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* userContext);
809 
832  GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void* userContext);
833 
853  GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* userContext);
854 
875  GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* userContext);
876 
877 
890  GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* userContext);
891 
908  GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* userContext);
909 
927  GfnRuntimeError GfnAppReady(bool success, const char * status);
928 
955  GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
956 
958 #ifdef __cplusplus
959  } // extern "C"
960 #endif
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:476
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // C-based wrapper API declarations for GFN Runtime SDK APIs
32 //
33 // ===============================================================================================
39 
222 #include "GfnRuntimeSdk_CAPI.h"
223 
224 #ifdef _WIN32
225  #ifndef WIN32_LEAN_AND_MEAN
226  #define WIN32_LEAN_AND_MEAN
227  #endif
228  #include <windows.h>
230  extern HMODULE g_gfnSdkModule;
231 #endif
232 
233 #ifdef __cplusplus
234 extern "C"
235 {
236 #endif
237 
262  GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language);
263 
265  #define GfnInitializeSdkFromPath GfnInitializeSdkFromPathA
266 
287  GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char* sdkLibraryPath);
288 
309  GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t* wSdkLibraryPath);
310 
323  GfnRuntimeError GfnShutdownSdk(void);
324 
354  GfnRuntimeError GfnIsRunningInCloud(bool* runningInCloud);
355 
383  GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance* assurance);
384 
405  GfnRuntimeError GfnGetClientIpV4(const char** clientIp);
406 
428  GfnRuntimeError GfnGetClientLanguageCode(const char** languageCode);
429 
449  GfnRuntimeError GfnGetClientCountryCode(char* countryCode, unsigned int length);
450 
469  GfnRuntimeError GfnGetClientInfo(GfnClientInfo* clientInfo);
470 
483 
495  GfnRuntimeError GfnGetSessionInfo(GfnSessionInfo* sessionInfo);
496 
517  GfnRuntimeError GfnGetPartnerData(const char** partnerData);
518 
539  GfnRuntimeError GfnGetPartnerSecureData(const char** partnerSecureData);
540 
565  GfnRuntimeError GfnIsTitleAvailable(const char* platformAppId, bool* isAvailable);
566 
591  GfnRuntimeError GfnGetTitlesAvailable(const char** platformAppIds);
592 
609  GfnRuntimeError GfnFree(const char** data);
610 
611 
632  GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void* userContext);
633 
654  GfnRuntimeError GfnStartStream(StartStreamInput* startStreamInput, StartStreamResponse* response);
655 
681  GfnRuntimeError GfnStartStreamAsync(const StartStreamInput* startStreamInput, StartStreamCallbackSig cb, void* context, unsigned int timeoutMs);
682 
699  GfnRuntimeError GfnStopStream(void);
700 
726  GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void* context, unsigned int timeoutMs);
727 
746  GfnRuntimeError GfnSetupTitle(const char* platformAppId);
747 
766  GfnRuntimeError GfnTitleExited(const char* platformId, const char* platformAppId);
767 
790  GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void* userContext);
791 
814  GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void* userContext);
815 
838  GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void* userContext);
839 
859  GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void* userContext);
860 
881  GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void* userContext);
882 
883 
896  GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void* userContext);
897 
914  GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void* userContext);
915 
933  GfnRuntimeError GfnAppReady(bool success, const char * status);
934 
961  GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect* zone);
962 
964 #ifdef __cplusplus
965  } // extern "C"
966 #endif
GfnApplicationCallbackResult(GFN_CALLBACK * ExitCallbackSig)(void *pUserContext)
Callback function for notification when a game should exit. Register via gfnRegisterExitCallback API...
Definition: GfnRuntimeSdk_CAPI.h:489
GfnRuntimeError GfnSetupTitle(const char *platformAppId)
-
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:463
+
Session info blob.
Definition: GfnRuntimeSdk_CAPI.h:474
GfnRuntimeError GfnRegisterPauseCallback(PauseCallbackSig pauseCallback, void *userContext)
GfnRuntimeError GfnIsRunningInCloud(bool *runningInCloud)
-
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:326
+
void(GFN_CALLBACK * StopStreamCallbackSig)(GfnRuntimeError, void *context)
Callback function signation for notifications on status of stop a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:337
GfnRuntimeError GfnGetClientCountryCode(char *countryCode, unsigned int length)
GfnRuntimeError GfnRegisterSessionInitCallback(SessionInitCallbackSig sessionInitCallback, void *userContext)
GfnRuntimeError GfnInitializeSdkFromPathA(GfnDisplayLanguage language, const char *sdkLibraryPath)
GfnRuntimeError GfnInitializeSdkFromPathW(GfnDisplayLanguage language, const wchar_t *wSdkLibraryPath)
-
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:478
+
GfnApplicationCallbackResult(GFN_CALLBACK * PauseCallbackSig)(void *pUserContext)
Callback function for notification when a game should pause. Register via gfnRegisterPauseCallback AP...
Definition: GfnRuntimeSdk_CAPI.h:491
GfnRuntimeError GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone)
GfnDisplayLanguage
Values for languages supported by the GFN SDK, used to define which language any SDK dialogs should b...
Definition: GfnSdk.h:182
GfnRuntimeError GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext)
GfnRuntimeError GfnRegisterSaveCallback(SaveCallbackSig saveCallback, void *userContext)
struct to reference a rect
Definition: GfnSdk.h:240
-
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:482
-
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:323
+
GfnApplicationCallbackResult(GFN_CALLBACK * StreamStatusCallbackSig)(GfnStreamStatus status, void *pUserContext)
Callback function for notifications on status of starting a streaming session. Register via gfnRegist...
Definition: GfnRuntimeSdk_CAPI.h:495
+
void(GFN_CALLBACK * StartStreamCallbackSig)(GfnRuntimeError, StartStreamResponse *, void *context)
Callback function signation for notifications on status of starting a streaming session.
Definition: GfnRuntimeSdk_CAPI.h:334
GfnRuntimeError GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext)
-
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:415
+
Client info blob.
Definition: GfnRuntimeSdk_CAPI.h:426
GfnRuntimeError GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext)
GfnRuntimeError GfnInitializeSdk(GfnDisplayLanguage language)
GfnRuntimeError GfnGetPartnerData(const char **partnerData)
-
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:308
+
GfnIsRunningInCloudAssurance
Returned from gfnIsRunningInCloudSecure to denote security assurance that the calling application is ...
Definition: GfnRuntimeSdk_CAPI.h:319
GfnRuntimeError GfnShutdownSdk(void)
GfnRuntimeError GfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs)
-
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:491
+
GfnApplicationCallbackResult(GFN_CALLBACK * NetworkStatusCallbackSig)(GfnNetworkStatusUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on network status changes. Register via gfnRegisterNetworkStatusC...
Definition: GfnRuntimeSdk_CAPI.h:504
GfnRuntimeError GfnGetPartnerSecureData(const char **partnerSecureData)
GfnRuntimeError GfnGetClientLanguageCode(const char **languageCode)
-
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:489
+
GfnApplicationCallbackResult(GFN_CALLBACK * ClientInfoCallbackSig)(GfnClientInfoUpdateData *pUpdate, const void *pUserContext)
Callback function for notifications on client info changes. Register via gfnRegisterClientInfoCallbac...
Definition: GfnRuntimeSdk_CAPI.h:502
GfnRuntimeError GfnGetClientInfo(GfnClientInfo *clientInfo)
-
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:382
-
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:480
-
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:484
-
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:487
+
GfnActionType
Specifies the action in GfnSetActionZone API Deprecated with SetActionZone removal.
Definition: GfnRuntimeSdk_CAPI.h:393
+
GfnApplicationCallbackResult(GFN_CALLBACK * InstallCallbackSig)(const TitleInstallationInformation *pInfo, void *pUserContext)
Callback function for notification when a game is being installed to allow for installation actions...
Definition: GfnRuntimeSdk_CAPI.h:493
+
GfnApplicationCallbackResult(GFN_CALLBACK * SaveCallbackSig)(void *pUserContext)
Callback function for notifications when a game should save its state. Register via gfnRegisterSaveCa...
Definition: GfnRuntimeSdk_CAPI.h:497
+
GfnApplicationCallbackResult(GFN_CALLBACK * SessionInitCallbackSig)(const char *partnerInfoMutable, void *pUserContext)
Callback function for notifications when a game should continue late-stage initialization. Register via gfnRegisterSessionInitCallback API. Function should consume or copy the passed-in partnerInfoMutable string.
Definition: GfnRuntimeSdk_CAPI.h:500
GfnRuntimeError GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs)
GfnRuntimeError GfnTitleExited(const char *platformId, const char *platformAppId)
GfnRuntimeError GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext)
@@ -133,12 +133,12 @@
GfnRuntimeError GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *userContext)
GfnRuntimeError GfnStartStream(StartStreamInput *startStreamInput, StartStreamResponse *response)
GfnRuntimeError GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable)
-
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:317
+
Output response when streaming has started.
Definition: GfnRuntimeSdk_CAPI.h:328
GfnRuntimeError GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance)
GfnRuntimeError GfnStopStream(void)
GfnRuntimeError GfnAppReady(bool success, const char *status)
-
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:332
+
Input data for gfnStartStream.
Definition: GfnRuntimeSdk_CAPI.h:343
GfnRuntimeError GfnGetClientIpV4(const char **clientIp)
diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html index daa846c..33ae510 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h.html @@ -131,11 +131,11 @@
+#define  +#define  +#define  +#define  +#define  +#define  +#define  +#define  +#define 

Typedefs

 GFN SDK Major Version.
 
-#define NVGFNSDK_VERSION_MINOR   10
NVGFNSDK_VERSION_MINOR   11
 GFN SDK Minor Version.
 
-#define NVGFNSDK_VERSION_SHORT   1.10
NVGFNSDK_VERSION_SHORT   1.11
 GFN SDK Version.
 
@@ -143,29 +143,29 @@
 GFN SDK Patch Version.
 
-#define NVGFNSDK_VERSION_BUILD   32038373
NVGFNSDK_VERSION_BUILD   32558885
 GFN SDK Build Version.
 
-#define NVGFNSDK_VERSION_LONG   1.10.0.32038373
NVGFNSDK_VERSION_LONG   1.11.0.32558885
 GFN SDK Version.
 
-#define NVGFNSDK_VERSION_STR   "1.10.0.32038373"
NVGFNSDK_VERSION_STR   "1.11.0.32558885"
 GFN SDK Version string.
 
-#define NVGFNSDK_VERSION_STR_PROD   "1.10.0"
NVGFNSDK_VERSION_STR_PROD   "1.11.0"
 
-#define NVGFNSDK_VERSION_BUILDCL   32038373
NVGFNSDK_VERSION_BUILDCL   32558885
 GFN SDK Build CL.
 
-#define NVGFNSDK_VERSION_BUILDH   3203
NVGFNSDK_VERSION_BUILDH   3255
 
-#define NVGFNSDK_VERSION_BUILDL   8373
NVGFNSDK_VERSION_BUILDL   8885
 

diff --git a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html index 7dbf3aa..930d1b3 100644 --- a/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html +++ b/doc/SDK-GFN-RUNTIME/html/_gfn_sdk_8h_source.html @@ -89,7 +89,7 @@
GfnSdk.h
-Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // Common declarations for GFN SDK APIs
32 //
33 // ===============================================================================================
34 
43 #ifndef GFN_SDK_CAPI_H
44 #define GFN_SDK_CAPI_H
45 
46 // Required for streamer / DLL download step in StartStream
47 #ifdef _WIN32
48 # pragma comment(lib, "ws2_32.lib")
49 # pragma comment(lib, "crypt32.lib")
50 # pragma comment(lib, "Wldap32.lib")
51 # pragma comment(lib, "version.lib")
52 # pragma comment(lib, "shlwapi.lib")
53 # pragma comment(lib, "wintrust")
54 # define GFN_CALLBACK __stdcall
55 # define NVGFNSDK_EXPORT __declspec(dllexport)
56 # define NVGFNSDKApi __cdecl
57 # include <stddef.h>
58 #else
59 // Support to be added in a later release
61 # define GFN_CALLBACK
62 # define NVGFNSDK_EXPORT
64 # define NVGFNSDKApi
66 #endif
67 
68 #ifndef __cplusplus
69 typedef char bool;
72 #define false 0
73 #define true 1
75 #endif
76 
78 #define NVGFNSDK_VERSION_MAJOR 1
79 
81 #define NVGFNSDK_VERSION_MINOR 10
82 
84 #define NVGFNSDK_VERSION_SHORT 1.10
85 
87 #define NVGFNSDK_VERSION_PATCH 0
88 
90 #define NVGFNSDK_VERSION_BUILD 32038373
91 
93 #define NVGFNSDK_VERSION_LONG 1.10.0.32038373
94 
96 #define NVGFNSDK_VERSION_STR "1.10.0.32038373"
97 #define NVGFNSDK_VERSION_STR_PROD "1.10.0"
98 
100 #define NVGFNSDK_VERSION_BUILDCL 32038373
101 #define NVGFNSDK_VERSION_BUILDH 3203
102 #define NVGFNSDK_VERSION_BUILDL 8373
103 
104 
105 #ifdef __cplusplus
106  extern "C"
107  {
108 #endif
109  // ============================================================================================
110  // Constants/Enums
111  // ============================================================================================
112 
114  typedef enum GfnError
115  {
121  gfnComError = -3,
129  gfnTimedOut = -11,
140  gfnCanceled = -22,
142  gfnThrottled = -24,
147  } GfnError;
148 
160  inline bool GFNSDK_SUCCEEDED(GfnError code)
161  {
162  return code >= 0;
163  }
164 
176  inline bool GFNSDK_FAILED(GfnError code)
177  {
178  return code < 0;
179  }
180 
182  typedef enum GfnDisplayLanguage
183  {
185  gfn_bg_BG = 1,
186  gfn_cs_CZ = 2,
187  gfn_nl_NL = 3,
188  gfn_de_DE = 4,
189  gfn_el_GR = 5,
190  gfn_en_US = 6,
191  gfn_en_UK = 7,
192  gfn_es_ES = 8,
193  gfn_es_MX = 9,
194  gfn_fi_FI = 10,
195  gfn_fr_FR = 11,
196  gfn_hu_HU = 12,
197  gfn_it_IT = 13,
198  gfn_ja_JP = 14,
199  gfn_ko_KR = 15,
200  gfn_nb_NO = 16,
201  gfn_po_PO = 17,
202  gfn_pt_BR = 18,
203  gfn_pt_PT = 19,
204  gfn_ro_RO = 20,
205  gfn_ru_RU = 21,
206  gfn_sv_SE = 22,
207  gfn_th_TH = 23,
208  gfn_tr_TR = 24,
209  gfn_uk_UA = 25,
210  gfn_zh_CN = 26,
211  gfn_zh_TW = 27,
212  gfn_en_GB = 28,
213  gfn_hr_HR = 29,
214  gfn_sk_SK = 30,
215  gfn_sl_SI = 31,
216  gfn_da_DK = 32,
219 
221  typedef enum GfnRectFormat
222  {
228 
234 
237  } GfnRectFormat;
238 
240  typedef struct GfnRect
241  {
242  float value1;
243  float value2;
244  float value3;
245  float value4;
246  bool normalized;
247  GfnRectFormat format;
248  } GfnRect;
249 
250 #ifdef __cplusplus
251  } // extern "C"
252 #endif
253 
254 
255 #endif // GFN_SDK_CAPI_H
Ukrainian (Ukraine)
Definition: GfnSdk.h:209
+Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020-2021 NVIDIA Corporation. All rights reserved.
27 
28 //
29 // ===============================================================================================
30 //
31 // Common declarations for GFN SDK APIs
32 //
33 // ===============================================================================================
34 
43 #ifndef GFN_SDK_CAPI_H
44 #define GFN_SDK_CAPI_H
45 
46 // Required for streamer / DLL download step in StartStream
47 #ifdef _WIN32
48 # pragma comment(lib, "ws2_32.lib")
49 # pragma comment(lib, "crypt32.lib")
50 # pragma comment(lib, "Wldap32.lib")
51 # pragma comment(lib, "version.lib")
52 # pragma comment(lib, "shlwapi.lib")
53 # pragma comment(lib, "wintrust")
54 # define GFN_CALLBACK __stdcall
55 # define NVGFNSDK_EXPORT __declspec(dllexport)
56 # define NVGFNSDKApi __cdecl
57 # include <stddef.h>
58 #else
59 // Support to be added in a later release
61 # define GFN_CALLBACK
62 # define NVGFNSDK_EXPORT
64 # define NVGFNSDKApi
66 #endif
67 
68 #ifndef __cplusplus
69 typedef char bool;
72 #define false 0
73 #define true 1
75 #endif
76 
78 #define NVGFNSDK_VERSION_MAJOR 1
79 
81 #define NVGFNSDK_VERSION_MINOR 11
82 
84 #define NVGFNSDK_VERSION_SHORT 1.11
85 
87 #define NVGFNSDK_VERSION_PATCH 0
88 
90 #define NVGFNSDK_VERSION_BUILD 32558885
91 
93 #define NVGFNSDK_VERSION_LONG 1.11.0.32558885
94 
96 #define NVGFNSDK_VERSION_STR "1.11.0.32558885"
97 #define NVGFNSDK_VERSION_STR_PROD "1.11.0"
98 
100 #define NVGFNSDK_VERSION_BUILDCL 32558885
101 #define NVGFNSDK_VERSION_BUILDH 3255
102 #define NVGFNSDK_VERSION_BUILDL 8885
103 
104 
105 #ifdef __cplusplus
106  extern "C"
107  {
108 #endif
109  // ============================================================================================
110  // Constants/Enums
111  // ============================================================================================
112 
114  typedef enum GfnError
115  {
121  gfnComError = -3,
129  gfnTimedOut = -11,
140  gfnCanceled = -22,
142  gfnThrottled = -24,
147  } GfnError;
148 
160  inline bool GFNSDK_SUCCEEDED(GfnError code)
161  {
162  return code >= 0;
163  }
164 
176  inline bool GFNSDK_FAILED(GfnError code)
177  {
178  return code < 0;
179  }
180 
182  typedef enum GfnDisplayLanguage
183  {
185  gfn_bg_BG = 1,
186  gfn_cs_CZ = 2,
187  gfn_nl_NL = 3,
188  gfn_de_DE = 4,
189  gfn_el_GR = 5,
190  gfn_en_US = 6,
191  gfn_en_UK = 7,
192  gfn_es_ES = 8,
193  gfn_es_MX = 9,
194  gfn_fi_FI = 10,
195  gfn_fr_FR = 11,
196  gfn_hu_HU = 12,
197  gfn_it_IT = 13,
198  gfn_ja_JP = 14,
199  gfn_ko_KR = 15,
200  gfn_nb_NO = 16,
201  gfn_po_PO = 17,
202  gfn_pt_BR = 18,
203  gfn_pt_PT = 19,
204  gfn_ro_RO = 20,
205  gfn_ru_RU = 21,
206  gfn_sv_SE = 22,
207  gfn_th_TH = 23,
208  gfn_tr_TR = 24,
209  gfn_uk_UA = 25,
210  gfn_zh_CN = 26,
211  gfn_zh_TW = 27,
212  gfn_en_GB = 28,
213  gfn_hr_HR = 29,
214  gfn_sk_SK = 30,
215  gfn_sl_SI = 31,
216  gfn_da_DK = 32,
219 
221  typedef enum GfnRectFormat
222  {
228 
234 
237  } GfnRectFormat;
238 
240  typedef struct GfnRect
241  {
242  float value1;
243  float value2;
244  float value3;
245  float value4;
246  bool normalized;
247  GfnRectFormat format;
248  } GfnRect;
249 
250 
251 #ifdef __cplusplus
252  } // extern "C"
253 #endif
254 
255 
256 #endif // GFN_SDK_CAPI_H
Ukrainian (Ukraine)
Definition: GfnSdk.h:209
bool normalized
true : coordinates are normalized between 0.0-1.0, false : absolute coordinates
Definition: GfnSdk.h:246
API call required to be run from an elevated process.
Definition: GfnSdk.h:141
API Call is not supported.
Definition: GfnSdk.h:127
diff --git a/doc/SDK-GFN-RUNTIME/html/functions.html b/doc/SDK-GFN-RUNTIME/html/functions.html index 9b0c51d..c67ac3d 100644 --- a/doc/SDK-GFN-RUNTIME/html/functions.html +++ b/doc/SDK-GFN-RUNTIME/html/functions.html @@ -76,6 +76,23 @@
  • Variables
  • +
    -
    Here is a list of all documented class members with links to the class documentation for each member:
    +
    diff --git a/doc/SDK-GFN-RUNTIME/html/globals_g.html b/doc/SDK-GFN-RUNTIME/html/globals_g.html index d4f2680..146452b 100644 --- a/doc/SDK-GFN-RUNTIME/html/globals_g.html +++ b/doc/SDK-GFN-RUNTIME/html/globals_g.html @@ -260,9 +260,6 @@

    - g -

    -
    Description
    Gets various information about the current game session
    +
    Description
    Gets various information about the current streaming session
    Environment
    Cloud
    -
    Usage
    Call this during game play to find session time remaining.
    +
    Usage
    Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
    Parameters
    @@ -459,6 +459,7 @@

    Function Documentation

    Returns
    Otherwise, appropriate error code
    +
    Note
    If the application has called gfnRegisterSessionInitCallback to be notified when a user connects, then this API should be called after that callback is triggered. Certain data, such as session time limit or RTX support, can only be defined when a user connects as the values depend on the user type. Calling before that point can result in obtaining incorrect data.
    @@ -547,7 +548,7 @@

    Function Documentation

    Return values
    sessionInfo- Pointer to a GfnSessionInfo struct.
    - +
    gfnSuccess- On success
    gfnSuccess- On success
    diff --git a/doc/SDK-GFN-RUNTIME/html/group__wrapper.html b/doc/SDK-GFN-RUNTIME/html/group__wrapper.html index 637ef1f..382e413 100644 --- a/doc/SDK-GFN-RUNTIME/html/group__wrapper.html +++ b/doc/SDK-GFN-RUNTIME/html/group__wrapper.html @@ -480,25 +480,25 @@

    Function Documentation

    -
    Description
    Gets information related to the current streaming session.
    +
    Description
    Gets various information about the current streaming session
    Environment
    Cloud
    -
    Usage
    Call this to obtain information related to the streaming session
    +
    Usage
    Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
    Parameters
    - +
    [out]sessionInfo- A structure to hold session Info data
    sessionInfo- Pointer to a GfnSessionInfo struct.
    Return values
    - + - -
    gfnSuccess- On success
    gfnInvalidParameter- NULL pointer passed in
    gfnInvalidParameter- NULL pointer passed in or buffer length is too small
    gfnCallWrongEnvironment- If called in a client environment
    gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found
    gfnAPINotFound- The API was not found in the GFN SDK Library
    +
    Returns
    Otherwise, appropriate error code
    +
    Note
    If the application has called gfnRegisterSessionInitCallback to be notified when a user connects, then this API should be called after that callback is triggered. Certain data, such as session time limit or RTX support, can only be defined when a user connects as the values depend on the user type. Calling before that point can result in obtaining incorrect data.
    @@ -717,7 +717,7 @@

    Function Documentation

    Description
    Calls gfnIsRunningInCloudSecure to determine if calling application is running in GFN environment, and what level of security assurance that the result is valid.
    Environment
    Cloud and Client
    Usage
    Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
    -
    Warning
    This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudassurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
    +
    Warning
    This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
    Parameters
    diff --git a/doc/SDK-GFN-RUNTIME/html/index.html b/doc/SDK-GFN-RUNTIME/html/index.html index 36e6300..99ac4ed 100644 --- a/doc/SDK-GFN-RUNTIME/html/index.html +++ b/doc/SDK-GFN-RUNTIME/html/index.html @@ -183,7 +183,7 @@

    Return values

    assurance- Likelihood and level of security assurance defined via GfnIsRunningInCloudAssurance that API is running in GFN cloud environment
    - +
    gfnSuccess- On success
    gfnSuccess- On success
    @@ -411,6 +411,31 @@

    Language API +C gfnGetSessionInfo + +
    Description
    Gets various information about the current streaming session
    +
    Environment
    Cloud
    +
    Usage
    Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
    +
    Parameters
    + + +
    sessionInfo- Pointer to a GfnSessionInfo struct.
    +
    +
    +
    Return values
    + + + + +
    gfnSuccess- On success
    gfnInvalidParameter- NULL pointer passed in or buffer length is too small
    gfnCallWrongEnvironment- If called in a client environment
    +
    +
    +
    Returns
    Otherwise, appropriate error code
    +
    Note
    If the application has called gfnRegisterSessionInitCallback to be notified when a user connects, then this API should be called after that callback is triggered. Certain data, such as session time limit or RTX support, can only be defined when a user connects as the values depend on the user type. Calling before that point can result in obtaining incorrect data.
    + + + +
    Language API
    C gfnStartStream
    Description
    Requests GFN client to start a streamed session of an application in a synchronous (blocking) fashion.
    @@ -561,6 +586,36 @@

    + + + + + +
    Language API
    C gfnSetActionZone
    +
    Description
    Defines active zone coordinates for GFN to interact with.
    +
    Environment
    Cloud
    +
    Usage
    Use to invoke special events on the client from the GFN cloud environment
    +
    Parameters
    + + + + +
    type- Populated with relevant GfnActionType
    id- unique unsigned int type identifier for this action zone
    zone- To enable action zone set this parameter to GfnRect coordinates of the zone, to disable action zone set this parameter to NULL
    +
    +
    +
    Return values
    + + + + + + + + +
    gfnSuccess- Call was successful
    gfnInputExpected- Expected zone to have a value
    gfnComError- There was SDK internal communication error
    gfnInitFailure- SDK was not initialized
    gfnInvalidParameter- Invalid parameters provided
    gfnThrottled- API call was throttled for exceeding limit
    gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code
    +
    +
    +
    Returns
    Otherwise, appropriate error code

    Callback-related Methods

    Client Callback Registration

    @@ -666,32 +721,27 @@

    Language API -C gfnSetActionZone +C gfnRegisterSessionInitCallback -
    Description
    Defines active zone coordinates for GFN to interact with.
    -
    Environment
    Cloud
    -
    Usage
    Use to invoke special events on the client from the GFN cloud environment
    +
    Description
    Register an application callback with GFN to be called when a GFN user has connected to the game seat
    +
    Usage
    Register an application function to call when a GFN user has connected to the game seat
    Parameters
    - - - + +
    type- Populated with relevant GfnActionType
    id- unique unsigned int type identifier for this action zone
    zone- To enable action zone set this parameter to GfnRect coordinates of the zone, to disable action zone set this parameter to NULL
    sessionInitCallback- Function pointer to application code to call when GFN is ready for the application to finalize loading
    pUserContext- Pointer to user context, which will be passed unmodified to the callback specified. Can be NULL.
    Return values
    - - - - - - - + + + + +
    gfnSuccess- Call was successful
    gfnInputExpected- Expected zone to have a value
    gfnComError- There was SDK internal communication error
    gfnInitFailure- SDK was not initialized
    gfnInvalidParameter- Invalid parameters provided
    gfnThrottled- API call was throttled for exceeding limit
    gfnUnhandledException- API ran into an unhandled error and caught an exception before it returned to client code
    gfnSuccess- On success when running in a GFN environment
    gfnInvalidParameter- If callback was NULL
    gfnCloudLibraryNotFound- If the on-seat dll was not present (Usually due to not running on a seat)
    gfnAPINotFound- If the API was not found in the GFN SDK Library
    gfnCallWrongEnvironment- If the on-seat dll detected that it was not on a game seat
    -
    Returns
    Otherwise, appropriate error code
    diff --git a/doc/SDK-GFN-RUNTIME/html/search/all_6.js b/doc/SDK-GFN-RUNTIME/html/search/all_6.js index 6334203..670fde7 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/all_6.js +++ b/doc/SDK-GFN-RUNTIME/html/search/all_6.js @@ -50,7 +50,6 @@ var searchData= ['gfnclientinfo',['GfnClientInfo',['../struct_gfn_client_info.html',1,'']]], ['gfnclientinfochangetype',['GfnClientInfoChangeType',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a855cf09bb9d788137222168251e69bbb',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnclientinfoupdatedata',['GfnClientInfoUpdateData',['../struct_gfn_client_info_update_data.html',1,'GfnClientInfoUpdateData'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a87eb642377dbb3a80e6e485760facaa1',1,'GfnClientInfoUpdateData(): GfnRuntimeSdk_CAPI.h']]], - ['gfnclientinfoversion',['GfnClientInfoVersion',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abfd3e6f52e0292fb4def9b0b93148978',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnclientlibrarynotfound',['gfnClientLibraryNotFound',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2af943ab97b7a27a16c01a332b6769bdba',1,'GfnSdk.h']]], ['gfncloudlibrarynotfound',['gfnCloudLibraryNotFound',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2affceebc4ddb7e0649e5f0b18b93389a5',1,'GfnSdk.h']]], ['gfncomerror',['gfnComError',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a613415fd7d786635fcf7f47af703c4ed',1,'GfnSdk.h']]], @@ -65,7 +64,7 @@ var searchData= ['gfngetclientinfo',['gfnGetClientInfo',['../group__launcher.html#ga0a78ef87b1164626048c7c88b9de3284',1,'gfnGetClientInfo(GfnClientInfo *clientInfo): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga85103db7a6fc1dded77a1119ca182ddd',1,'GfnGetClientInfo(GfnClientInfo *clientInfo): GfnRuntimeSdk_Wrapper.h']]], ['gfngetclientip',['gfnGetClientIp',['../group__launcher.html#ga8c41a40828a5bd9a0cf087a0fd2757a8',1,'GfnRuntimeSdk_CAPI.h']]], ['gfngetclientipv4',['GfnGetClientIpV4',['../group__wrapper.html#ga1de5d6792f2d658886fe2be992945e69',1,'GfnRuntimeSdk_Wrapper.h']]], - ['gfngetclientlanguagecode',['GfnGetClientLanguageCode',['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h']]], + ['gfngetclientlanguagecode',['gfnGetClientLanguageCode',['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnerdata',['gfnGetPartnerData',['../group__launcher.html#ga16c67cdee702190faf8b8682f760a339',1,'gfnGetPartnerData(const char **ppchPartnerData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9223905a2b1279a175f9b5bdbc40838c',1,'GfnGetPartnerData(const char **partnerData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnersecuredata',['gfnGetPartnerSecureData',['../group__launcher.html#gaeddedbabbd2d5da5d525bb737b26c820',1,'gfnGetPartnerSecureData(const char **ppchPartnerSecureData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab4760d499a669358847649c9dc44a433',1,'GfnGetPartnerSecureData(const char **partnerSecureData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetsessioninfo',['GfnGetSessionInfo',['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h']]], @@ -104,7 +103,7 @@ var searchData= ['gfnrectltrb',['gfnRectLTRB',['../_gfn_sdk_8h.html#a3932a61fe7c04be5595203f4bb006cb1aabadba94307bdb266fce2b5d84a0c19f',1,'GfnSdk.h']]], ['gfnrectmax',['gfnRectMAX',['../_gfn_sdk_8h.html#a3932a61fe7c04be5595203f4bb006cb1ae9e6a1d5832c07d2c93c475fb74e970d',1,'GfnSdk.h']]], ['gfnrectxywh',['gfnRectXYWH',['../_gfn_sdk_8h.html#a3932a61fe7c04be5595203f4bb006cb1a5153a877d27fb7ca5a03bc3d95e077a1',1,'GfnSdk.h']]], - ['gfnregisterclientinfocallback',['GfnRegisterClientInfoCallback',['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisterclientinfocallback',['gfnRegisterClientInfoCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterexitcallback',['GfnRegisterExitCallback',['../group__wrapper.html#ga25cb8c18e2940a583a481612b1847a94',1,'GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../group__callbacks.html#ga1bcb62aa8313bbe205ea4cb40246ee72',1,'gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregisterinstallcallback',['gfnRegisterInstallCallback',['../group__callbacks.html#gaf315563a9205712a40e7a842af2ac91b',1,'gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9a4a6595694aabf923dba25149827b9f',1,'GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisternetworkstatuscallback',['gfnRegisterNetworkStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h']]], @@ -119,13 +118,13 @@ var searchData= ['gfnsdk_5ffailed',['GFNSDK_FAILED',['../_gfn_sdk_8h.html#af1ab63ffcd0ec8cf72faabdc89ada570',1,'GfnSdk.h']]], ['gfnsdk_5fsucceeded',['GFNSDK_SUCCEEDED',['../_gfn_sdk_8h.html#a3c1aa70801550fa1a48ab6fe0303a35c',1,'GfnSdk.h']]], ['gfnsessioninfo',['GfnSessionInfo',['../struct_gfn_session_info.html',1,'']]], - ['gfnsetactionzone',['gfnSetActionZone',['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h']]], + ['gfnsetactionzone',['GfnSetActionZone',['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h']]], ['gfnsetuptitle',['GfnSetupTitle',['../group__wrapper.html#ga764b9212ff5bfa2bc67f49034afa9b06',1,'GfnSetupTitle(const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gac3fd7e969aeaf3992dbb4e8220cacc6d',1,'gfnSetupTitle(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], ['gfnsetuptitlefailure',['gfnSetupTitleFailure',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a7e19a6a264751aecb654251bf6b9263c',1,'GfnSdk.h']]], ['gfnshutdownruntimesdk',['gfnShutdownRuntimeSdk',['../group__general.html#gaef511b26bef12e55c0c12ea4911005a7',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnshutdownsdk',['GfnShutdownSdk',['../group__wrapper.html#ga3f9e4989832c06a2e431f997848732ac',1,'GfnRuntimeSdk_Wrapper.h']]], ['gfnstartstream',['gfnStartStream',['../group__launcher.html#gaa2d0aa6c6d9325ff2ff5e2beb82c47d6',1,'gfnStartStream(StartStreamInput *pStartStreamInput, StartStreamResponse *response): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga8b35031da8034f2c2e85f2f1b8ec127c',1,'GfnStartStream(StartStreamInput *startStreamInput, StartStreamResponse *response): GfnRuntimeSdk_Wrapper.h']]], - ['gfnstartstreamasync',['gfnStartStreamAsync',['../group__launcher.html#gac080be91f1f7c784b42147101ece1c93',1,'gfnStartStreamAsync(const StartStreamInput *pStartStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab2292fb37704156a096875c1a5c60be2',1,'GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h']]], + ['gfnstartstreamasync',['GfnStartStreamAsync',['../group__wrapper.html#gab2292fb37704156a096875c1a5c60be2',1,'GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gac080be91f1f7c784b42147101ece1c93',1,'gfnStartStreamAsync(const StartStreamInput *pStartStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h']]], ['gfnstopstream',['GfnStopStream',['../group__wrapper.html#ga5010fe92907ea2e4df986697d51acecc',1,'GfnStopStream(void): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaf187e90d0ba2eb566244c2d302fed86e',1,'gfnStopStream(void): GfnRuntimeSdk_CAPI.h']]], ['gfnstopstreamasync',['GfnStopStreamAsync',['../group__wrapper.html#gaefae1a18a508d60d0bf4f8baf1c1f3ee',1,'GfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga2392b3feb76dc6e77cc32d39c7193428',1,'gfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h']]], ['gfnstreamfailure',['gfnStreamFailure',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2adc518573bb6087e3de0138e564b2ec33',1,'GfnSdk.h']]], @@ -143,7 +142,7 @@ var searchData= ['gfnsuccess',['gfnSuccess',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2abf5db7fca7a3d3af4996f206ad1fe095',1,'GfnSdk.h']]], ['gfnthrottled',['gfnThrottled',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2abc3a3d9e5273f7bda51a4894bf163925',1,'GfnSdk.h']]], ['gfntimedout',['gfnTimedOut',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a33640b726436c5f12eef70eb81e3bd8f',1,'GfnSdk.h']]], - ['gfntitleexited',['gfnTitleExited',['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]], + ['gfntitleexited',['GfnTitleExited',['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], ['gfnunabletoallocatememory',['gfnUnableToAllocateMemory',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2af73ee7f5f296791fbadeb94e123669a1',1,'GfnSdk.h']]], ['gfnunhandledexception',['gfnUnhandledException',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2a5f0a8dab9ffbddcdffa45ba872bd025a',1,'GfnSdk.h']]], ['gfnunsupportedapicall',['gfnUnsupportedAPICall',['../_gfn_sdk_8h.html#a1b7d39d60da8754a0e1ed6bec951faa2af8614d00764f9704a7ef2008dae157f1',1,'GfnSdk.h']]], diff --git a/doc/SDK-GFN-RUNTIME/html/search/all_d.js b/doc/SDK-GFN-RUNTIME/html/search/all_d.js index e0b580e..3b31ba6 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/all_d.js +++ b/doc/SDK-GFN-RUNTIME/html/search/all_d.js @@ -1,7 +1,11 @@ var searchData= [ ['savecallbacksig',['SaveCallbackSig',['../_gfn_runtime_sdk___c_a_p_i_8h.html#aec727814832c039259304e7c7537ea16',1,'GfnRuntimeSdk_CAPI.h']]], + ['sessionid',['sessionId',['../struct_gfn_session_info.html#a142b6db024aa316970e6a3475ee3f5b1',1,'GfnSessionInfo']]], ['sessioninitcallbacksig',['SessionInitCallbackSig',['../_gfn_runtime_sdk___c_a_p_i_8h.html#aaf8c09b9174894c91b980a790c105008',1,'GfnRuntimeSdk_CAPI.h']]], + ['sessionmaxdurationsec',['sessionMaxDurationSec',['../struct_gfn_session_info.html#a38a6223c985c173f4d23755d5b738a6d',1,'GfnSessionInfo']]], + ['sessionrtxenabled',['sessionRTXEnabled',['../struct_gfn_session_info.html#ad0ff5b345cf86b40228da155cd887514',1,'GfnSessionInfo']]], + ['sessiontimeremainingsec',['sessionTimeRemainingSec',['../struct_gfn_session_info.html#af14993a3e1e7db0c4eb35b1309a46e2c',1,'GfnSessionInfo']]], ['startstreamcallbacksig',['StartStreamCallbackSig',['../_gfn_runtime_sdk___c_a_p_i_8h.html#adec3b60c6f670217c8067f1f0311d92e',1,'GfnRuntimeSdk_CAPI.h']]], ['startstreaminput',['StartStreamInput',['../struct_start_stream_input.html',1,'StartStreamInput'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#afd7de910963e8113f6595708bf5e8b2b',1,'StartStreamInput(): GfnRuntimeSdk_CAPI.h']]], ['startstreamresponse',['StartStreamResponse',['../struct_start_stream_response.html',1,'StartStreamResponse'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a1c8fd6acfeaf81aec3f6198e27450b8a',1,'StartStreamResponse(): GfnRuntimeSdk_CAPI.h']]], diff --git a/doc/SDK-GFN-RUNTIME/html/search/defines_2.js b/doc/SDK-GFN-RUNTIME/html/search/defines_2.js index 78f1573..52febce 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/defines_2.js +++ b/doc/SDK-GFN-RUNTIME/html/search/defines_2.js @@ -1,5 +1,4 @@ var searchData= [ - ['gfn_5fcallback',['GFN_CALLBACK',['../_gfn_sdk_8h.html#a6c0d24df59a5bd1c1fbf10cc0864d1d6',1,'GfnSdk.h']]], - ['gfnclientinfoversion',['GfnClientInfoVersion',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abfd3e6f52e0292fb4def9b0b93148978',1,'GfnRuntimeSdk_CAPI.h']]] + ['gfn_5fcallback',['GFN_CALLBACK',['../_gfn_sdk_8h.html#a6c0d24df59a5bd1c1fbf10cc0864d1d6',1,'GfnSdk.h']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/functions_0.js b/doc/SDK-GFN-RUNTIME/html/search/functions_0.js index 40d6c62..d81cf50 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/functions_0.js +++ b/doc/SDK-GFN-RUNTIME/html/search/functions_0.js @@ -6,7 +6,7 @@ var searchData= ['gfngetclientinfo',['gfnGetClientInfo',['../group__launcher.html#ga0a78ef87b1164626048c7c88b9de3284',1,'gfnGetClientInfo(GfnClientInfo *clientInfo): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga85103db7a6fc1dded77a1119ca182ddd',1,'GfnGetClientInfo(GfnClientInfo *clientInfo): GfnRuntimeSdk_Wrapper.h']]], ['gfngetclientip',['gfnGetClientIp',['../group__launcher.html#ga8c41a40828a5bd9a0cf087a0fd2757a8',1,'GfnRuntimeSdk_CAPI.h']]], ['gfngetclientipv4',['GfnGetClientIpV4',['../group__wrapper.html#ga1de5d6792f2d658886fe2be992945e69',1,'GfnRuntimeSdk_Wrapper.h']]], - ['gfngetclientlanguagecode',['GfnGetClientLanguageCode',['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h']]], + ['gfngetclientlanguagecode',['gfnGetClientLanguageCode',['../group__launcher.html#ga95ddfe6fabeec68eb40b2ffa28d604ec',1,'gfnGetClientLanguageCode(const char **ppchLanguageCode): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga20ea89be27f64ca0a15c397b112541d3',1,'GfnGetClientLanguageCode(const char **languageCode): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnerdata',['gfnGetPartnerData',['../group__launcher.html#ga16c67cdee702190faf8b8682f760a339',1,'gfnGetPartnerData(const char **ppchPartnerData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9223905a2b1279a175f9b5bdbc40838c',1,'GfnGetPartnerData(const char **partnerData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetpartnersecuredata',['gfnGetPartnerSecureData',['../group__launcher.html#gaeddedbabbd2d5da5d525bb737b26c820',1,'gfnGetPartnerSecureData(const char **ppchPartnerSecureData): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab4760d499a669358847649c9dc44a433',1,'GfnGetPartnerSecureData(const char **partnerSecureData): GfnRuntimeSdk_Wrapper.h']]], ['gfngetsessioninfo',['GfnGetSessionInfo',['../group__wrapper.html#ga2bbf214d68c42487b1e33f789e87330d',1,'GfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga1f994c00e0579443e6cc920dd4a1c853',1,'gfnGetSessionInfo(GfnSessionInfo *sessionInfo): GfnRuntimeSdk_CAPI.h']]], @@ -18,7 +18,7 @@ var searchData= ['gfnisrunningincloud',['GfnIsRunningInCloud',['../group__wrapper.html#gaa109bc7e726c5991c2efcbce8e4c0f64',1,'GfnIsRunningInCloud(bool *runningInCloud): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga3b33985a46d6bd20fdea2c4865dc6a0f',1,'gfnIsRunningInCloud(): GfnRuntimeSdk_CAPI.h']]], ['gfnisrunningincloudsecure',['gfnIsRunningInCloudSecure',['../group__launcher.html#gaf5ab33bd8cd24cb26cda5bacf1764e3f',1,'gfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga6fa2dbe2bfa3e67cd41963bf28ac5e65',1,'GfnIsRunningInCloudSecure(GfnIsRunningInCloudAssurance *assurance): GfnRuntimeSdk_Wrapper.h']]], ['gfnistitleavailable',['GfnIsTitleAvailable',['../group__wrapper.html#gad9c160b9ea4921de4ca57d48ede5c9be',1,'GfnIsTitleAvailable(const char *platformAppId, bool *isAvailable): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa8b07a70503f2a24b6625fc5a7eef9cb',1,'gfnIsTitleAvailable(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], - ['gfnregisterclientinfocallback',['GfnRegisterClientInfoCallback',['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], + ['gfnregisterclientinfocallback',['gfnRegisterClientInfoCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#abae3540f316b5bbd5e72b0071d3f3d5a',1,'gfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga5999e9e8f42d975ac1b13537c5f44497',1,'GfnRegisterClientInfoCallback(ClientInfoCallbackSig clientInfoCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisterexitcallback',['GfnRegisterExitCallback',['../group__wrapper.html#ga25cb8c18e2940a583a481612b1847a94',1,'GfnRegisterExitCallback(ExitCallbackSig exitCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../group__callbacks.html#ga1bcb62aa8313bbe205ea4cb40246ee72',1,'gfnRegisterExitCallback(ExitCallbackSig exitCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnregisterinstallcallback',['gfnRegisterInstallCallback',['../group__callbacks.html#gaf315563a9205712a40e7a842af2ac91b',1,'gfnRegisterInstallCallback(InstallCallbackSig installCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga9a4a6595694aabf923dba25149827b9f',1,'GfnRegisterInstallCallback(InstallCallbackSig installCallback, void *userContext): GfnRuntimeSdk_Wrapper.h']]], ['gfnregisternetworkstatuscallback',['gfnRegisterNetworkStatusCallback',['../_gfn_runtime_sdk___c_a_p_i_8h.html#acaa9b6d41eac3e072f93f33429bba5e5',1,'gfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *pUserContext): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga281cfc18e961dfcd537dce5ad4a73519',1,'GfnRegisterNetworkStatusCallback(NetworkStatusCallbackSig networkStatusCallback, unsigned int updateRateMs, void *userContext): GfnRuntimeSdk_Wrapper.h']]], @@ -28,14 +28,14 @@ var searchData= ['gfnregisterstreamstatuscallback',['GfnRegisterStreamStatusCallback',['../group__wrapper.html#ga658250f0c2178a8181bdc62b332c5aaf',1,'GfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *userContext): GfnRuntimeSdk_Wrapper.h'],['../_gfn_runtime_sdk___c_a_p_i_8h.html#a63f79659507415464e65d3feb96ba15a',1,'gfnRegisterStreamStatusCallback(StreamStatusCallbackSig streamStatusCallback, void *pUserContext): GfnRuntimeSdk_CAPI.h']]], ['gfnsdk_5ffailed',['GFNSDK_FAILED',['../_gfn_sdk_8h.html#af1ab63ffcd0ec8cf72faabdc89ada570',1,'GfnSdk.h']]], ['gfnsdk_5fsucceeded',['GFNSDK_SUCCEEDED',['../_gfn_sdk_8h.html#a3c1aa70801550fa1a48ab6fe0303a35c',1,'GfnSdk.h']]], - ['gfnsetactionzone',['gfnSetActionZone',['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h']]], + ['gfnsetactionzone',['GfnSetActionZone',['../group__wrapper.html#ga1d0b3d941ab0d2127282d79df49a9130',1,'GfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaa5e1081ccd6b903f12a6b9f05b11bf03',1,'gfnSetActionZone(GfnActionType type, unsigned int id, GfnRect *zone): GfnRuntimeSdk_CAPI.h']]], ['gfnsetuptitle',['GfnSetupTitle',['../group__wrapper.html#ga764b9212ff5bfa2bc67f49034afa9b06',1,'GfnSetupTitle(const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gac3fd7e969aeaf3992dbb4e8220cacc6d',1,'gfnSetupTitle(const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]], ['gfnshutdownruntimesdk',['gfnShutdownRuntimeSdk',['../group__general.html#gaef511b26bef12e55c0c12ea4911005a7',1,'GfnRuntimeSdk_CAPI.h']]], ['gfnshutdownsdk',['GfnShutdownSdk',['../group__wrapper.html#ga3f9e4989832c06a2e431f997848732ac',1,'GfnRuntimeSdk_Wrapper.h']]], ['gfnstartstream',['gfnStartStream',['../group__launcher.html#gaa2d0aa6c6d9325ff2ff5e2beb82c47d6',1,'gfnStartStream(StartStreamInput *pStartStreamInput, StartStreamResponse *response): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#ga8b35031da8034f2c2e85f2f1b8ec127c',1,'GfnStartStream(StartStreamInput *startStreamInput, StartStreamResponse *response): GfnRuntimeSdk_Wrapper.h']]], - ['gfnstartstreamasync',['gfnStartStreamAsync',['../group__launcher.html#gac080be91f1f7c784b42147101ece1c93',1,'gfnStartStreamAsync(const StartStreamInput *pStartStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gab2292fb37704156a096875c1a5c60be2',1,'GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h']]], + ['gfnstartstreamasync',['GfnStartStreamAsync',['../group__wrapper.html#gab2292fb37704156a096875c1a5c60be2',1,'GfnStartStreamAsync(const StartStreamInput *startStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gac080be91f1f7c784b42147101ece1c93',1,'gfnStartStreamAsync(const StartStreamInput *pStartStreamInput, StartStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h']]], ['gfnstopstream',['GfnStopStream',['../group__wrapper.html#ga5010fe92907ea2e4df986697d51acecc',1,'GfnStopStream(void): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gaf187e90d0ba2eb566244c2d302fed86e',1,'gfnStopStream(void): GfnRuntimeSdk_CAPI.h']]], ['gfnstopstreamasync',['GfnStopStreamAsync',['../group__wrapper.html#gaefae1a18a508d60d0bf4f8baf1c1f3ee',1,'GfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#ga2392b3feb76dc6e77cc32d39c7193428',1,'gfnStopStreamAsync(StopStreamCallbackSig cb, void *context, unsigned int timeoutMs): GfnRuntimeSdk_CAPI.h']]], ['gfnstreamstatustostring',['GfnStreamStatusToString',['../_gfn_runtime_sdk___c_a_p_i_8h.html#a20888129fbf3905d65cbc96d84b76f55',1,'GfnRuntimeSdk_CAPI.h']]], - ['gfntitleexited',['gfnTitleExited',['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h'],['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h']]] + ['gfntitleexited',['GfnTitleExited',['../group__wrapper.html#gac34f26953cd4f1ff82f37f0f84de8332',1,'GfnTitleExited(const char *platformId, const char *platformAppId): GfnRuntimeSdk_Wrapper.h'],['../group__launcher.html#gab50035d62ed28d63d1033694b0655f6d',1,'gfnTitleExited(const char *pchPlatformId, const char *pchPlatformAppId): GfnRuntimeSdk_CAPI.h']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/searchdata.js b/doc/SDK-GFN-RUNTIME/html/search/searchdata.js index ce1cae5..66f1997 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/searchdata.js +++ b/doc/SDK-GFN-RUNTIME/html/search/searchdata.js @@ -4,7 +4,7 @@ var indexSectionsWithContent = 1: "gst", 2: "g", 3: "g", - 4: "cdfilnoprtuv", + 4: "cdfilnoprstuv", 5: "abceginpst", 6: "g", 7: "cg", diff --git a/doc/SDK-GFN-RUNTIME/html/search/variables_9.js b/doc/SDK-GFN-RUNTIME/html/search/variables_9.js index 4752589..8fc0b8e 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/variables_9.js +++ b/doc/SDK-GFN-RUNTIME/html/search/variables_9.js @@ -1,4 +1,7 @@ var searchData= [ - ['tokentype',['tokenType',['../struct_start_stream_input.html#abaaa079b12040eaaca900ef1bf2fc1f5',1,'StartStreamInput']]] + ['sessionid',['sessionId',['../struct_gfn_session_info.html#a142b6db024aa316970e6a3475ee3f5b1',1,'GfnSessionInfo']]], + ['sessionmaxdurationsec',['sessionMaxDurationSec',['../struct_gfn_session_info.html#a38a6223c985c173f4d23755d5b738a6d',1,'GfnSessionInfo']]], + ['sessionrtxenabled',['sessionRTXEnabled',['../struct_gfn_session_info.html#ad0ff5b345cf86b40228da155cd887514',1,'GfnSessionInfo']]], + ['sessiontimeremainingsec',['sessionTimeRemainingSec',['../struct_gfn_session_info.html#af14993a3e1e7db0c4eb35b1309a46e2c',1,'GfnSessionInfo']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/variables_a.js b/doc/SDK-GFN-RUNTIME/html/search/variables_a.js index 0fd7bb9..4752589 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/variables_a.js +++ b/doc/SDK-GFN-RUNTIME/html/search/variables_a.js @@ -1,5 +1,4 @@ var searchData= [ - ['uititleid',['uiTitleId',['../struct_start_stream_input.html#ad57e93fa51f18c6781183e4fb46f8781',1,'StartStreamInput']]], - ['updatetype',['updateType',['../struct_gfn_client_info_update_data.html#a8eb00d33c3bde2c67e6d58251a25c10d',1,'GfnClientInfoUpdateData::updateType()'],['../struct_gfn_network_status_update_data.html#a73dbf403f37ca475c7f2b46846856903',1,'GfnNetworkStatusUpdateData::updateType()']]] + ['tokentype',['tokenType',['../struct_start_stream_input.html#abaaa079b12040eaaca900ef1bf2fc1f5',1,'StartStreamInput']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/variables_b.js b/doc/SDK-GFN-RUNTIME/html/search/variables_b.js index 81acf9e..0fd7bb9 100644 --- a/doc/SDK-GFN-RUNTIME/html/search/variables_b.js +++ b/doc/SDK-GFN-RUNTIME/html/search/variables_b.js @@ -1,8 +1,5 @@ var searchData= [ - ['value1',['value1',['../struct_gfn_rect.html#af6cbbbd5b088957ea37b21e5e2f95afd',1,'GfnRect']]], - ['value2',['value2',['../struct_gfn_rect.html#af55a73adc4c05b52d206f13f83839c19',1,'GfnRect']]], - ['value3',['value3',['../struct_gfn_rect.html#a91ebd91af32855ddd55b665d535e61fa',1,'GfnRect']]], - ['value4',['value4',['../struct_gfn_rect.html#aa9bc8ec90f72855dd9442c9c3784d12a',1,'GfnRect']]], - ['version',['version',['../struct_gfn_client_info.html#a533f28045503bfb33083754eade3f61e',1,'GfnClientInfo::version()'],['../struct_gfn_client_info_update_data.html#a13b1c3fb75957cfeb0dcd5709b0c7ee4',1,'GfnClientInfoUpdateData::version()'],['../struct_gfn_network_status_update_data.html#a18371310b7edb47ae9fe50d01d705c90',1,'GfnNetworkStatusUpdateData::version()']]] + ['uititleid',['uiTitleId',['../struct_start_stream_input.html#ad57e93fa51f18c6781183e4fb46f8781',1,'StartStreamInput']]], + ['updatetype',['updateType',['../struct_gfn_client_info_update_data.html#a8eb00d33c3bde2c67e6d58251a25c10d',1,'GfnClientInfoUpdateData::updateType()'],['../struct_gfn_network_status_update_data.html#a73dbf403f37ca475c7f2b46846856903',1,'GfnNetworkStatusUpdateData::updateType()']]] ]; diff --git a/doc/SDK-GFN-RUNTIME/html/search/variables_c.html b/doc/SDK-GFN-RUNTIME/html/search/variables_c.html new file mode 100644 index 0000000..d5f4449 --- /dev/null +++ b/doc/SDK-GFN-RUNTIME/html/search/variables_c.html @@ -0,0 +1,26 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/doc/SDK-GFN-RUNTIME/html/search/variables_c.js b/doc/SDK-GFN-RUNTIME/html/search/variables_c.js new file mode 100644 index 0000000..81acf9e --- /dev/null +++ b/doc/SDK-GFN-RUNTIME/html/search/variables_c.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['value1',['value1',['../struct_gfn_rect.html#af6cbbbd5b088957ea37b21e5e2f95afd',1,'GfnRect']]], + ['value2',['value2',['../struct_gfn_rect.html#af55a73adc4c05b52d206f13f83839c19',1,'GfnRect']]], + ['value3',['value3',['../struct_gfn_rect.html#a91ebd91af32855ddd55b665d535e61fa',1,'GfnRect']]], + ['value4',['value4',['../struct_gfn_rect.html#aa9bc8ec90f72855dd9442c9c3784d12a',1,'GfnRect']]], + ['version',['version',['../struct_gfn_client_info.html#a533f28045503bfb33083754eade3f61e',1,'GfnClientInfo::version()'],['../struct_gfn_client_info_update_data.html#a13b1c3fb75957cfeb0dcd5709b0c7ee4',1,'GfnClientInfoUpdateData::version()'],['../struct_gfn_network_status_update_data.html#a18371310b7edb47ae9fe50d01d705c90',1,'GfnNetworkStatusUpdateData::version()']]] +]; diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html index 166ca16..46fc84c 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info-members.html @@ -93,8 +93,10 @@

    This is the complete list of members for GfnSessionInfo, including all inherited members.

    Language API
    - - + + + +
    sessionMaxDurationSec (defined in GfnSessionInfo)GfnSessionInfo
    sessionTimeRemainingSec (defined in GfnSessionInfo)GfnSessionInfo
    sessionIdGfnSessionInfo
    sessionMaxDurationSecGfnSessionInfo
    sessionRTXEnabledGfnSessionInfo
    sessionTimeRemainingSecGfnSessionInfo
    diff --git a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html index b15c41b..1130f4b 100644 --- a/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html +++ b/doc/SDK-GFN-RUNTIME/html/struct_gfn_session_info.html @@ -102,11 +102,21 @@

    Public Attributes

    -unsigned int sessionMaxDurationSec +unsigned int sessionMaxDurationSec + Maximum total time allowed for the session in seconds.
      -unsigned int sessionTimeRemainingSec +unsigned int sessionTimeRemainingSec + Nominal time remaining in the session in seconds.
      + +char sessionId [SESSION_ID_SIZE] + NVIDIA-defined unique indentifier for the session.
    +  + +bool sessionRTXEnabled + Defines if RTX support is enabled for the session.

    Detailed Description

    Session info blob.

    diff --git a/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html b/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html index 1ac5b0f..1907caf 100644 --- a/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html +++ b/doc/SDK-GFN-RUNTIME/html/wrapper_apis.html @@ -168,7 +168,7 @@

    Description
    Calls gfnIsRunningInCloudSecure to determine if calling application is running in GFN environment, and what level of security assurance that the result is valid.
    Environment
    Cloud and Client
    Usage
    Call from an NVIDIA-approved process to securely determine whether running in GFN cloud, and use the GfnIsRunningInCloudAssurance value to decide the risk to enable any application specific logic for that environment.
    -
    Warning
    TThis API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudassurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
    +
    Warning
    This API must be called from a process that has been registered with NVIDIA, or it will return an error. Refer to the Cloud Check API Guide on how to get your application registered. To prevent man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance to decide if the check was certain enough without tampering to enable the logic or feature associated with the API call.
    Parameters
    @@ -395,25 +395,25 @@

    assurance- Likelihood and level of security assurance defined via GfnIsRunningInCloudAssurance that API is running in GFN cloud environment
    C GfnGetSessionInfo
    -
    Description
    Gets information related to the current streaming session.
    +
    Description
    Gets various information about the current streaming session
    Environment
    Cloud
    -
    Usage
    Call this to obtain information related to the streaming session
    +
    Usage
    Call this from a streaming session to find out more information about the session, such as session time remaining, or if RTX is enabled for the current session.
    Parameters
    - +
    [out]sessionInfo- A structure to hold session Info data
    sessionInfo- Pointer to a GfnSessionInfo struct.
    Return values
    - + - -
    gfnSuccess- On success
    gfnInvalidParameter- NULL pointer passed in
    gfnInvalidParameter- NULL pointer passed in or buffer length is too small
    gfnCallWrongEnvironment- If called in a client environment
    gfnCloudLibraryNotFound- GFN SDK cloud-side library could not be found
    gfnAPINotFound- The API was not found in the GFN SDK Library
    +
    Returns
    Otherwise, appropriate error code
    +
    Note
    If the application has called gfnRegisterSessionInitCallback to be notified when a user connects, then this API should be called after that callback is triggered. Certain data, such as session time limit or RTX support, can only be defined when a user connects as the values depend on the user type. Calling before that point can result in obtaining incorrect data.
    diff --git a/include/GfnRuntimeSdk_CAPI.h b/include/GfnRuntimeSdk_CAPI.h index 9965222..d1e73c0 100644 --- a/include/GfnRuntimeSdk_CAPI.h +++ b/include/GfnRuntimeSdk_CAPI.h @@ -186,6 +186,12 @@ /// /// Language | API /// -------- | ------------------------------------- +/// C | @ref gfnGetSessionInfo +/// +/// @copydoc gfnGetSessionInfo +/// +/// Language | API +/// -------- | ------------------------------------- /// C | @ref gfnStartStream /// /// @copydoc gfnStartStream @@ -226,6 +232,11 @@ /// /// @copydoc gfnAppReady /// +/// Language | API +/// -------- | ------------------------------------- +/// C | @ref gfnSetActionZone +/// +/// @copydoc gfnSetActionZone /// @subsection callback_section Callback-related Methods /// @ref callbacks /// @@ -255,9 +266,9 @@ /// /// Language | API /// -------- | ------------------------------------- -/// C | @ref gfnSetActionZone +/// C | @ref gfnRegisterSessionInitCallback /// -/// @copydoc gfnSetActionZone +/// @copydoc gfnRegisterSessionInitCallback /// /// Language | API /// -------- | ------------------------------------- @@ -387,11 +398,11 @@ } GfnActionType; - #define GfnClientInfoVersion (2) ///< Deprecated, usage will be ignored #define IP_V4_SIZE (17) // INET_ADDRSTRLEN + NULL #define IP_V6_SIZE (49) // INET6_ADDRSTRLEN + NULL #define CC_SIZE (3) // ISO 3166-1 Alpha-2 #define LOCALE_SIZE (6) // ISO 639-1 Alpha-2 + #define SESSION_ID_SIZE (38) /// @brief Types of operating systems that can be reported by the SDK typedef enum GfnOsType @@ -462,8 +473,10 @@ /// @brief Session info blob typedef struct { - unsigned int sessionMaxDurationSec; - unsigned int sessionTimeRemainingSec; + unsigned int sessionMaxDurationSec; ///< Maximum total time allowed for the session in seconds + unsigned int sessionTimeRemainingSec; ///< Nominal time remaining in the session in seconds + char sessionId[SESSION_ID_SIZE]; ///< NVIDIA-defined unique indentifier for the session + bool sessionRTXEnabled; ///< Defines if RTX support is enabled for the session } GfnSessionInfo; // ============================================================================================ @@ -758,7 +771,7 @@ /// for that environment. /// /// @warning - /// This API must be called from a process that has been registed with NVIDIA, or it will return an error. + /// This API must be called from a process that has been registered with NVIDIA, or it will return an error. /// Refer to the Cloud Check API Guide on how to get your application registered. To prevent /// man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity /// of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance @@ -955,13 +968,14 @@ /// /// @par Description - /// Gets various information about the current game session + /// Gets various information about the current streaming session /// /// @par Environment /// Cloud /// /// @par Usage - /// Call this during game play to find session time remaining. + /// Call this from a streaming session to find out more information about the session, such + /// as session time remaining, or if RTX is enabled for the current session. /// /// @param sessionInfo - Pointer to a GfnSessionInfo struct. @@ -970,6 +984,12 @@ /// @retval gfnInvalidParameter - NULL pointer passed in or buffer length is too small /// @retval gfnCallWrongEnvironment - If called in a client environment /// @return Otherwise, appropriate error code + /// @note + /// If the application has called @ref gfnRegisterSessionInitCallback to be notified when a + /// user connects, then this API should be called after that callback is triggered. + /// Certain data, such as session time limit or RTX support, can only be defined when a user + /// connects as the values depend on the user type. Calling before that point can result in + /// obtaining incorrect data. NVGFNSDK_EXPORT GfnRuntimeError gfnGetSessionInfo(GfnSessionInfo* sessionInfo); /// diff --git a/include/GfnRuntimeSdk_Wrapper.c b/include/GfnRuntimeSdk_Wrapper.c index 8debc78..3e48adc 100644 --- a/include/GfnRuntimeSdk_Wrapper.c +++ b/include/GfnRuntimeSdk_Wrapper.c @@ -770,7 +770,6 @@ GfnRuntimeError GfnGetClientInfo(GfnClientInfo* clientInfo) GFN_SDK_LOG("Calling GfnGetClientInfo"); CHECK_NULL_PARAM(clientInfo); CHECK_CLOUD_ENVIRONMENT(); - clientInfo->version = GfnClientInfoVersion; DELEGATE_TO_CLOUD_LIBRARY(GetClientInfo, clientInfo); } diff --git a/include/GfnRuntimeSdk_Wrapper.h b/include/GfnRuntimeSdk_Wrapper.h index 7e303a5..992092e 100644 --- a/include/GfnRuntimeSdk_Wrapper.h +++ b/include/GfnRuntimeSdk_Wrapper.h @@ -367,7 +367,7 @@ extern "C" /// for that environment. /// /// @warning - /// This API must be called from a process that has been registed with NVIDIA, or it will return an error. + /// This API must be called from a process that has been registered with NVIDIA, or it will return an error. /// Refer to the Cloud Check API Guide on how to get your application registered. To prevent /// man-in-the-middle (MiM) attacks, you must also securely load the SDK library, checking the integrity /// of the digital signature on the binary. Make sure to use the value returned from GfnIsRunningInCloudAssurance @@ -470,21 +470,28 @@ extern "C" /// /// @par Description - /// Gets information related to the current streaming session. + /// Gets various information about the current streaming session /// /// @par Environment /// Cloud /// /// @par Usage - /// Call this to obtain information related to the streaming session + /// Call this from a streaming session to find out more information about the session, such + /// as session time remaining, or if RTX is enabled for the current session. /// - /// @param[out] sessionInfo - A structure to hold session Info data + /// @param sessionInfo - Pointer to a GfnSessionInfo struct. + /// /// @retval gfnSuccess - On success - /// @retval gfnInvalidParameter - NULL pointer passed in + /// @retval gfnInvalidParameter - NULL pointer passed in or buffer length is too small /// @retval gfnCallWrongEnvironment - If called in a client environment - /// @retval gfnCloudLibraryNotFound - GFN SDK cloud-side library could not be found - /// @retval gfnAPINotFound - The API was not found in the GFN SDK Library + /// @return Otherwise, appropriate error code + /// @note + /// If the application has called @ref gfnRegisterSessionInitCallback to be notified when a + /// user connects, then this API should be called after that callback is triggered. + /// Certain data, such as session time limit or RTX support, can only be defined when a user + /// connects as the values depend on the user type. Calling before that point can result in + /// obtaining incorrect data. GfnRuntimeError GfnGetSessionInfo(GfnSessionInfo* sessionInfo); /// diff --git a/include/GfnSdk.h b/include/GfnSdk.h index 0b40252..4770e26 100644 --- a/include/GfnSdk.h +++ b/include/GfnSdk.h @@ -78,28 +78,28 @@ typedef char bool; #define NVGFNSDK_VERSION_MAJOR 1 /// @brief GFN SDK Minor Version -#define NVGFNSDK_VERSION_MINOR 10 +#define NVGFNSDK_VERSION_MINOR 11 /// @brief GFN SDK Version -#define NVGFNSDK_VERSION_SHORT 1.10 +#define NVGFNSDK_VERSION_SHORT 1.11 /// @brief GFN SDK Patch Version #define NVGFNSDK_VERSION_PATCH 0 /// @brief GFN SDK Build Version -#define NVGFNSDK_VERSION_BUILD 32038373 +#define NVGFNSDK_VERSION_BUILD 32558885 /// @brief GFN SDK Version -#define NVGFNSDK_VERSION_LONG 1.10.0.32038373 +#define NVGFNSDK_VERSION_LONG 1.11.0.32558885 /// @brief GFN SDK Version string -#define NVGFNSDK_VERSION_STR "1.10.0.32038373" -#define NVGFNSDK_VERSION_STR_PROD "1.10.0" +#define NVGFNSDK_VERSION_STR "1.11.0.32558885" +#define NVGFNSDK_VERSION_STR_PROD "1.11.0" /// @brief GFN SDK Build CL -#define NVGFNSDK_VERSION_BUILDCL 32038373 -#define NVGFNSDK_VERSION_BUILDH 3203 -#define NVGFNSDK_VERSION_BUILDL 8373 +#define NVGFNSDK_VERSION_BUILDCL 32558885 +#define NVGFNSDK_VERSION_BUILDH 3255 +#define NVGFNSDK_VERSION_BUILDL 8885 #ifdef __cplusplus @@ -247,6 +247,7 @@ typedef char bool; GfnRectFormat format; ///< rect format as listed in GfnRectFormat } GfnRect; + #ifdef __cplusplus } // extern "C" #endif diff --git a/lib/x64/GfnRuntimeSdk.dll b/lib/x64/GfnRuntimeSdk.dll index de4f711..ece75eb 100644 Binary files a/lib/x64/GfnRuntimeSdk.dll and b/lib/x64/GfnRuntimeSdk.dll differ diff --git a/lib/x86/GfnRuntimeSdk.dll b/lib/x86/GfnRuntimeSdk.dll index c20efc8..e6f71cf 100644 Binary files a/lib/x86/GfnRuntimeSdk.dll and b/lib/x86/GfnRuntimeSdk.dll differ diff --git a/samples/CGameAPISample/CMakeLists.txt b/samples/CGameAPISample/CMakeLists.txt index d124b89..f7eee5a 100644 --- a/samples/CGameAPISample/CMakeLists.txt +++ b/samples/CGameAPISample/CMakeLists.txt @@ -6,7 +6,7 @@ set(GFN_SDK_SAMPLE_SOURCES ) add_executable(CGameAPISample ${GFN_SDK_SAMPLE_SOURCES}) -set_target_properties(CGameAPISample PROPERTIES FOLDER "Dist/Samples") +set_target_properties(CGameAPISample PROPERTIES FOLDER "Samples") set_target_properties(CGameAPISample PROPERTIES LINK_FLAGS "/ignore:4099") target_include_directories(CGameAPISample PRIVATE ${GFN_SDK_DIST_DIR}/include) diff --git a/samples/CGameAPISample/SampleModule.c b/samples/CGameAPISample/SampleModule.c index cab5a54..53ff4f0 100644 --- a/samples/CGameAPISample/SampleModule.c +++ b/samples/CGameAPISample/SampleModule.c @@ -27,7 +27,7 @@ #include #include -#include "GfnRuntimeSdk_CAPI.h" +#include "GfnRuntimeSdk_Wrapper.h" extern bool g_MainDone; @@ -69,7 +69,7 @@ GfnApplicationCallbackResult GFN_CALLBACK SessionInit(const char* params, void* GfnError runtimeError = GfnAppReady(false, "Abcd"); if (runtimeError == gfnSuccess) { - printf("Reported 'AppReady' with failure to the SDK\n"); + printf("Reported 'AppReady' with success to the SDK\n"); } else { diff --git a/samples/SDKDllDirectRefSample/CMakeLists.txt b/samples/SDKDllDirectRefSample/CMakeLists.txt index ab22beb..a6103eb 100644 --- a/samples/SDKDllDirectRefSample/CMakeLists.txt +++ b/samples/SDKDllDirectRefSample/CMakeLists.txt @@ -6,7 +6,7 @@ set(GFN_SDK_SAMPLE_SOURCES ) add_executable(SDKDllDirectRefSample ${GFN_SDK_SAMPLE_SOURCES}) -set_target_properties(SDKDllDirectRefSample PROPERTIES FOLDER "Dist/Samples") +set_target_properties(SDKDllDirectRefSample PROPERTIES FOLDER "Samples") set_target_properties(SDKDllDirectRefSample PROPERTIES LINK_FLAGS "/ignore:4099") target_include_directories(SDKDllDirectRefSample PRIVATE ${GFN_SDK_DIST_DIR}/include) diff --git a/samples/SampleLauncher/src/CMakeLists.txt b/samples/SampleLauncher/src/CMakeLists.txt index b571de7..fc74b9b 100644 --- a/samples/SampleLauncher/src/CMakeLists.txt +++ b/samples/SampleLauncher/src/CMakeLists.txt @@ -62,7 +62,7 @@ macro(SET_EXAMPLE_PROPERTIES target) if(OS_MACOSX OR OS_WINDOWS) # Place the target in the "examples" folder in Visual Studio and Xcode. - set_property(TARGET ${target} PROPERTY FOLDER "Dist/Samples") + set_property(TARGET ${target} PROPERTY FOLDER "Samples") endif() endmacro() diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc b/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc index f8aef46..1741809 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc +++ b/samples/SampleLauncher/src/gfn_sdk_demo/gfn_sdk_helper.cc @@ -658,6 +658,8 @@ bool GfnSdkHelper(CefRefPtr browser, { response_dict->SetInt("sessionMaxDurationSec", sessionInfo.sessionMaxDurationSec); response_dict->SetInt("sessionTimeRemainingSec", sessionInfo.sessionTimeRemainingSec); + response_dict->SetString("sessionID", sessionInfo.sessionId); + response_dict->SetInt("sessionRTXEnabled", sessionInfo.sessionRTXEnabled); } CefString response(DictToJson(response_dict)); LOG(INFO) << "GfnGetSessionInfo data: " << response.ToString(); diff --git a/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html b/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html index ab488a9..5bbcad2 100644 --- a/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html +++ b/samples/SampleLauncher/src/gfn_sdk_demo/resources/gfn_sdk.html @@ -746,7 +746,8 @@ /** * Calls into GFN SDK to get information about current streaming session. This is meant to be * called while running on the GeForce NOW game seat to make decisions based on session length, - * and how much time is remaining in the session. + * and how much time is remaining in the session, RTX support, as well as getting the session ID + * for trackaing purposes. */ function getSessionInfo() { setStatus('Getting Session Info...'); diff --git a/samples/SampleService/CMakeLists.txt b/samples/SampleService/CMakeLists.txt deleted file mode 100644 index c6a409b..0000000 --- a/samples/SampleService/CMakeLists.txt +++ /dev/null @@ -1,71 +0,0 @@ -#sampleapplib static lib -set(SRV_LIB - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/deserialize_buffer.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/deserialize_iterator.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/lpc_pipe.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/lpc_pipe.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/memory_view.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/serialize_common.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/serialize_iterator.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/traits.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/transport.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/utils.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/common/utils.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/client.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/client.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/command.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/port_name.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/server.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/server.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/status.h - ${CMAKE_CURRENT_SOURCE_DIR}/../../include/GfnRuntimeSdk_Wrapper.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../include/GfnSdk_SecureLoadLibrary.c -) -add_library(SampleServiceLib STATIC ${SRV_LIB}) -set_source_files_properties(${SRV_LIB} PROPERTIES COMPILE_FLAGS "/wd4996") -set_source_files_properties(${SRV_LIB} PROPERTIES COMPILE_FLAGS "/wd4244") -target_include_directories(SampleServiceLib - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/common - ${GFN_SDK_DIST_DIR}/include -) -target_compile_features(SampleServiceLib PRIVATE cxx_std_17) -target_compile_definitions(SampleServiceLib - PRIVATE - GFN_SDK_WRAPPER_LOG - _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING) -set_target_properties(SampleServiceLib PROPERTIES FOLDER "Samples/GfnSdkSampleService/") -set_target_properties(SampleServiceLib PROPERTIES OUTPUT_NAME SampleServiceLib) - -#Sample Service executable -set(SAMPLE_SRV_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/src/svc/instance.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/svc/instance.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/svc/service.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/svc/service.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/svc/main.cpp -) -set_source_files_properties(${SAMPLE_SRV_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996") -set_source_files_properties(${SAMPLE_SRV_SRCS} PROPERTIES COMPILE_FLAGS "/wd4244") -add_executable(SampleService ${SAMPLE_SRV_SRCS}) -set_target_properties(SampleService PROPERTIES FOLDER "Samples/GfnSdkSampleService/") -target_link_libraries(SampleService PRIVATE SampleServiceLib) -target_include_directories(SampleService - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/common - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib -) - - if (SAMPLES_INSTALL_ROOT) - install(TARGETS SampleService - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT} - COMPONENT sample_bins - ) - endif () - if (SAMPLES_INSTALL_ROOT_VALVE) - install(TARGETS SampleService - DESTINATION ${PACK_SAMPLE_LAUNCHER_ROOT_VALVE} - COMPONENT sample_bins_valve - ) -endif () - diff --git a/samples/SampleService/src/common/deserialize_buffer.h b/samples/SampleService/src/common/deserialize_buffer.h deleted file mode 100644 index 335aad0..0000000 --- a/samples/SampleService/src/common/deserialize_buffer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include "traits.h" -#include "serialize_common.h" - -template -traits::enable_if_t, traits::integral_constant> -determine_packed_size(const T&) -{ - return {}; // returns cell_size * 2; -} - -template -traits::enable_if_t || traits::is_integral_v, traits::integral_constant> -determine_packed_size(const T&) -{ - return {}; // returns cell_size * 2 + sizeof(T); -} - -template -traits::enable_if_t, T> -determine_packed_size(const T&) -{ - static_assert(false, "We can determine sizes of nums, enums and PODs only"); - return T{}; -} - -template -static constexpr size_t estimated_size = decltype(determine_packed_size(T{}))::value; - -template -struct estimated_buffer_size_impl { - static constexpr size_t value = estimated_size + - estimated_buffer_size_impl::value; -}; - -template -struct estimated_buffer_size_impl -{ - static constexpr size_t value = estimated_size; -}; - -template -struct estimated_buffer_size -{ - // cell_size is first 8 bytes for arg count - static constexpr size_t value = cell_size + estimated_buffer_size_impl::value; -}; - -template -using deserialize_buffer = unsigned char[estimated_buffer_size::value]; diff --git a/samples/SampleService/src/common/deserialize_iterator.h b/samples/SampleService/src/common/deserialize_iterator.h deleted file mode 100644 index f1f007b..0000000 --- a/samples/SampleService/src/common/deserialize_iterator.h +++ /dev/null @@ -1,324 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include "serialize_common.h" -#include "traits.h" -#include "memory_view.h" -#include - -class DeserializeIterator -{ - DeserializeIterator(const DeserializeIterator&) = delete; - DeserializeIterator& operator=(const DeserializeIterator&) = delete; -public: - // Use this constructor, only when size of buffer is unknown (like in FilterGetMessage) - DeserializeIterator(const void* mem); - - DeserializeIterator(DeserializeIterator&&) = default; - - DeserializeIterator(const void* mem, size_t sz); - - template - T get() - { - return get_impl(); - } - - // cannot use get specialization, kind of sad - memory_view get_variable_buffer(); - - bool finalize() const; - bool has_error() const; - -private: - template - traits::enable_if_t, T> - get_impl() - { - static_assert(false, "Supported getters: integrals, enums, POD structs, wstring_t, array_t, UNICODE_STRING, memory_view"); - return T{}; - } - - template - traits::enable_if_t, INTEGRAL> - get_impl() - { - if (!initial_check(integral_type)) - { - return INTEGRAL{ 0 }; - } - ++m_curr_arg; - return get_integral(); - } - - template - traits::enable_if_t, ENUM> - get_impl() - { - if (!initial_check(enum_type)) - { - return ENUM::max_enum_value; - } - - static constexpr auto max_enum_value = static_cast>(ENUM::max_enum_value); - const auto raw_val = get_integral(); - if (raw_val >= max_enum_value) - { - set_error(); - return ENUM::max_enum_value; - } - ++m_curr_arg; - return static_cast(raw_val); - } - - template - traits::enable_if_t, POD_STRUCT> - get_impl() - { - if (!initial_check(pod_struct_type)) - { - return POD_STRUCT{}; - } - - const auto view = get_memory_view(); - if (view.size() != sizeof(POD_STRUCT)) - { - set_error(); - return POD_STRUCT{}; - } - - POD_STRUCT arg{}; - if (!safe_memcpy(&arg, view.mem(), sizeof(POD_STRUCT))) - { - set_error(); - } - ++m_curr_arg; - return arg; - } - - template<> - memory_view get_impl() - { - if (!initial_check(buffer_type)) - { - return{ nullptr, 0UL }; - } - ++m_curr_arg; - return get_memory_view(); - } - - template<> - array_t get_impl() - { - if (!initial_check(buffer_type)) - { - return{}; - } - ++m_curr_arg; - const auto view = get_memory_view(); - return{ view.mem(), view.size() + view.mem() }; - } - - template<> - wstring_t get_impl() - { - if (!initial_check(wstring_type)) - { - return{}; - } - - ++m_curr_arg; - const auto view = get_memory_view(); - - wstring_t ret(view.size() / sizeof(wchar_t), L'0'); - if (!safe_memcpy(&ret[0], view.mem(), view.size())) - { - set_error(); - } - return ret; - } - - template<> - string_t get_impl() - { - if (!initial_check(string_type)) - { - return{}; - } - ++m_curr_arg; - const auto view = get_memory_view(); - string_t ret(view.size(), '0'); - if (!safe_memcpy(&ret[0], view.mem(), view.size())) - { - set_error(); - } - return ret; - } - - bool initial_check(cell_type in_type); - void set_error(); - cell_type read_argc(); - - memory_view get_memory_view(); - - template - T get_integral(); - - static constexpr cell_type c_size_unknown{ 0ULL - 1 }; - - cell_type m_offset{ 0 }; - cell_type m_curr_arg{ 0 }; - bool m_error{ false }; - - const char* m_mem; - const cell_type m_maxsize; - const cell_type m_argc; -}; - -inline DeserializeIterator::DeserializeIterator(const void* mem) - : m_mem(reinterpret_cast(mem)), m_maxsize(c_size_unknown), m_argc(read_argc()) -{} - -inline DeserializeIterator::DeserializeIterator(const void* mem, size_t sz) - : m_mem(reinterpret_cast(mem)), m_maxsize(static_cast(sz)), m_argc(read_argc()) -{} - -inline memory_view DeserializeIterator::get_variable_buffer() -{ - if (!initial_check(variable_buffer_type)) - { - return{ nullptr, 0UL }; - } - - ++m_curr_arg; - - const auto real_max_size = get_integral(); - const auto view = get_memory_view(); - if (has_error()) - { - return{ nullptr, 0UL }; - } - - if (has_error() || real_max_size < view.size()) - { - set_error(); - return{ nullptr, 0UL }; - } - - return{ view.mem(), view.size() }; -} - -inline bool DeserializeIterator::finalize() const -{ - bool error = has_error(); - error |= (m_argc != m_curr_arg); - - if (m_maxsize != c_size_unknown) - { - error |= (m_offset > m_maxsize); - } - - if (error) - { - assert(false); - } - - return !error; -} - -inline bool DeserializeIterator::has_error() const -{ - return m_error; -} - -inline void DeserializeIterator::set_error() -{ - m_error = true; -} - -inline bool DeserializeIterator::initial_check(cell_type in_type) -{ - if (has_error()) - { - return false; - } - - if (m_offset + cell_size + cell_size > m_maxsize) - { - set_error(); - return false; - } - - const auto type = get_integral(); - if (type != in_type) - { - set_error(); - return false; - } - return true; -} - -inline memory_view DeserializeIterator::get_memory_view() -{ - const auto buf_size = get_integral(); - if (has_error()) - { - return{ nullptr, 0UL }; - } - - if (buf_size + m_offset > m_maxsize) - { - set_error(); - return{ nullptr, 0UL }; - } - - m_offset += buf_size; - memory_view mv(m_mem + m_offset - buf_size, static_cast(buf_size)); - return mv; -} - -template -T DeserializeIterator::get_integral() -{ - if (m_offset + cell_size > m_maxsize) - { - set_error(); - return true; - } - - T ret{ 0 }; - __try { -#pragma warning( push ) // int -> bool conversion warning, we don't really care about performance penalty -#pragma warning( disable : 4800 ) - ret = static_cast(*reinterpret_cast(m_mem + m_offset)); -#pragma warning( pop ) - } __except (1) - { //DPANIN fixme - set_error(); - } - if (has_error()) - { - return 0; - } - - m_offset += cell_size; - return ret; -} - -inline cell_type DeserializeIterator::read_argc() -{ - if (m_mem == nullptr || m_maxsize < cell_size) - { - set_error(); - return 0; - } - - return get_integral(); -} diff --git a/samples/SampleService/src/common/lpc_pipe.cpp b/samples/SampleService/src/common/lpc_pipe.cpp deleted file mode 100644 index ae0ee1d..0000000 --- a/samples/SampleService/src/common/lpc_pipe.cpp +++ /dev/null @@ -1,678 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#include "lpc_pipe.h" -#include -#include -#include -#include - -using namespace SampleService; - -static const DWORD STATUS_PIPE_BROKEN = 0xc000014b; - -class SecurityAttributes -{ -public: - SecurityAttributes() - : m_full_access(false) - {} - - ~SecurityAttributes() - { - freeFullAccess(); - } - - bool makeFullAccess() - { - // Create a well-known SID for the Everyone group. - SID_IDENTIFIER_AUTHORITY sid_auth_world = SECURITY_WORLD_SID_AUTHORITY; - if (!AllocateAndInitializeSid(&sid_auth_world, 1, - SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &m_sid)) - { - std::cout << "Failed to initialized SID: " << GetLastError() << std::endl; - return false; - } - - // Initialize an EXPLICIT_ACCESS structure for an ACE. - // The ACE will allow Everyone full access to the file. - EXPLICIT_ACCESS explicit_access = {}; - explicit_access.grfAccessPermissions = GENERIC_ALL; - explicit_access.grfAccessMode = GRANT_ACCESS; - explicit_access.grfInheritance = CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE; - explicit_access.Trustee.TrusteeForm = TRUSTEE_IS_SID; - explicit_access.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; - explicit_access.Trustee.ptstrName = reinterpret_cast(m_sid); - - const auto result = SetEntriesInAcl(1, &explicit_access, nullptr, &m_acl); - if (result != ERROR_SUCCESS) - { - std::cout << "Failed to set entries in ACL: " << result << std::endl; - freeFullAccess(); - return false; - } - - if (InitializeSecurityDescriptor(&descriptor, SECURITY_DESCRIPTOR_REVISION) != TRUE) - { - std::cout << "Failed to initialize security descriptor: " << GetLastError() << std::endl; - freeFullAccess(); - return false; - } - - if (SetSecurityDescriptorDacl(&descriptor, true, m_acl, false) != TRUE) - { - std::cout << "Failed to set dacl to security descriptor: " << GetLastError() << std::endl; - freeFullAccess(); - return false; - } - - attributes.nLength = sizeof(attributes); - attributes.lpSecurityDescriptor = &descriptor; - attributes.bInheritHandle = false; - m_full_access = true; - return true; - } - - void freeFullAccess() - { - if (m_sid != nullptr) - { - FreeSid(m_sid); - m_sid = nullptr; - } - if (m_acl != nullptr) - { - LocalFree(m_acl); - m_acl = nullptr; - } - m_full_access = false; - } - - SECURITY_ATTRIBUTES* get() - { - return m_full_access ? &attributes : nullptr; - } - -private: - PSID m_sid = nullptr; - PACL m_acl = nullptr; - SECURITY_DESCRIPTOR descriptor = {}; - bool m_full_access; - SECURITY_ATTRIBUTES attributes; -}; - -struct transfered_pipe_message -{ - details::connection_control control; - char payload[1]; -}; - -static constexpr size_t CONTROL_SIZE = sizeof(transfered_pipe_message) - sizeof(char); - -bool LPCPipeContext::impersonate() -{ - if (m_impersonated) - { - return true; - } - - const auto result = ImpersonateNamedPipeClient(m_pipe); - if (!result) - { - std::cout << "ImpersonateNamedPipeClient() failed with: " << GetLastError() << std::endl; - return false; - } - - m_impersonated = true; - std::cout << "Impersonation is enabled for " << std::this_thread::get_id() << std::endl; - return true; -} - -bool LPCPipeContext::revertToSelf() -{ - if (!m_impersonated) - { - return true; - } - - const auto result = RevertToSelf(); - if (!result) - { - std::cout << "RevertToSelf() failed with: " << GetLastError() << std::endl; - return false; - } - - m_impersonated = false; - std::cout << "Impersonation is reverted for " << std::this_thread::get_id() << std::endl; - return true; -} - -void LPCPipeServer::checkFinishedListeners() -{ - if (m_listeners.empty()) return; - - for (auto& listener : m_listeners) - { - if (!listener->isConnected()) - { - std::cout << "Found a finished listener: " << (void*)listener << std::endl; - listener->join(); - delete listener; - listener = nullptr; - } - } - - const auto to_remove = std::remove(std::begin(m_listeners), std::end(m_listeners), nullptr); - - if (to_remove != m_listeners.end()) m_listeners.erase(to_remove, std::end(m_listeners)); -} - -void LPCPipeServer::stopAllListeners() -{ - std::cout << "Stopping all listeners" << std::endl; - m_running = false; - - for (auto& listener : m_listeners) - { - listener->interrupt(); - listener->join(); - delete listener; - listener = nullptr; - } - - m_listeners.clear(); -} - -void LPCPipeServer::accepterThread() -{ - while (m_running) - { - checkFinishedListeners(); - const auto result = accept(); - - switch(result.first) - { - case details::connection_result::failure: - case details::connection_result::interrupt: - std::cout << "Interrupt" << std::endl; - m_running = false; - break; - case details::connection_result::busy: - Sleep(10); - break; - case details::connection_result::success: - try - { - m_listeners.push_back(new LPCPipeListener{ result.second, *this }); - } - catch (const std::exception& e) - { - std::cout << "Exception when try to add listener: " << e.what() << std::endl; - CloseHandle(result.second); - } - break; - default: break; - } - } - - stopAllListeners(); -} - -LPCPipeServer::accept_result LPCPipeServer::accept() const -{ - SecurityAttributes attributes; - if (m_allow_non_admin) - { - if (!attributes.makeFullAccess()) - { - return { details::connection_result::failure, INVALID_HANDLE_VALUE }; - } - } - - auto pipe = CreateNamedPipeW( - m_name.c_str(), // pipe name - PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode - PIPE_WAIT, // blocking mode - static_cast(m_max_instances), // max. instances - DEFAULT_PIPE_BUFFER_SIZE, // output buffer size - DEFAULT_PIPE_BUFFER_SIZE, // input buffer size - 0, // client time-out - attributes.get()); // default security attribute - auto last_error = GetLastError(); - - if (pipe == INVALID_HANDLE_VALUE) - { - if (last_error == ERROR_PIPE_BUSY) - { - return{ details::connection_result::busy, INVALID_HANDLE_VALUE }; - } - - std::cout << "CreateNamedPipeW() failed with: " << last_error << std::endl; - return{ details::connection_result::failure, INVALID_HANDLE_VALUE }; - } - - std::cout << "Successfully created pipe named: " << m_name.c_str() << std::endl; - - auto result = ConnectNamedPipe(pipe, m_overlapped.get()) > 0; - last_error = GetLastError(); - - if (!result) - { - if (last_error == ERROR_IO_PENDING) - { - m_overlapped.wait(); - - if (!HasOverlappedIoCompleted(m_overlapped.get())) - { - CloseHandle(pipe); - return { details::connection_result::interrupt, INVALID_HANDLE_VALUE }; - } - - result = true; - } - else if (last_error == ERROR_PIPE_CONNECTED) - { - // already connected - result = true; - } - } - - if (!result) - { - std::cout << "ConnectNamedPipe() failed with: " << last_error << std::endl; - return { details::connection_result::failure, INVALID_HANDLE_VALUE }; - } - - return { details::connection_result::success, pipe }; -} - -LPCPipeServer::~LPCPipeServer() -{ - stop(); -} - -const std::function& LPCPipeServer::callback() const -{ - return m_incoming_message_callback; -} - -bool LPCPipeServer::start() -{ - m_overlapped.reset(); - - if (m_running) - { - std::cout << "Server is already running" << std::endl; - return true; - } - - m_running = true; - m_accepter = std::thread(&LPCPipeServer::accepterThread, this); - - return true; -} - -void LPCPipeServer::stop() -{ - std::lock_guard lock(m_stopping_mutex); - m_running = false; - m_overlapped.interrupt(); - if (m_accepter.joinable()) - { - m_accepter.join(); - } - stopAllListeners(); -} - -const std::wstring& LPCPipeServer::pipeName() const -{ - return m_name; -} - -bool LPCPipeServer::isRunning() const -{ - return m_running; -} - -void LPCPipeListener::listenerThread() -{ - if (!initialize()) - { - disconnect(); - return; - } - - while (m_server.isRunning()) - { - const auto control = receive(); - - if (control == details::connection_control::remote_disconnected) - { - break; - } - } - - disconnect(); -} - -bool LPCPipeListener::initialize() -{ - try - { - m_request_buffer.resize(DEFAULT_PIPE_BUFFER_SIZE); - m_reply_buffer.resize(DEFAULT_PIPE_BUFFER_SIZE); - } - catch (std::exception& e) - { - std::cout << "Exception occurred: " << e.what() << std::endl; - return false; - } - - return true; -} - -details::connection_control LPCPipeListener::receive() -{ - auto& request_buffer = *reinterpret_cast(m_request_buffer.data()); - auto& reply_buffer = *reinterpret_cast(m_reply_buffer.data()); - - DWORD bytes_read = 0; - auto result = ReadFile( - m_pipe, // handle to pipe - &request_buffer, // buffer to receive data - static_cast(m_request_buffer.size()), // size of buffer - &bytes_read, // number of bytes read - m_overlapped.get()); // not overlapped I/O - - auto last_error = GetLastError(); - - if (!result && last_error == ERROR_IO_PENDING) - { - m_overlapped.wait(); - result = true; - bytes_read = static_cast(m_overlapped.get()->InternalHigh); - - if (!HasOverlappedIoCompleted(m_overlapped.get())) - { - // NOTE: actually it's not that remote side is disconnected, but - // the IO has been interrupted - return details::connection_control::remote_disconnected; - } - - const auto ntstatus = static_cast(m_overlapped.get()->Internal); - - if (ntstatus == STATUS_PIPE_BROKEN) - { - return details::connection_control::remote_disconnected;; - } - } - else if (last_error == ERROR_BROKEN_PIPE) - { - return details::connection_control::remote_disconnected; - } - - if (bytes_read == 0) - { - std::cout << "ReadFile() failed with " << last_error << std::endl; - return details::connection_control::keep_connection; - } - - if (request_buffer.control == details::connection_control::disconnect) - { - return details::connection_control::remote_disconnected; - } - - DeserializeIterator request(&request_buffer.payload[0], bytes_read - CONTROL_SIZE); - unsigned long reply_size_ul = 0; - SerializeIterator reply(&reply_buffer.payload[0], m_reply_buffer.size() - CONTROL_SIZE, &reply_size_ul); - - try - { - LPCPipeContext ctx(m_pipe); - m_server.callback()(request, reply, ctx); - } - catch (const std::exception& e) - { - std::cout << "Exception while process message in lpc callback: " << e.what() << std::endl; - } - - DWORD bytes_written = 0; - result = WriteFile( - m_pipe, // handle to pipe - &reply_buffer, // buffer to write from - reply_size_ul + CONTROL_SIZE, // number of bytes to write - &bytes_written, // number of bytes written - m_overlapped.get()); // not overlapped I/O - - last_error = GetLastError(); - - if (!result && last_error == ERROR_IO_PENDING) - { - m_overlapped.wait(); - } - - return details::connection_control::keep_connection; -} - -void LPCPipeListener::disconnect() -{ - assert(m_pipe != INVALID_HANDLE_VALUE); - std::cout << "Disconnecting client from: " << m_server.pipeName().c_str() << std::endl; - FlushFileBuffers(m_pipe); - DisconnectNamedPipe(m_pipe); - CloseHandle(m_pipe); - m_pipe = INVALID_HANDLE_VALUE; - m_overlapped.interrupt(); - m_overlapped.reset(); -} - -bool LPCPipeClient::internalSend( - const details::connection_control control, - const uint32_t size, - uint32_t& reply_size) const -{ - auto& buffer = *(transfered_pipe_message*)m_request_buffer.data(); - - if (size > m_request_buffer.size() - CONTROL_SIZE) - { - std::cout << "size > m_request_buffer.size() - control_size" << std::endl; - return false; - } - - buffer.control = control; - - DWORD bytes_written = 0; - auto result = WriteFile( - m_pipe, // handle to pipe - &buffer, // buffer to write from - size + CONTROL_SIZE, // number of bytes to write - &bytes_written, // number of bytes written - m_overlapped.get()); // not overlapped I/O - - auto last_error = GetLastError(); - - if (!result && last_error == ERROR_IO_PENDING) - { - m_overlapped.wait(); - result = true; - bytes_written = (DWORD)m_overlapped.get()->InternalHigh; - last_error = GetLastError(); - } - - if (result == FALSE) - { - assert(L"this shouldn't happen if it does the pipe is probably broken(closed), handle this case"); - // and check the last_error here - return false; - } - - DWORD bytes_read = 0; - result = ReadFile( - m_pipe, // handle to pipe - (void*)&buffer, // buffer to receive data - (DWORD)m_request_buffer.size(), // size of buffer - &bytes_read, // number of bytes read - m_overlapped.get()); // not overlapped I/O - - last_error = GetLastError(); - - if (!result && last_error == ERROR_IO_PENDING) - { - m_overlapped.wait(); - result = true; - bytes_read = (DWORD)m_overlapped.get()->InternalHigh; - last_error = GetLastError(); - } - - reply_size = bytes_read - CONTROL_SIZE; - - return true; -} - -bool LPCPipeClient::send(uint32_t request_size, uint32_t& reply_size) const -{ - return internalSend(details::connection_control::keep_connection, request_size, reply_size); -} - -details::connection_result LPCPipeClient::internalConnect() -{ - using namespace details; - - if (!initialize()) - { - return connection_result::failure; - } - - if (isConnected()) - { - return connection_result::success; - } - - m_pipe = CreateFileW( - m_name.c_str(), // pipe name - GENERIC_READ | // read and write access - GENERIC_WRITE, - 0, // no sharing - NULL, // default security attributes - OPEN_EXISTING, // opens existing pipe - FILE_FLAG_OVERLAPPED | SECURITY_SQOS_PRESENT | SECURITY_IMPERSONATION,// attributes - NULL); // no template file - - const auto last_error = GetLastError(); - - // TODO: NOTE that ERROR_FILE_NOT_FOUND is treated as a busy pipe - // because when max amount of pipe instances is reached CreateFile returns ERROR_FILE_NOT_FOUND - if (last_error == ERROR_PIPE_BUSY || last_error == ERROR_FILE_NOT_FOUND) - { - return connection_result::busy; - } - - if (m_pipe == INVALID_HANDLE_VALUE) - { - std::cout << "CreateFileW() failed with " << last_error << std::endl; - return connection_result::failure; - } - - DWORD mode = PIPE_READMODE_MESSAGE; - SetNamedPipeHandleState(m_pipe, &mode, NULL, NULL); - - std::wcout << "Successfully connected pipe named: " << m_name << std::endl; - return connection_result::success; -} - -bool LPCPipeClient::connect(size_t _timeout, size_t refresh_rate) -{ - if (isConnected()) - { - std::cout << "Pipe" << m_name.c_str() << " is already connected" << std::endl; - return false; - } - - std::wcout << "Connecting to port: " << m_name << std::endl; - - m_overlapped.reset(); - - using system_time_point = std::chrono::time_point; - using ms = std::chrono::milliseconds; - const auto time_started = std::chrono::system_clock::now(); - auto time_now = time_started; - - const auto timeout = ms(_timeout); - auto diff = ms(0); - - while (diff < timeout) - { - const auto result = internalConnect(); - - switch (result) - { - case details::connection_result::failure: - return false; - case details::connection_result::success: - return true; - case details::connection_result::busy: /* retry */ - default: - break; - } - - Sleep(static_cast(refresh_rate)); - - time_now = std::chrono::system_clock::now(); - diff = std::chrono::duration_cast(time_now - time_started); - } - - std::wcout << "Timed out while connecting to " << m_name << std::endl; - return false; -} - -void LPCPipeClient::disconnect() -{ - if (isConnected()) - { - CloseHandle(m_pipe); - m_overlapped.interrupt(); - m_pipe = INVALID_HANDLE_VALUE; - } -} - -MessageSender LPCPipeClient::getSender() -{ - lock(); - return MessageSender(*this); -} - -bool LPCPipeClient::isConnected() const -{ - return m_pipe != INVALID_HANDLE_VALUE; -} - -std::pair LPCPipeClient::get_buffer() -{ - auto& request_ref = const_cast&>(m_request_buffer); - transfered_pipe_message* request_message = reinterpret_cast(request_ref.data()); - - return{ &request_message->payload[0], request_ref.size() - sizeof(transfered_pipe_message) }; -} - -bool LPCPipeClient::initialize() -{ - try - { - m_request_buffer.resize(DEFAULT_PIPE_BUFFER_SIZE); - } - catch (std::exception& e) - { - std::cout << "Exception occurred: " << e.what() << std::endl; - return false; - } - - return true; -} diff --git a/samples/SampleService/src/common/lpc_pipe.h b/samples/SampleService/src/common/lpc_pipe.h deleted file mode 100644 index 3eb71b3..0000000 --- a/samples/SampleService/src/common/lpc_pipe.h +++ /dev/null @@ -1,278 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include -#include -#include -#include -#include "utils.h" -#include "serialize_iterator.h" -#include "deserialize_iterator.h" - -namespace SampleService -{ - namespace details - { - enum class connection_control : uint32_t - { - keep_connection = 0, - disconnect, - remote_disconnected, - - max_enum_value - }; - - enum class connection_result : uint32_t - { - success = 0, - failure, - busy, - interrupt, - - max_enum_value - }; - - inline void serialize_impl(SerializeIterator& /*it*/) - { - /* end of variadic recursion */ - } - - template - void serialize(SerializeIterator& it, const T& head) - { - it.put(head); - } - - template - void serialize_impl(SerializeIterator& it, const T& head, const ARGS&... tail) - { - serialize(it, head); - serialize_impl(it, tail...); - } - } - - class LPCPipeContext : public Utils::NonCopyable - { - HANDLE m_pipe; - bool m_impersonated{ false }; - public: - LPCPipeContext(HANDLE pipe) : - m_pipe(pipe) - { - } - - ~LPCPipeContext() - { - revertToSelf(); - } - - bool impersonate(); - bool revertToSelf(); - }; - - typedef void (t_incoming_message_cbk)( - DeserializeIterator& request, - SerializeIterator& reply, - LPCPipeContext& ctx); - - static constexpr size_t DEFAULT_PIPE_BUFFER_SIZE = 32 * 1024; - - class LPCPipeListener; - class LPCPipeServer : public Utils::NonCopyable - { - std::wstring m_name; - std::function m_incoming_message_callback; - Utils::InterruptableOverlapped m_overlapped; - size_t m_max_instances{ PIPE_UNLIMITED_INSTANCES }; - std::thread m_accepter; - bool m_running{ false }; - const bool m_allow_non_admin; - std::vector m_listeners; - mutable std::mutex m_stopping_mutex; - - void accepterThread(); - - using accept_result = std::pair; - accept_result accept() const; - - void checkFinishedListeners(); - void stopAllListeners(); - - public: - - LPCPipeServer( - const std::wstring& name, - std::function cbk, - bool allow_user = false, - size_t max_instances = PIPE_UNLIMITED_INSTANCES) - : m_name(name) - , m_incoming_message_callback(cbk) - , m_allow_non_admin(allow_user) - , m_max_instances(max_instances) - {} - - ~LPCPipeServer(); - - const std::function& callback() const; - - bool start(); - - void stop(); - - const std::wstring& pipeName() const; - - bool isRunning() const; - }; - - class LPCPipeListener : public Utils::NonCopyable - { - HANDLE m_pipe{ INVALID_HANDLE_VALUE }; - std::vector m_request_buffer; - std::vector m_reply_buffer; - Utils::InterruptableOverlapped m_overlapped; - std::thread m_thread; - const LPCPipeServer& m_server; - - details::connection_control receive(); - void listenerThread(); - - bool initialize(); - - void disconnect(); - - public: - - LPCPipeListener( - HANDLE pipe, const LPCPipeServer& server) : - m_pipe(pipe), - m_server(server) - { - m_thread = std::thread(&LPCPipeListener::listenerThread, this); - } - - void interrupt() const - { - m_overlapped.interrupt(); - }; - - void join() - { - if (m_thread.joinable()) - { - m_thread.join(); - }; - } - - bool isConnected() const - { - return m_pipe != INVALID_HANDLE_VALUE; - } - }; - - - class MessageSender; - class LPCPipeClient : public Utils::NonCopyable - { - std::wstring m_name; - HANDLE m_pipe{ INVALID_HANDLE_VALUE }; - std::vector m_request_buffer; - std::vector m_reply_buffer; - std::mutex m_mutex; - Utils::InterruptableOverlapped m_overlapped; - - private: - - bool internalSend(details::connection_control control, uint32_t size, uint32_t& reply_size) const; - - details::connection_result internalConnect(); - - bool send(uint32_t request_size, uint32_t& reply_size) const; - - void lock() - { - m_mutex.lock(); - } - void unlock() - { - m_mutex.unlock(); - } - - std::pair get_buffer(); - bool initialize(); - - public: - - LPCPipeClient(const std::wstring& name) : - m_name(name) - { - } - - ~LPCPipeClient() - { - disconnect(); - } - - bool connect(size_t timeout, size_t refresh_rate = 1 /* ms */); - void disconnect(); - - bool isConnected() const; - - MessageSender getSender(); - - friend class MessageSender; - - const std::wstring& pipeName() const { return m_name; }; - }; - - class MessageSender - { - LPCPipeClient& m_transport; - - public: - MessageSender(const MessageSender&) = delete; - MessageSender& operator=(const MessageSender&) = delete; - - MessageSender(MessageSender&&) noexcept; - MessageSender& operator=(MessageSender&&) = delete; - - MessageSender(LPCPipeClient& transport) : m_transport(transport) - {} - ~MessageSender() - { - m_transport.unlock(); - } - - template - DeserializeIterator send(ARGS ... args) const - { - const auto bufs = m_transport.get_buffer(); - if (!bufs.first || !bufs.second) return{ nullptr, 0 }; - - unsigned long message_size = 0; - SerializeIterator it(bufs.first, bufs.second, &message_size); - - details::serialize_impl(it, args...); - - uint32_t reply_size = 0; - if (!m_transport.send(message_size, reply_size)) - { - return DeserializeIterator(nullptr, 0); - } - - return DeserializeIterator(bufs.first, reply_size); - } - }; - - template - void push_message(SerializeIterator& it, ARGS ... args) - { - details::serialize_impl(it, args...); - } -} diff --git a/samples/SampleService/src/common/memory_view.h b/samples/SampleService/src/common/memory_view.h deleted file mode 100644 index aa7dedc..0000000 --- a/samples/SampleService/src/common/memory_view.h +++ /dev/null @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ - -#pragma once -#include "serialize_common.h" - -class memory_view -{ -public: - memory_view(const void* mem, size_t size_in_bytes); - memory_view(const void* mem, unsigned long size_in_bytes); - - memory_view(const memory_view&) = default; - memory_view& operator= (const memory_view&) = default; - - unsigned long size() const; - const char* mem() const; - char* mem(); - -private: - char* m_mem; - unsigned long m_size; -}; - -inline memory_view::memory_view(const void* mem, size_t size_in_bytes) - : m_mem(reinterpret_cast(const_cast(mem))), m_size(static_cast(size_in_bytes)) -{} - -inline memory_view::memory_view(const void* mem, unsigned long size_in_bytes) - : m_mem(reinterpret_cast(const_cast(mem))), m_size(size_in_bytes) -{} - -inline unsigned long memory_view::size() const -{ - return m_size; -} - -inline const char* memory_view::mem() const -{ - return m_mem; -} - -inline char* memory_view::mem() -{ - return m_mem; -} - -class variable_buffer -{ - friend class serialize_iterator; - variable_buffer(const variable_buffer&) = delete; - variable_buffer& operator=(const variable_buffer&) = delete; - variable_buffer& operator=(variable_buffer&&) = delete; -public: - variable_buffer(variable_buffer&& rhv) noexcept : - m_mem(rhv.m_mem), m_max_size(rhv.m_max_size), m_real_size(rhv.m_real_size), m_real_size_of_buffer(rhv.m_real_size_of_buffer) - {} - - unsigned remaining_bytes() const - { - return static_cast ( - m_real_size != nullptr ? m_max_size - *m_real_size : 0 - ); - } - - // current filled size, not max size - unsigned size() const - { - return static_cast ( - m_real_size != nullptr ? *m_real_size : 0 - ); - } - - char* mem() const - { - return m_mem; - } - - void adjust_pointer(unsigned offset) - { - if (m_real_size == nullptr) - { - return; - } - - if (offset + *m_real_size > m_max_size) - { - const unsigned long diff = (unsigned long) m_max_size - (unsigned long)*m_real_size; - (*m_real_size) += diff; - m_mem += diff; - (*m_real_size_of_buffer) += diff; - return; - } - - (*m_real_size) += offset; - m_mem += offset; - (*m_real_size_of_buffer) += offset; - } - - variable_buffer() : - m_mem(nullptr), m_max_size(0), m_real_size(nullptr), m_real_size_of_buffer(nullptr) - {} - - variable_buffer(char* mem, cell_type max_size, cell_type* const real_size, unsigned long* real_size_of_buffer) : - m_mem(mem), m_max_size(max_size), m_real_size(real_size), m_real_size_of_buffer(real_size_of_buffer) - { - *m_real_size = 0; - } - -private: - char* m_mem; - const cell_type m_max_size; - cell_type* const m_real_size; - unsigned long* const m_real_size_of_buffer; -}; diff --git a/samples/SampleService/src/common/serialize_common.h b/samples/SampleService/src/common/serialize_common.h deleted file mode 100644 index ace1bc6..0000000 --- a/samples/SampleService/src/common/serialize_common.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -using cell_type = unsigned long long; -static constexpr auto cell_size = sizeof(cell_type); -using disposal_holder = cell_type[3]; - -static constexpr cell_type integral_type = 0x0077777777777700ULL; -static constexpr cell_type enum_type = 0x0055555555555500ULL; -static constexpr cell_type pod_struct_type = 0x0033333333333300ULL; -static constexpr cell_type string_type = 0x0011111111111100ULL; -static constexpr cell_type wstring_type = 0x0022222222222200ULL; -static constexpr cell_type buffer_type = 0x00AAAAAAAAAAAA00ULL; -static constexpr cell_type variable_buffer_type = 0x00ABBACCCCABBA00ULL; -static constexpr cell_type error_type = 0x0ULL; - -#include -#include - -using array_t = std::vector; -using string_t = std::string; -using wstring_t = std::wstring; - -inline bool safe_memcpy(void* dst, const void* src, size_t size) -{ - bool success{ true }; - __try { - memcpy_s(dst, size, src, size); - } __except (1) { // fix dpanin - success = false; - } - return success; -} diff --git a/samples/SampleService/src/common/serialize_iterator.h b/samples/SampleService/src/common/serialize_iterator.h deleted file mode 100644 index 4dfe242..0000000 --- a/samples/SampleService/src/common/serialize_iterator.h +++ /dev/null @@ -1,339 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include "serialize_common.h" -#include "traits.h" -#include "deserialize_buffer.h" -#include "memory_view.h" - -template -traits::enable_if_t, cell_type> -calc_elem_size(const T&) -{ - static_assert(false, "Non-serializable type: only integrals, enums, POD structs, wstring_t, array_t and buffer are supported"); - return 0ULL; -} - -template -traits::enable_if_t, bool> -serialize_elem(char*&, cell_type&, const T&) -{ - static_assert(false, "Non-serializable type: only integrals, enums, POD structs, wstring_t, array_t and buffer are supported"); - return false; -} - -// === INTEGRAL + ENUM -template -traits::enable_if_t || traits::is_enum_v, cell_type> -calc_elem_size(const T&) -{ - return estimated_size; -} - -template -traits::enable_if_t, bool> -serialize_elem(char*& mem, cell_type& remaining_size, const T& integral_arg) -{ - memcpy_s(mem, remaining_size, &integral_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type cell = integral_arg; - memcpy_s(mem, remaining_size, &cell, cell_size); - mem += cell_size; - remaining_size -= cell_size; - return true; -} - -template -traits::enable_if_t, bool> -serialize_elem(char*& mem, cell_type& remaining_size, const T& enum_arg) -{ - memcpy_s(mem, remaining_size, &enum_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type cell = static_cast>(enum_arg); - memcpy_s(mem, remaining_size, &cell, cell_size); - mem += cell_size; - remaining_size -= cell_size; - return true; -} - -template -traits::enable_if_t, T*> -serialize_elem_reserve(char*& mem, cell_type& remaining_size, const T& enum_arg) -{ - memcpy_s(mem, remaining_size, &enum_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type cell = static_cast>(enum_arg); - memcpy_s(mem, remaining_size, &cell, cell_size); - - T* ptr = reinterpret_cast(mem); - - mem += cell_size; - remaining_size -= cell_size; - return ptr; -} - -// === POD_STRUCT -template -traits::enable_if_t, cell_type> -calc_elem_size(const T&) -{ - return estimated_size; -} - -template -traits::enable_if_t, bool> -serialize_elem(char*& mem, cell_type& remaining_size, const T& pod_struct_arg) -{ - memcpy_s(mem, remaining_size, &pod_struct_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type buf_size{ sizeof(T) }; - memcpy_s(mem, remaining_size, &buf_size, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - memcpy_s(mem, remaining_size, &pod_struct_arg, buf_size); - mem += buf_size; - remaining_size -= buf_size; - return true; -} - -// === MEMORY_VIEW -inline cell_type calc_elem_size(const memory_view& arg) -{ - return cell_size * 2 + arg.size(); -} - -inline bool serialize_elem(char*& mem, cell_type& remaining_size, const memory_view& buf) -{ - memcpy_s(mem, remaining_size, &buffer_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type buf_size{ buf.size() }; - memcpy_s(mem, remaining_size, &buf_size, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - memcpy_s(mem, remaining_size, buf.mem(), buf_size); - mem += buf_size; - remaining_size -= buf_size; - return true; -} - -// === STRING -inline cell_type calc_elem_size(const string_t& arg) -{ - return cell_size * 2 + arg.size(); -} - -inline bool serialize_elem(char*& mem, cell_type& remaining_size, const string_t& str) -{ - memcpy_s(mem, remaining_size, &string_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type buf_size{ str.size() }; - memcpy_s(mem, remaining_size, &buf_size, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - memcpy_s(mem, remaining_size, str.c_str(), buf_size); - mem += buf_size; - remaining_size -= buf_size; - return true; -} - -// === WSTRING -inline cell_type calc_elem_size(const wstring_t& arg) -{ - return cell_size * 2 + arg.size() * sizeof(wchar_t); -} - -inline bool serialize_elem(char*& mem, cell_type& remaining_size, const wstring_t& wstr) -{ - memcpy_s(mem, remaining_size, &wstring_type, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - const cell_type buf_size{ wstr.size() * sizeof(wchar_t) }; - memcpy_s(mem, remaining_size, &buf_size, cell_size); - mem += cell_size; - remaining_size -= cell_size; - - memcpy_s(mem, remaining_size, wstr.data(), buf_size); - mem += buf_size; - remaining_size -= buf_size; - return true; -} - -inline cell_type count_mem() -{ - return 0; -} - -template -cell_type count_mem(const T& head, const ARGS&... tail) -{ - return calc_elem_size(head) + count_mem(tail...); -} - -inline void serialize_impl(char*, cell_type) -{ /* end of variadic recursion */} - -template -void serialize_impl(char*& ret, cell_type& remaining_size, const T& head, const ARGS&... tail) -{ - serialize_elem(ret, remaining_size, head); - serialize_impl(ret, remaining_size, tail...); -} - -template -array_t serialize(const ARGS&... args) -{ - const cell_type argc = sizeof...(args); - cell_type mem_size = count_mem(args...) + cell_size; - - array_t container(mem_size); - memcpy_s(&container[0], cell_size, &argc, cell_size); - - auto mem_ptr = &container[cell_size]; - - mem_size -= cell_size; - serialize_impl(mem_ptr, mem_size, args...); - return container; -} - -template -size_t serialize_to(char* buffer, size_t size, const ARGS&... args) -{ - const cell_type argc = sizeof...(args); - cell_type mem_size = count_mem(args...) + cell_size; - if (mem_size > size) - { - return 0; - } - - memcpy_s(&buffer[0], cell_size, &argc, cell_size); - - auto mem_ptr = &buffer[cell_size]; - - auto remaining_size = mem_size - cell_size; - serialize_impl(mem_ptr, remaining_size, args...); - return mem_size; -} - -class SerializeIterator -{ - SerializeIterator(const SerializeIterator&) = delete; - SerializeIterator(SerializeIterator&&) = delete; - SerializeIterator& operator=(const SerializeIterator&) = delete; - SerializeIterator& operator=(SerializeIterator&&) = delete; -public: - SerializeIterator(void* mem, size_t max_size, unsigned long* real_size) : - m_mem(reinterpret_cast(mem) + sizeof(size_t)), - m_argc(reinterpret_cast(mem)), - m_maxsize(static_cast(max_size)), - m_realsize(real_size) - { - *m_argc = 0; - *m_realsize = cell_size; // for ARGC - } - - // STATUS_SUCCESS on everything good - // STATUS_BUFFER_TOO_SMALL on overflow - // STATUS_DATA_ERROR on empty buffer - unsigned long valid() const - { - return 0; //hack, fixme, DPANIN - } - - template - void put(const T& arg) - { - const auto elem_sz = static_cast(calc_elem_size(arg)); - *m_realsize += elem_sz; - - if (!m_write_error && m_maxsize >= *m_realsize) - { - // HACK, DPANIN - cell_type fake = 1234567ULL; - - serialize_elem(m_mem, fake, arg); - ++(*m_argc); - } - } - - // serialize-reserve operation, basically: - // * reserves a cell for given datatype - // * sets a default value - // * returns a pointer to the value - // should be considered unsafe - template - T* reserve(const T& arg) - { - const auto elem_sz = static_cast(calc_elem_size(arg)); - *m_realsize += elem_sz; - - if (!m_write_error && m_maxsize >= *m_realsize) - { - // HACK, DPANIN - cell_type fake = 1234567ULL; - - T* ptr = serialize_elem_reserve(m_mem, fake, arg); - ++(*m_argc); - - return ptr; - } - - return nullptr; - } - - // warning, nothing can be serialized after this - variable_buffer put_variable_buffer() - { - constexpr auto control_block_size = cell_size * 3; - - if (*m_realsize + control_block_size > m_maxsize) - { - m_write_error = true; - return{}; - } - - cell_type* const type = reinterpret_cast(m_mem); - *type = variable_buffer_type; - - cell_type* const max_buf_size = reinterpret_cast(m_mem + cell_size); - *max_buf_size = m_maxsize - *m_realsize - control_block_size; - - cell_type* const real_buf_size = reinterpret_cast(m_mem + cell_size + cell_size); - - *m_realsize += control_block_size; - ++(*m_argc); - - return{ m_mem + control_block_size, *max_buf_size, real_buf_size, m_realsize }; - } - -private: - char* m_mem; - cell_type* m_argc; - const cell_type m_maxsize; - unsigned long* const m_realsize; - - bool m_write_error{ false }; -}; \ No newline at end of file diff --git a/samples/SampleService/src/common/traits.h b/samples/SampleService/src/common/traits.h deleted file mode 100644 index e553c80..0000000 --- a/samples/SampleService/src/common/traits.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include -namespace traits -{ - template - constexpr bool is_integral_v = std::is_integral_v<_Ty>; - - template - constexpr bool is_enum_v = std::is_enum_v<_Ty>; - - template - constexpr bool is_pod_struct_v = std::is_class_v<_Ty> && std::is_pod_v<_Ty>; - - template - constexpr bool is_unspecified_v = !is_pod_struct_v<_Ty> && !is_enum_v<_Ty> && !is_integral_v<_Ty>; - - template - using enable_if_t = std::enable_if_t<_Test, _Ty>; - - template - using underlying_type_t = std::underlying_type_t<_Ty>; - - template - using remove_reference_t = std::remove_reference_t<_Ty>; - - template - constexpr remove_reference_t<_Ty>&& move(_Ty&& _Arg) - { - return static_cast&&>(_Arg); - } - - template - struct integral_constant { - static constexpr size_t value = I; - }; -} diff --git a/samples/SampleService/src/common/transport.h b/samples/SampleService/src/common/transport.h deleted file mode 100644 index ac484a3..0000000 --- a/samples/SampleService/src/common/transport.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include -#include -#include - -namespace SampleService -{ - namespace Transport - { - template = MAX> - struct write_to_tuple; - - template - struct write_to_tuple - { - template - static void call(DeserializeIterator& it, TUPLE& tpl) - { - using TP = std::decay_t>; - std::get(tpl) = it.get(); - } - }; - - template - struct write_to_tuple - { - template - static void call(const DeserializeIterator&, const TUPLE&) - {} - }; - - template - void deserializer_to_tuple_check_finalize(DeserializeIterator& it, std::tuple& tpl) - { - static constexpr size_t tpl_sz = std::tuple_size>::value; - static_assert(tpl_sz < 10, "More than 10 elements? Add more calls to write_to_tuple, then change me!"); - - auto& status = std::get<0>(tpl); - - write_to_tuple<0, tpl_sz>::call(it, tpl); - if (status != status::success) - { - return; - } - - write_to_tuple<1, tpl_sz>::call(it, tpl); - write_to_tuple<2, tpl_sz>::call(it, tpl); - write_to_tuple<3, tpl_sz>::call(it, tpl); - write_to_tuple<4, tpl_sz>::call(it, tpl); - write_to_tuple<5, tpl_sz>::call(it, tpl); - write_to_tuple<6, tpl_sz>::call(it, tpl); - write_to_tuple<7, tpl_sz>::call(it, tpl); - write_to_tuple<8, tpl_sz>::call(it, tpl); - write_to_tuple<9, tpl_sz>::call(it, tpl); - - if (!it.finalize()) - { - status = status::deserialization_error; - } - } - - template - std::tuple send_impl(LPCPipeClient& pipe, size_t timeout, command cmd, const ARGS&... args) - { - std::tuple ret; - - if (!pipe.isConnected()) - { - if (!pipe.connect(timeout)) - { - std::get<0>(ret) = status::failed_to_create_pipe; - return ret; - } - } - - const auto sender = pipe.getSender(); - DeserializeIterator deserializer = sender.send(cmd, args...); - deserializer_to_tuple_check_finalize(deserializer, ret); - return ret; - } - } -} diff --git a/samples/SampleService/src/common/utils.cpp b/samples/SampleService/src/common/utils.cpp deleted file mode 100644 index 8bd7864..0000000 --- a/samples/SampleService/src/common/utils.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#include "utils.h" -#include -#include -#include - -using namespace SampleService::Utils; - -InterruptableOverlapped::InterruptableOverlapped() -{ - ZeroMemory(&m_overlapped, sizeof(m_overlapped)); - - m_overlapped.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - m_cancel_event = CreateEventW(NULL, TRUE, FALSE, NULL); - - m_events[0] = m_overlapped.hEvent; - m_events[1] = m_cancel_event; -} - -InterruptableOverlapped::~InterruptableOverlapped() -{ - if (m_overlapped.hEvent) - { - CloseHandle(m_overlapped.hEvent); - } - - if (m_cancel_event) - { - CloseHandle(m_cancel_event); - } -} - -void InterruptableOverlapped::interrupt() const -{ - SetEvent(m_cancel_event); -} - -bool InterruptableOverlapped::wait() const -{ - const auto wait_status = WaitForMultipleObjects( - 2, // we have only two events: - &m_events[0], // one for message another for the cancel event - false, // wait for any of them - INFINITE); - - return wait_status == WAIT_OBJECT_0; -} - -void InterruptableOverlapped::reset() const -{ - ResetEvent(m_overlapped.hEvent); - ResetEvent(m_cancel_event); -} - - -void Event::createEvent(bool manual_reset) -{ - m_event_object = CreateEventW(NULL, manual_reset, FALSE, NULL); - if (!m_event_object) - { - //LOG_ERR(L"Failed to create event: {}", logger::last_error_str()); - } -} - -void Event::destroyEvent() const -{ - if (m_event_object) - { - CloseHandle(m_event_object); - } -} - -void Event::signal() const -{ - if (m_event_object) - { - SetEvent(m_event_object); - } -} - -void Event::wait() const -{ - if (!m_event_object) return; - WaitForSingleObject(m_event_object, INFINITE); -} - -void Event::reset() const -{ - if (!m_event_object) return; - ResetEvent(m_event_object); -} - -bool Event::waitAlertable() const -{ - if (!m_event_object) - { - return true; - } - - const DWORD result = WaitForSingleObjectEx(m_event_object, INFINITE, TRUE); - if (result == WAIT_FAILED) - { - //LOG_ERR(L"Failed to wait for event: {}", logger::last_error_str()); - return true; - } - - return result == WAIT_OBJECT_0; -} diff --git a/samples/SampleService/src/common/utils.h b/samples/SampleService/src/common/utils.h deleted file mode 100644 index d88cdb4..0000000 --- a/samples/SampleService/src/common/utils.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include -#include -#include - -namespace SampleService -{ - namespace Utils - { - class Event - { - HANDLE m_event_object; - - void createEvent(bool manual_reset); - void destroyEvent() const; - - Event& operator= (const Event&) = delete; - Event(const Event&) = delete; - - public: - - Event(bool manual_reset = true) : m_event_object(NULL) - { - createEvent(manual_reset); - }; - ~Event() - { - destroyEvent(); - }; - - operator bool() const { return m_event_object != nullptr; } - void signal() const; - void wait() const; - bool waitAlertable() const; - void reset() const; - }; - - class InterruptableOverlapped - { - OVERLAPPED m_overlapped; - HANDLE m_cancel_event; - HANDLE m_events[2]; - - InterruptableOverlapped& operator=(const InterruptableOverlapped&); - InterruptableOverlapped(const InterruptableOverlapped&); - - public: - InterruptableOverlapped(); - ~InterruptableOverlapped(); - - OVERLAPPED* get() const { return const_cast(&m_overlapped); } - void interrupt() const; - bool wait() const; - void reset() const; - }; - - class NonCopyable - { - public: - NonCopyable() {}; - NonCopyable(const NonCopyable&) = delete; - NonCopyable(NonCopyable&&) = delete; - NonCopyable& operator=(const NonCopyable&) = delete; - }; - } -} diff --git a/samples/SampleService/src/lib/client.cpp b/samples/SampleService/src/lib/client.cpp deleted file mode 100644 index 0742c6b..0000000 --- a/samples/SampleService/src/lib/client.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#include -#include -#include "lpc_pipe.h" -#include "client.h" -#include "command.h" -#include "port_name.h" -#include - -namespace SampleService -{ - using namespace Transport; - static const size_t connect_timeout_ms = 10 * 1000; // 10 seconds - - ServiceClient::ServiceClient() - : m_pipe(interface_port_name) - {} - - std::tuple ServiceClient::create(const std::wstring& name) - { - return send_impl(m_pipe, connect_timeout_ms, command::create, name); - } - - std::tuple ServiceClient::isRunningInCloudSecure() - { - return send_impl(m_pipe, connect_timeout_ms, command::isRunningInCloudSecure); - } -} diff --git a/samples/SampleService/src/lib/client.h b/samples/SampleService/src/lib/client.h deleted file mode 100644 index 6dbf23e..0000000 --- a/samples/SampleService/src/lib/client.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include -#include "lpc_pipe.h" -#include "status.h" - -namespace SampleService -{ - class ServiceClient - { - public: - ServiceClient(); - - std::tuple create(const std::wstring& name); - - std::tuple isRunningInCloudSecure(); - - private: - LPCPipeClient m_pipe; - }; -} diff --git a/samples/SampleService/src/lib/command.h b/samples/SampleService/src/lib/command.h deleted file mode 100644 index f4a577c..0000000 --- a/samples/SampleService/src/lib/command.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#ifndef NV_CASE_RETURN_ENUM_STRING -#define NV_CASE_RETURN_ENUM_STRING(enm) case enm: return L#enm -#endif - -namespace SampleService -{ - enum class command - { - create, - isRunningInCloudSecure, - - max_enum_value - }; - - inline const wchar_t* enumPrinter(command enumclass) - { - switch (enumclass) - { - NV_CASE_RETURN_ENUM_STRING(command::create); - NV_CASE_RETURN_ENUM_STRING(command::isRunningInCloudSecure); - NV_CASE_RETURN_ENUM_STRING(command::max_enum_value); - } - return L"Unknown enumeration. Add me to enumPrinter"; - } -} \ No newline at end of file diff --git a/samples/SampleService/src/lib/port_name.h b/samples/SampleService/src/lib/port_name.h deleted file mode 100644 index 81fbfe4..0000000 --- a/samples/SampleService/src/lib/port_name.h +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include - -namespace SampleService -{ - static const std::wstring interface_port_name = L"\\\\.\\pipe\\{9E544473-4855-4FAE-B84D-978DF8FAE9E8}"; -} diff --git a/samples/SampleService/src/lib/server.cpp b/samples/SampleService/src/lib/server.cpp deleted file mode 100644 index e5c69a0..0000000 --- a/samples/SampleService/src/lib/server.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#include "server.h" -#include -#include -#include -#include "GfnRuntimeSdk_Wrapper.h" - -namespace SampleService -{ - ServiceServer::ServiceServer() - : m_pipe( - interface_port_name, - std::bind( - &ServiceServer::receiver, - this, - std::placeholders::_1, - std::placeholders::_2, - std::placeholders::_3), - true /* allow non-admin users */, - 1 /* max instances */ ) - { - registerCommands(); - } - - void ServiceServer::receiver(DeserializeIterator& request, SerializeIterator& reply, LPCPipeContext& ctx) - { - const auto cmd = request.get(); - const auto handler = m_root_commands.find(cmd); - - auto* status = reply.reserve(status::failed_to_process_command); - if (handler == std::end(m_root_commands)) - { - *status = status::command_not_found; - return; - } - - try - { - *status = m_root_commands[cmd](request, reply, ctx); - } - catch (const std::exception& e) - { - std::cout << "Failed to process command " << " exception: " << e.what() << std::endl; - *status = status::failed_to_process_command; - } - } - - status ServiceServer::start() - { - try { - // Initialize Geforce NOW Runtime SDK using the C calling convention. - GfnRuntimeError err = GfnInitializeSdk(gfnDefaultLanguage); - if (err != gfnSuccess) - { - std::cout << "Error initializing the sdk: " << err << std::endl; - } - - return m_pipe.start() ? status::success : status::failed_to_start_service; - } - catch (const std::exception& e) - { - std::cout << "Failed to start, exception occurred: " << e.what() << std::endl; - return status::failed_to_start_service; - } - } - - std::tuple ServiceServer::create(const std::wstring& name) - { - return{ status::success, name + L"_out" }; - } - - status ServiceServer::createHandler(DeserializeIterator& request, SerializeIterator& reply, LPCPipeContext& /*ctx*/) - { - const auto name = request.get(); - - if (!request.finalize()) - { - std::cout << "Failed to deserialize request @ create_handler" << std::endl; - return status::deserialization_error; - } - - const auto& [result, new_id] = create(name); - reply.put(new_id); - return result; - } - - std::tuple ServiceServer::isRunningInCloudSecure() - { - GfnIsRunningInCloudAssurance assurance = GfnIsRunningInCloudAssurance::gfnNotCloud; - GfnError err = GfnIsRunningInCloudSecure(&assurance); - if (err != GfnError::gfnSuccess) - { - std::cout << "Failed to get if running in cloud. Error: " << err << std::endl; - return{ status::success, std::to_wstring(err), L"Failed to get if running in cloud.Error: " + err}; - } - std::cout << "GfnIsRunningInCloudSecure assurance " << assurance << "\n"; - - return{ status::success, std::to_wstring(err), std::to_wstring(assurance)}; - } - - status ServiceServer::isRunningInCloudRequestHandler(DeserializeIterator& request, SerializeIterator& reply, LPCPipeContext& /*ctx*/) - { - if (!request.finalize()) - { - std::cout << "Failed to deserialize request @ handleisRunningInCloudRequest" << std::endl; - return status::deserialization_error; - } - - const auto& [result, gfnerror, response] = isRunningInCloudSecure(); - reply.put(gfnerror); - reply.put(response); - return result; - } - - void ServiceServer::registerCommands() - { - namespace p = std::placeholders; - m_root_commands.emplace(command::create, std::bind(&ServiceServer::createHandler, this, p::_1, p::_2, p::_3)); - m_root_commands.emplace(command::isRunningInCloudSecure, std::bind(&ServiceServer::isRunningInCloudRequestHandler, this, p::_1, p::_2, p::_3)); - } -} diff --git a/samples/SampleService/src/lib/server.h b/samples/SampleService/src/lib/server.h deleted file mode 100644 index 30491b5..0000000 --- a/samples/SampleService/src/lib/server.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include -#include -#include -#include "status.h" -#include "command.h" -#include "port_name.h" - -namespace SampleService -{ - class ServiceServer : public Utils::NonCopyable - { - typedef status(t_handler)( - DeserializeIterator& request, - SerializeIterator& reply, - LPCPipeContext& ctx); - - using dispatch_table = std::unordered_map>; - - /////////////////////////////////////////////// - LPCPipeServer m_pipe; - dispatch_table m_root_commands; - - void receiver( - DeserializeIterator& request, - SerializeIterator& reply, - LPCPipeContext& ctx); - - /////////////////////////////////////////////// - // command handlers - status createHandler(DeserializeIterator& request, SerializeIterator& reply, LPCPipeContext& ctx); - - std::tuple create(const std::wstring& name); - - status isRunningInCloudRequestHandler(DeserializeIterator& request, SerializeIterator& reply, LPCPipeContext& ctx); - - std::tuple isRunningInCloudSecure(); - - void registerCommands(); - - public: - ServiceServer(); - status start(); - }; -} diff --git a/samples/SampleService/src/lib/status.h b/samples/SampleService/src/lib/status.h deleted file mode 100644 index ea960d3..0000000 --- a/samples/SampleService/src/lib/status.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once -#include - -#ifndef NV_CASE_RETURN_ENUM_STRING -#define NV_CASE_RETURN_ENUM_STRING(enm) case enm: return L#enm -#endif - -namespace SampleService -{ - enum class status : uint32_t - { - success = 0, - failed_to_create_pipe, - not_implemented, - deserialization_error, - param_validation_error, - command_not_found, - invalid_request, - request_is_not_completed, - invalid_metadata, - help_requested, - failed_to_start_service, - failed_to_process_command, - - max_enum_value - }; - - inline const wchar_t* enumPrinter(status enumclass) - { - switch (enumclass) - { - NV_CASE_RETURN_ENUM_STRING(status::success); - NV_CASE_RETURN_ENUM_STRING(status::failed_to_create_pipe); - NV_CASE_RETURN_ENUM_STRING(status::not_implemented); - NV_CASE_RETURN_ENUM_STRING(status::deserialization_error); - NV_CASE_RETURN_ENUM_STRING(status::param_validation_error); - NV_CASE_RETURN_ENUM_STRING(status::command_not_found); - NV_CASE_RETURN_ENUM_STRING(status::invalid_request); - NV_CASE_RETURN_ENUM_STRING(status::request_is_not_completed); - NV_CASE_RETURN_ENUM_STRING(status::invalid_metadata); - NV_CASE_RETURN_ENUM_STRING(status::help_requested); - NV_CASE_RETURN_ENUM_STRING(status::failed_to_start_service); - NV_CASE_RETURN_ENUM_STRING(status::failed_to_process_command); - NV_CASE_RETURN_ENUM_STRING(status::max_enum_value); - } - return L"Unknown enumeration. Add me to enumPrinter"; - } -} - -#undef NV_CASE_RETURN_ENUM_STRING diff --git a/samples/SampleService/src/svc/instance.cpp b/samples/SampleService/src/svc/instance.cpp deleted file mode 100644 index e2d23ef..0000000 --- a/samples/SampleService/src/svc/instance.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#define NOMINMAX -#include -#include "instance.h" -#include "utils.h" -#include -#include - -namespace SampleService -{ - namespace instance - { - Utils::Event m_exit_event; - Utils::Event m_finished_event; - - uint32_t run() - { - auto result = status::failed_to_start_service; - - try - { - std::unique_ptr server = std::make_unique(); - result = server->start(); - if (result == status::success) - { - m_exit_event.wait(); - } - } - catch (const std::exception&) - { - result = status::failed_to_start_service; - } - - m_finished_event.signal(); - return static_cast(result); - } - - void stop(bool wait_for_finish) - { - m_exit_event.signal(); - if (wait_for_finish) - { - m_finished_event.wait(); - } - } - } -} diff --git a/samples/SampleService/src/svc/instance.h b/samples/SampleService/src/svc/instance.h deleted file mode 100644 index 0dc0b34..0000000 --- a/samples/SampleService/src/svc/instance.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include - -namespace SampleService -{ - namespace instance - { - uint32_t run(); - void stop(bool wait_for_finish); - } -} diff --git a/samples/SampleService/src/svc/main.cpp b/samples/SampleService/src/svc/main.cpp deleted file mode 100644 index eed8a08..0000000 --- a/samples/SampleService/src/svc/main.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#define NOMINMAX -#include -#include -#include -#include -#include -#include "instance.h" -#include "service.h" - -std::wstring service_name = L"GfnSdkSampleService"; - -uint32_t run_as_console_application() -{ - const PHANDLER_ROUTINE handler_routine = [](DWORD dwCtrlType) -> BOOL - { - if (dwCtrlType == CTRL_CLOSE_EVENT || dwCtrlType == CTRL_C_EVENT) - { - SampleService::instance::stop(/*wait_for_finish*/ true); - return TRUE; - } - return FALSE; - }; - - SetConsoleCtrlHandler(handler_routine, TRUE); - return SampleService::instance::run(); -} - -using command_handler = std::function; - -class command -{ -public: - command(command_handler handler, std::wstring&& help) : - m_handler(std::move(handler)), - m_help(std::move(help)) - {} - - uint32_t operator()() const - { - return m_handler(); - } - - const std::wstring& get_help() const - { - return m_help; - } - -private: - const command_handler m_handler; - const std::wstring m_help; -}; - -const static std::map commands_map{ - { L"run", command(run_as_console_application, L"RUN - run as a console application") } -}; - -void displayHelp() -{ - for (const auto& command: commands_map) - { - std::wcout << command.second.get_help() << std::endl; - } -} - -int wmain(int argc, wchar_t** argv) -{ - try - { - auto it = commands_map.end(); - if (argc > 1) - { - CharLowerW(argv[1]); - it = commands_map.find(argv[1]); - } - - if (it != commands_map.end()) - { - return it->second(); - } - - auto result = SampleService::service::run(service_name, SampleService::instance::run, SampleService::instance::stop); - if (result != NO_ERROR) - { - std::cout << "Failed to start service, error: " << result << std::endl; - } - - // This error is returned if the program is being run as a console application rather than as a service. - if (result == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) - { - displayHelp(); - } - - return result; - } - catch (const std::exception& e) - { - std::cout << "Exception occurred: " << e.what() << std::endl; - return 1; - } -} diff --git a/samples/SampleService/src/svc/service.cpp b/samples/SampleService/src/svc/service.cpp deleted file mode 100644 index b85b8ac..0000000 --- a/samples/SampleService/src/svc/service.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#define NOMINMAX -#include -#include -#include -#include -#include -#include -#include -#include "service.h" -#include "utils.h" - -namespace SampleService -{ - namespace service - { - static SERVICE_STATUS g_service_status{}; - static SERVICE_STATUS_HANDLE g_service_status_handle = nullptr; - static std::wstring g_service_name; - static service_run g_run; - static service_stop g_stop; - static std::streambuf *g_coutOriginalBuffer; - - static uint32_t reportStatus(uint32_t current_status, uint32_t exit_code = NO_ERROR) - { - g_service_status.dwWin32ExitCode = exit_code; - g_service_status.dwCurrentState = current_status; - g_service_status.dwControlsAccepted = current_status == SERVICE_START_PENDING ? 0 : SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_STOP; - - if (current_status == SERVICE_RUNNING || current_status == SERVICE_STOPPED) - { - g_service_status.dwCheckPoint = 0; - g_service_status.dwWaitHint = 0; - } - else - { - ++g_service_status.dwCheckPoint; - g_service_status.dwWaitHint = 90 * 1000; - } - - if (!SetServiceStatus(g_service_status_handle, &g_service_status)) - { - const uint32_t result = GetLastError(); - std::cout << "Failed to set service status, error: " << result << std::endl; - return result; - } - - return NO_ERROR; - } - - static uint32_t initializeService() - { - g_service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - return reportStatus(SERVICE_START_PENDING); - } - - static DWORD WINAPI serviceControl( - __in DWORD dwControl, - __in DWORD dwEventType, - __in LPVOID lpEventData, - __in LPVOID lpContext) - { - UNREFERENCED_PARAMETER(lpContext); - UNREFERENCED_PARAMETER(lpEventData); - UNREFERENCED_PARAMETER(dwEventType); - - if (dwControl == SERVICE_CONTROL_STOP || dwControl == SERVICE_CONTROL_SHUTDOWN) - { - reportStatus(SERVICE_STOP_PENDING); - const bool wait_for_finish = dwControl == SERVICE_CONTROL_SHUTDOWN; - assert(g_stop); - g_stop(wait_for_finish); - std::cout << "Service Stopping" << std::endl; - //Restore cout's original buffer back. - std::cout.rdbuf(g_coutOriginalBuffer); - } - else - { - reportStatus(g_service_status.dwCurrentState); - } - - return NO_ERROR; - } - - static void WINAPI serviceMain(DWORD, LPWSTR*) - { - // Initialize Service logs, note that Service cannot write into user's localappdata - // Create logging directory if it doesn't exist. - wchar_t* programDataPath = NULL; - auto hr = SHGetKnownFolderPath(FOLDERID_ProgramData, KF_FLAG_DEFAULT, NULL, &programDataPath); - if (FAILED(hr)) - { - std::cout << "Could not get path to local app data folder" << std::endl; - return; - } - - std::wstringstream pathSS; - pathSS << programDataPath << L"\\NVIDIA Corporation\\GfnRuntimeSdk"; - CoTaskMemFree(programDataPath); - - int createDirResult = SHCreateDirectoryExW(NULL, pathSS.str().c_str(), NULL); - if (createDirResult != ERROR_SUCCESS && createDirResult != ERROR_FILE_EXISTS && createDirResult != ERROR_ALREADY_EXISTS) - { - std::cout << "Could not create logging directory" << std::endl; - return; - } - - pathSS << "\\GfnSdkSampleService.log"; - - // To write to a file using cout, first save the std::cout buffer and then assign it to log file - g_coutOriginalBuffer = std::cout.rdbuf(); - std::wstring_convert> converter; - std::ofstream out(converter.to_bytes(pathSS.str()).c_str()); - //Write to log through std::cout - std::cout.rdbuf(out.rdbuf()); - - int result = NO_ERROR; - g_service_status_handle = RegisterServiceCtrlHandlerExW(g_service_name.c_str(), serviceControl, NULL); - if (g_service_status_handle == nullptr) - { - std::cout << "Failed to register service control handler, error: " << GetLastError() << std::endl; - return; - } - result = initializeService(); - if (result == NO_ERROR) - { - result = reportStatus(SERVICE_RUNNING); - } - if (result == NO_ERROR) - { - // This code execited in running state - assert(g_run); - result = g_run(); - } - reportStatus(SERVICE_STOPPED, result); - } - - uint32_t run(const std::wstring& service_name, service_run&& run, service_stop&& stop) - { - g_service_name = service_name; - g_run = run; - g_stop = stop; - - const SERVICE_TABLE_ENTRYW service_dispatch_table[] = { - { const_cast(g_service_name.c_str()), serviceMain }, - { nullptr, nullptr } - }; - - if (!StartServiceCtrlDispatcherW(service_dispatch_table)) - { - const uint32_t result = GetLastError(); - return result; - } - return ERROR_SUCCESS; - } - } -} diff --git a/samples/SampleService/src/svc/service.h b/samples/SampleService/src/svc/service.h deleted file mode 100644 index 20becdc..0000000 --- a/samples/SampleService/src/svc/service.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. -* -* NVIDIA CORPORATION and its licensors retain all intellectual property -* and proprietary rights in and to this software, related documentation -* and any modifications thereto. Any use, reproduction, disclosure or -* distribution of this software and related documentation without an express -* license agreement from NVIDIA CORPORATION is strictly prohibited. -*/ -#pragma once - -#include -#include - -namespace SampleService -{ - namespace service - { - using service_run = std::function; - using service_stop = std::function; - - uint32_t run(const std::wstring& service_name, service_run&& run, service_stop&& stop); - } -}
    Language API