Skip to content

Commit

Permalink
Rename PhFreeJsonParser to PhFreeJsonObject
Browse files Browse the repository at this point in the history
  • Loading branch information
dmex committed Aug 31, 2021
1 parent a0c7292 commit 3e58457
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion ProcessHacker/ProcessHacker.def
Expand Up @@ -708,7 +708,7 @@ EXPORTS

; json
PhCreateJsonParser
PhFreeJsonParser
PhFreeJsonObject
PhGetJsonValueAsString
PhGetJsonValueAsInt64
PhGetJsonValueAsUInt64
Expand Down
4 changes: 2 additions & 2 deletions phlib/hndlinfo.c
Expand Up @@ -454,7 +454,7 @@ VOID PhInitializeEtwTraceGuidCache(

if (!(arrayLength = PhGetJsonArrayLength(jsonObject)))
{
PhFreeJsonParser(jsonObject);
PhFreeJsonObject(jsonObject);
return;
}

Expand Down Expand Up @@ -488,7 +488,7 @@ VOID PhInitializeEtwTraceGuidCache(
PhDereferenceObject(guidString);
}

PhFreeJsonParser(jsonObject);
PhFreeJsonObject(jsonObject);
PhDereferenceObject(capabilityListString);
}

Expand Down
2 changes: 1 addition & 1 deletion phlib/include/json.h
Expand Up @@ -43,7 +43,7 @@ PhCreateJsonParser(
PHLIBAPI
VOID
NTAPI
PhFreeJsonParser(
PhFreeJsonObject(
_In_ PVOID Object
);

Expand Down
2 changes: 1 addition & 1 deletion phlib/json.c
Expand Up @@ -51,7 +51,7 @@ PVOID PhCreateJsonParser(
return json_tokener_parse(JsonString);
}

VOID PhFreeJsonParser(
VOID PhFreeJsonObject(
_In_ PVOID Object
)
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/DotNetTools/clrsup.c
Expand Up @@ -857,7 +857,7 @@ PPH_BYTES DnProcessAppDomainListSerialize(
}

string = PhGetJsonArrayString(jsonArray, FALSE);
PhFreeJsonParser(jsonArray);
PhFreeJsonObject(jsonArray);

return string;
}
Expand Down Expand Up @@ -946,7 +946,7 @@ PPH_LIST DnProcessAppDomainListDeserialize(
}

CleanupExit:
PhFreeJsonParser(jsonArray);
PhFreeJsonObject(jsonArray);

return processAppdomainList;
}
Expand Down
12 changes: 6 additions & 6 deletions plugins/OnlineChecks/upload.c
Expand Up @@ -803,7 +803,7 @@ NTSTATUS UploadFileThreadStart(
goto CleanupExit;
}

PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);
}
else
{
Expand Down Expand Up @@ -867,7 +867,7 @@ NTSTATUS UploadFileThreadStart(
PhMoveReference(&context->LaunchCommand, PhGetJsonValueAsString(jsonRootObject, "permalink"));
}

PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);
}

if (PhIsNullOrEmptyString(context->LaunchCommand))
Expand Down Expand Up @@ -902,7 +902,7 @@ NTSTATUS UploadFileThreadStart(
PhDereferenceObject(redirectUrl);
}

PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);
}

PhDereferenceObject(jsonString);
Expand Down Expand Up @@ -1093,7 +1093,7 @@ NTSTATUS UploadCheckThreadStart(
}

PhClearReference(&errorMessage);
PhFreeJsonParser(rootJsonObject);
PhFreeJsonObject(rootJsonObject);
}
else
{
Expand Down Expand Up @@ -1228,7 +1228,7 @@ NTSTATUS UploadCheckThreadStart(
if (vt3RootJsonObject = PhCreateJsonParser(vt3UploadRequestBuffer->Buffer))
{
context->UploadUrl = PhGetJsonValueAsString(vt3RootJsonObject, "data");
PhFreeJsonParser(vt3RootJsonObject);
PhFreeJsonObject(vt3RootJsonObject);
}

PhClearReference(&vt3UploadRequestBuffer);
Expand All @@ -1245,7 +1245,7 @@ NTSTATUS UploadCheckThreadStart(
}
}

PhFreeJsonParser(rootJsonObject);
PhFreeJsonObject(rootJsonObject);
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions plugins/OnlineChecks/virustotal.c
Expand Up @@ -477,7 +477,7 @@ PVIRUSTOTAL_FILE_REPORT VirusTotalRequestFileReport(
PhHttpSocketDestroy(httpContext);

if (jsonRootObject)
PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);

PhClearReference(&jsonString);
PhClearReference(&versionString);
Expand Down Expand Up @@ -604,7 +604,7 @@ PVIRUSTOTAL_API_RESPONSE VirusTotalRequestFileReScan(
PhHttpSocketDestroy(httpContext);

if (jsonRootObject)
PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);

PhClearReference(&jsonString);
PhClearReference(&versionString);
Expand Down Expand Up @@ -711,7 +711,7 @@ PVIRUSTOTAL_API_RESPONSE VirusTotalRequestIpAddressReport(
PhHttpSocketDestroy(httpContext);

if (jsonRootObject)
PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);

PhClearReference(&jsonString);
PhClearReference(&versionString);
Expand Down Expand Up @@ -841,15 +841,15 @@ NTSTATUS NTAPI VirusTotalProcessApiThread(

if (rootJsonObject)
{
PhFreeJsonParser(rootJsonObject);
PhFreeJsonObject(rootJsonObject);
}

if (jsonArrayToSendString)
PhDereferenceObject(jsonArrayToSendString);

if (jsonArray)
{
PhFreeJsonParser(jsonArray);
PhFreeJsonObject(jsonArray);
}

if (jsonApiResult)
Expand Down
2 changes: 1 addition & 1 deletion plugins/Updater/options.c
Expand Up @@ -313,7 +313,7 @@ PPH_LIST PhpUpdaterQueryCommitHistory(
PhHttpSocketDestroy(httpContext);

if (jsonRootObject)
PhFreeJsonParser(jsonRootObject);
PhFreeJsonObject(jsonRootObject);

PhClearReference(&jsonString);
PhClearReference(&versionString);
Expand Down
4 changes: 2 additions & 2 deletions plugins/Updater/updater.c
Expand Up @@ -428,7 +428,7 @@ BOOLEAN QueryUpdateData(
Context->LatestVersion = ParseVersionString(Context->Version);
#endif

PhFreeJsonParser(jsonObject);
PhFreeJsonObject(jsonObject);

if (PhIsNullOrEmptyString(Context->Version))
goto CleanupExit;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ VOID ShowStartupUpdateDialog(
#else
context->LatestVersion = ParseVersionString(context->Version);
#endif
PhFreeJsonParser(jsonObject);
PhFreeJsonObject(jsonObject);
}

PhDereferenceObject(jsonStringUtf8);
Expand Down

0 comments on commit 3e58457

Please sign in to comment.