#include <FAppIAppControlEventListener.h>
#include <FAppIAppControlResponseListener.h>
-#include <FBaseRt_LibraryImpl.h>
#include <FIo_DirectoryImpl.h>
#include "FApp_AppControlImpl.h"
pLib = new (std::nothrow) _LibraryImpl;
SysTryReturnResult(NID_APP, pLib != null, E_OUT_OF_MEMORY, "Failed to allocate libraryimpl.");
- unsigned long option = _LIBRARY_LOAD_OPTION_LAZY;
- option |= _LIBRARY_LOAD_OPTION_NODELETE;
-
- result r = pLib->Construct(_path, option);
+ result r = pLib->Construct(_path, _LIBRARY_OPTION);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
if (pListener)
_reqId = req;
- SysLog(NID_APP, "Exit");
+ SysLog(NID_APP, "Exit %d", req);
return E_SUCCESS;
CATCH:
pLib = new (std::nothrow) _LibraryImpl;
SysTryReturnResult(NID_APP, pLib != null, E_OUT_OF_MEMORY, "Failed to allocate libraryimpl.");
- unsigned long option = _LIBRARY_LOAD_OPTION_LAZY;
- option |= _LIBRARY_LOAD_OPTION_NODELETE;
-
- result r = pLib->Construct(_path, option);
+ result r = pLib->Construct(_path, _LIBRARY_OPTION);
SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
}
_reqId = req;
- SysLog(NID_APP, "Exit");
+ SysLog(NID_APP, "Exit %d", req);
return E_SUCCESS;
SysTryReturnResult(NID_APP, IsValidAppControl(appcontrolID), E_INVALID_OPERATION, "Invalid appcontrolID(%ls)", appcontrolID.GetPointer());
if (_property & _APPCONTROL_PROPERTY_SLP)
- {
- SysTryReturnResult(NID_APP, _reqId != _REQ_ID_INVALID, E_INVALID_OPERATION, "Invalid request ID .");
-
- _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
- SysTryReturnResult(NID_APP, pInfo != null, E_INVALID_OPERATION, "Request ID %d is not found.", _reqId);
-
+ {
result (*pStop)(int req) = null;
- pStop = reinterpret_cast<result (*)(int)>(pInfo->pLib->GetProcAddress(L"TerminateAppControl"));
- SysTryReturnResult(NID_APP, pStop != null, E_SYSTEM, "No TerminateAppControl() function.");
-
- (*pStop)(_reqId);
-
- _AppControlManager::GetInstance()->__inAppManager.RemoveItem(_reqId);
-
- _reqId = _REQ_ID_INVALID;
+
+ if (_reqId != _REQ_ID_INVALID)
+ {
+ _InProcessInfo* pInfo = _AppControlManager::GetInstance()->__inAppManager.FindItem(_reqId);
+ SysTryReturnResult(NID_APP, pInfo != null, E_INVALID_OPERATION, "Request ID %d is not found.", _reqId);
+
+ pStop = reinterpret_cast<result (*)(int)>(pInfo->pLib->GetProcAddress(L"TerminateAppControl"));
+ SysTryReturnResult(NID_APP, pStop != null, E_SYSTEM, "No TerminateAppControl() function.");
+
+ (*pStop)(_reqId);
+
+ _AppControlManager::GetInstance()->__inAppManager.RemoveItem(_reqId);
+
+ _reqId = _REQ_ID_INVALID;
+ }
+ else
+ {
+ _LibraryImpl lib;
+ result r = lib.Construct(_path, _LIBRARY_OPTION);
+ if (r == E_SUCCESS)
+ {
+ pStop = reinterpret_cast<result (*)(int)>(lib.GetProcAddress(L"TerminateAppControl"));
+ SysTryReturnResult(NID_APP, pStop != null, E_SYSTEM, "No TerminateAppControl() function.");
+
+ (*pStop)(_reqId);
+ }
+ }
}
else if (_property & _APPCONTROL_PROPERTY_OSP)
{