mirror of
https://github.com/reactos/reactos.git
synced 2025-05-01 19:50:36 +00:00
[SERVICES] Properly check again PID
This fixes services not being found. With that commit and the previous one, I_QueryTagInformation is now fully functionnal and properly returns service name for a specific tag
This commit is contained in:
parent
ebf8785661
commit
c10901966e
1 changed files with 7 additions and 3 deletions
|
@ -147,7 +147,8 @@ ScmGetServiceImageByImagePath(LPWSTR lpImagePath)
|
||||||
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams)
|
ScmGetServiceNameFromTag(IN PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams,
|
||||||
|
OUT PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY ServiceEntry;
|
PLIST_ENTRY ServiceEntry;
|
||||||
PSERVICE CurrentService;
|
PSERVICE CurrentService;
|
||||||
|
@ -172,7 +173,7 @@ ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_N
|
||||||
{
|
{
|
||||||
CurrentImage = CurrentService->lpImage;
|
CurrentImage = CurrentService->lpImage;
|
||||||
/* And matching the PID */
|
/* And matching the PID */
|
||||||
if (CurrentImage->hProcess == (HANDLE)InParams->dwPid)
|
if (CurrentImage->dwProcessId == InParams->dwPid)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -220,7 +221,10 @@ Cleanup:
|
||||||
/* If failure, free allocated memory */
|
/* If failure, free allocated memory */
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
MIDL_user_free(OutBuffer);
|
if (OutBuffer != NULL)
|
||||||
|
{
|
||||||
|
MIDL_user_free(OutBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return error/success */
|
/* Return error/success */
|
||||||
|
|
Loading…
Reference in a new issue