You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and if we dont need to use status at all we can pass a nullptr instead of status.
On the other hand, if it is necessary to print out the status,
as here printf("GUIDsAreEqual : UuidEqual() [status %#x]", status);, consider refactoring the function like
Yes, you are right.
This function is really a bit bloated and can be stripped down, stripped down like you did.
This code is taken from: Windows-driver-samples\network\trans\WFPSampler
The function can be written as
bool GUIDsAreEqual(In const GUID* pGUIDAlpha, In const GUID* pGUIDOmega)
{
RPC_STATUS status = ERROR_TIMEOUT;
}
and if we dont need to use status at all we can pass a nullptr instead of status.
On the other hand, if it is necessary to print out the status,
as here
printf("GUIDsAreEqual : UuidEqual() [status %#x]", status);
, consider refactoring the function likebool GUIDsAreEqual(In const GUID* pGUIDAlpha, In const GUID* pGUIDOmega, RPC_STATUS* status)
{
return (UuidEqual((UUID*)pGUIDAlpha, (UUID*)pGUIDOmega, status) == RPC_S_OK) ? true : false;
}
Both alternatives will reduce the size and increase readability, as well as removing the goto statement.
The text was updated successfully, but these errors were encountered: