@@ -85,46 +85,36 @@ extern "C" GMM_LIB_API GMM_STATUS GMM_STDCALL OpenGmm(GmmExportEntries *pm_GmmFu
8585}
8686
8787// ///////////////////////////////////////////////////////////////////////////////////
88- // / First Call to GMM Lib DLL/so to initialize singleton global context
89- // / and create client context
90- // /
88+ // First Call to GMM Lib DLL/so to initialize singleton global context
89+ // and create client context
9190// ///////////////////////////////////////////////////////////////////////////////////
92- #ifdef _WIN32
93- extern " C" GMM_LIB_API GMM_CLIENT_CONTEXT *GMM_STDCALL GmmInit (const PLATFORM Platform,
94- const SKU_FEATURE_TABLE *pSkuTable,
95- const WA_TABLE * pWaTable,
96- const GT_SYSTEM_INFO * pGtSysInfo,
97- GMM_CLIENT ClientType)
98- #else
99- extern " C" GMM_LIB_API GMM_CLIENT_CONTEXT *GMM_STDCALL GmmInit (const PLATFORM Platform,
100- const void * pSkuTable,
101- const void * pWaTable,
102- const void * pGtSysInfo,
103- GMM_CLIENT ClientType)
104- #endif
91+ extern " C" GMM_LIB_API GMM_STATUS GMM_STDCALL InitializeGmm (GMM_INIT_IN_ARGS *pInArgs, GMM_INIT_OUT_ARGS *pOutArgs)
10592{
106- GMM_STATUS Status = GMM_SUCCESS;
107- GMM_CLIENT_CONTEXT *pClientContext = NULL ;
93+ GMM_STATUS Status = GMM_ERROR;
10894
95+ if (pInArgs && pOutArgs)
96+ {
10997
110- Status = GmmCreateSingletonContext (Platform, pSkuTable, pWaTable, pGtSysInfo);
98+ Status = GmmCreateSingletonContext (pInArgs-> Platform , pInArgs-> pSkuTable , pInArgs-> pWaTable , pInArgs-> pGtSysInfo );
11199
112- if (Status == GMM_SUCCESS)
113- {
114- pClientContext = GmmCreateClientContext (ClientType);
100+ if (Status == GMM_SUCCESS)
101+ {
102+ pOutArgs->pGmmClientContext = GmmCreateClientContext (pInArgs->ClientType );
103+ }
115104 }
116105
117- return pClientContext ;
106+ return Status ;
118107}
119108
120-
121109// ///////////////////////////////////////////////////////////////////////////////////
122- // / Destroys singleton global context and client context
123- // /
110+ // Destroys singleton global context and client context
124111// ///////////////////////////////////////////////////////////////////////////////////
125- extern " C" GMM_LIB_API void GMM_STDCALL GmmDestroy (GMM_CLIENT_CONTEXT *pGmmClientContext )
112+ extern " C" GMM_LIB_API void GMM_STDCALL GmmDestroy (GMM_INIT_OUT_ARGS *pInArgs )
126113{
127- GmmDestroySingletonContext ();
128- GmmDeleteClientContext (pGmmClientContext);
114+ if (pInArgs && pInArgs->pGmmClientContext )
115+ {
116+ GmmDeleteClientContext (pInArgs->pGmmClientContext );
117+ GmmDestroySingletonContext ();
118+ }
129119}
130120#endif // GMM_LIB_DLL
0 commit comments