On 2017-02-24 02:52, hbelusca@svn.reactos.org wrote:
@@ -4419,12 +4422,31 @@ LPCWSTR UnSafepwc = pwc; LPWORD UnSafepgi = pgi;
- if ((!UnSafepwc) && (!UnSafepgi)) return cwc;
- if ((UnSafepwc == NULL) || (UnSafepgi == NULL))
- /* Check for integer overflow */
- if (cwc & 0x80000000) // (INT_MAX + 1) == INT_MIN
return GDI_ERROR;- if (!UnSafepwc && !UnSafepgi)
return cwc;- if (!UnSafepwc || !UnSafepgi) { DPRINT1("UnSafepwc == %p, UnSafepgi = %p\n", UnSafepwc, UnSafepgi);
return -1;
return GDI_ERROR;- }
- // TODO: Special undocumented case!
- if (!pwc && !pgi && (cwc == 0))
Why the sudden switch away from using the Unsafe version?
{
DPRINT1("ERR: NtGdiGetGlyphIndicesW with (!pwc && !pgi && (cwc == 0)) is UNIMPLEMENTED!\n");return 0;}
// FIXME: This is a hack!! (triggered by e.g. Word 2010). See CORE-12825
if (cwc == 0)
{
DPRINT1("ERR: NtGdiGetGlyphIndicesW with (cwc == 0) is UNIMPLEMENTED!\n");return GDI_ERROR;}
dc = DC_LockDc(hdc);
If 'cwc' is a pointer or anything that would ever become 64 bits in x64 this type of coding needs rewriting using symbolic sizes. (Such as ULONG_PTR(-1) and similar constructs..)
On 2017-02-24 20.42, Thomas Faber wrote:
- /* Check for integer overflow */
- if (cwc & 0x80000000) // (INT_MAX + 1) == INT_MIN
L.
Hi, I completely agree, and that's why I put in comment that INT_MIN stuff.
Hermès
-----Message d'origine----- De : Ros-dev [mailto:ros-dev-bounces@reactos.org] De la part de Neo Love Envoyé : vendredi 3 mars 2017 01:26 À : ReactOS Development List Objet : Re: [ros-dev] [ros-diffs] [hbelusca] 73895: [NTGDI]: Few fixes & hacks for NtGdiGetGlyphIndicesW, see CORE-12825: - (Fix) Check for integer count overflow (per Thomas suggestion), - (Hack#1) Signal the particular calling ca...
If 'cwc' is a pointer or anything that would ever become 64 bits in x64 this type of coding needs rewriting using symbolic sizes. (Such as ULONG_PTR(-1) and similar constructs..)
On 2017-02-24 20.42, Thomas Faber wrote:
- /* Check for integer overflow */
- if (cwc & 0x80000000) // (INT_MAX + 1) == INT_MIN
L. _______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev