Internal functions should return an error code instead of calling SetLastError.
Perhaps in a general sense, but URLCache_CopyEntry already did SetLastError(ERROR_INSUFFICIENT_BUFFER): setting it there means the 4 places that call it don't need to the logic to set the 2 different errors themselves.
Having the inconsistent case marked out is also not a bad thing IMO - it wouldn't be as clear that its a special case if the SetLastError logic was after each call to URLCache_CopyEntry and one of four was subtly different.
J