[SERVICES] Implement RI_ScQueryServiceTagInfo

This commit is contained in:
Pierre Schweitzer 2018-12-30 12:25:18 +01:00
parent e29a99245b
commit 90f5e6b6c3
No known key found for this signature in database
GPG Key ID: 7545556C3D585B0B
3 changed files with 42 additions and 2 deletions

View File

@ -145,6 +145,14 @@ ScmGetServiceImageByImagePath(LPWSTR lpImagePath)
}
DWORD
ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams)
{
UNIMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED;
}
static
BOOL
ScmIsSameServiceAccount(

View File

@ -6586,8 +6586,38 @@ RI_ScQueryServiceTagInfo(
PTAG_INFO_NAME_FROM_TAG_IN_PARAMS * lpInParams,
PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS * lpOutParams)
{
UNIMPLEMENTED;
return ERROR_CALL_NOT_IMPLEMENTED;
PMANAGER_HANDLE hManager;
/* Validate handle */
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
return ERROR_INVALID_HANDLE;
}
/* FIXME: should check whether client is local */
/* Check access rights */
if (!RtlAreAllAccessesGranted(hManager->Handle.DesiredAccess,
SC_MANAGER_ENUMERATE_SERVICE))
{
return ERROR_ACCESS_DENIED;
}
/* Check parameters */
if (lpInParams == NULL || lpOutParams == NULL)
{
return ERROR_INVALID_PARAMETER;
}
/* Check info level */
if (dwInfoLevel != TagInfoLevelNameFromTag)
{
return ERROR_RETRY;
}
/* Call internal helper */
return ScmGetServiceNameFromTag(*lpInParams, lpOutParams);
}

View File

@ -197,6 +197,8 @@ VOID ScmUnlockDatabase(VOID);
VOID ScmInitNamedPipeCriticalSection(VOID);
VOID ScmDeleteNamedPipeCriticalSection(VOID);
DWORD ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams,
PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams);
/* driver.c */