1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
/********************************************************
* *
* Copyright (C) Microsoft. All rights reserved. *
* *
********************************************************/
// Sentient Client DynamicConfig API
//
// Include this to get access to all DynamicConfig-related Sentient features
#pragma once
#include "SenClientSys.h"
namespace Sentient
{
/// @brief Gets the size of a config file, so memory can be allocated
///
/// @param[in] titleID
/// Which title's config file to search for.
///
/// @param[in] resourceID
/// Which config file to find.
///
/// @param[out] out_size
/// The size of the file, in bytes.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: size is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetBytes()
///
HRESULT SenDynamicConfigGetSize(
__in unsigned int titleID,
__in unsigned int resourceID,
__out size_t* out_size,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData );
/// @brief Gets the size of a config file, so memory can be allocated
///
/// @param[in] resourceID
/// Which config file to find.
///
/// @param[out] out_size
/// The size of the file, in bytes.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: size is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetBytes()
///
__inline HRESULT SenDynamicConfigGetSize(
__in unsigned int resourceID,
__out size_t* out_size,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData )
{
return SenDynamicConfigGetSize(SenSysTitleID_This, resourceID, out_size, userCallback, userCallbackData);
}
/// @brief Gets the contents of a config file
///
/// @param[in] titleID
/// Which title's config file to search for.
///
/// @param[in] resourceID
/// Which config file to return.
///
/// @param[in] dataSizeMax
/// Maximum number of bytes to return.
///
/// @param[out] out_bytesWritten
/// The number of bytes written into the buffer.
///
/// @param[out] out_data
/// The buffer that receives the contents of the file.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: out_data is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetSize()
///
HRESULT SenDynamicConfigGetBytes(
__in unsigned int titleID,
__in unsigned int resourceID,
__in size_t dataSizeMax,
__out_opt size_t* out_bytesWritten,
__out void *out_data,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData );
/// @brief Gets the contents of a config file
///
/// @param[in] resourceID
/// Which config file to return.
///
/// @param[in] dataSizeMax
/// Maximum number of bytes to return.
///
/// @param[out] out_bytesWritten
/// The number of bytes written into the buffer.
///
/// @param[out] out_data
/// The buffer that receives the contents of the file.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: out_data is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetSize()
///
__inline HRESULT SenDynamicConfigGetBytes(
__in unsigned int resourceID,
__in size_t dataSizeMax,
__out_opt size_t* out_bytesWritten,
__out void *out_data,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData )
{
return SenDynamicConfigGetBytes(SenSysTitleID_This, resourceID, dataSizeMax, out_bytesWritten, out_data, userCallback, userCallbackData);
}
}
|