On Thu Jul 13 18:07:29 2023 +0000, Gabriel Ivăncescu wrote:
> There's no need for a cast though. `ARRAY_SIZE` is already `size_t`
> (because it's implemented with `sizeof`), and a comparison between a
> signed integer and an unsigned integer with at least as many bits is
> always promoted to unsigned.
That is true. This thread can be dismissed then.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3301#note_38929
On Thu Jul 13 16:37:28 2023 +0000, Jeffrey Smith wrote:
> Compilers can (and at least some do) treat an enumeration as a _signed_
> integer. For the comparison to work as desired you'll want to cast
> `InformationClass` to an unsigned type. I think `size_t` would be appropriate.
There's no need for a cast though. `ARRAY_SIZE` is already `size_t` (because it's implemented with `sizeof`), and a comparison between a signed integer and an unsigned integer with at least as many bits is always promoted to unsigned.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3301#note_38928
Fall through in create_link and allow SHGetFolderPathAndSubDirW to
create an empty folder in place if the alternatives are not available.
Creating a link back to $HOME makes a recursive directory structure,
which results in crashes in programs that naively search %USERPROFILE%
(e.g. Quicken).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3325
Jeffrey Smith (@whydoubt) commented about dlls/advapi32/lsa.c:
> + "PolicyReplicaSourceInformation",
> + "PolicyDefaultQuotaInformation",
> + "PolicyModificationInformation",
> + "PolicyAuditFullSetInformation",
> + "PolicyAuditFullQueryInformation",
> + "PolicyDnsDomainInformation",
> + "PolicyDnsDomainInformationInt",
> + "PolicyLocalAccountDomainInformation",
> + "PolicyMachineAccountInformation",
> + "PolicyMachineAccountInformation2",
> + "PolicyLastEntry"
> +};
> +
> +static LPCSTR debugstr_InformationClass(IN POLICY_INFORMATION_CLASS InformationClass)
> +{
> + if (InformationClass >= ARRAY_SIZE(string_InformationClass))
Compilers can (and at least some do) treat an enumeration as a _signed_ integer. For the comparison to work as desired you'll want to cast `InformationClass` to an unsigned type. I think `size_t` would be appropriate.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3301#note_38926