Author: fireball
Date: Thu Jan 27 18:02:02 2011
New Revision: 50516
URL:
http://svn.reactos.org/svn/reactos?rev=50516&view=rev
Log:
[VENDOR/WINE]
- Import Wine-1.3.12 gdi32, user32, winex11.drv, server.
- IMPORTANT: user32 translatable resources were NOT imported.
Modified:
vendor/wine/dlls/gdi32/current/font.c
vendor/wine/dlls/gdi32/current/tests/font.c
vendor/wine/dlls/gdi32/current/tests/gdiobj.c
vendor/wine/dlls/gdi32/current/tests/metafile.c
vendor/wine/dlls/gdi32/current/tests/pen.c
vendor/wine/dlls/user32/current/Makefile.in
vendor/wine/dlls/user32/current/cursoricon.c
vendor/wine/dlls/user32/current/tests/class.c
vendor/wine/dlls/user32/current/tests/clipboard.c
vendor/wine/dlls/user32/current/tests/dde.c
vendor/wine/dlls/user32/current/tests/menu.c
vendor/wine/dlls/user32/current/tests/win.c
vendor/wine/dlls/winex11.drv/current/keyboard.c
vendor/wine/dlls/winex11.drv/current/opengl.c
vendor/wine/dlls/winex11.drv/current/window.c
vendor/wine/server/current/change.c
vendor/wine/server/current/console.c
vendor/wine/server/current/protocol.def
vendor/wine/server/current/ptrace.c
vendor/wine/server/current/request.h
vendor/wine/server/current/trace.c
Modified: vendor/wine/dlls/gdi32/current/font.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/font.c?re…
==============================================================================
--- vendor/wine/dlls/gdi32/current/font.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/font.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -1553,6 +1553,31 @@
return ret;
}
+static LPSTR FONT_GetCharsByRangeA(UINT firstChar, UINT lastChar, PINT pByteLen)
+{
+ INT i, count = lastChar - firstChar + 1;
+ UINT c;
+ LPSTR str;
+
+ if (count <= 0)
+ return NULL;
+
+ str = HeapAlloc(GetProcessHeap(), 0, count * 2 + 1);
+ if (str == NULL)
+ return NULL;
+
+ for(i = 0, c = firstChar; c <= lastChar; i++, c++)
+ {
+ if (c > 0xff)
+ str[i++] = (BYTE)(c >> 8);
+ str[i] = (BYTE)c;
+ }
+ str[i] = '\0';
+
+ *pByteLen = i;
+
+ return str;
+}
/***********************************************************************
* GetCharWidthW (GDI32.@)
@@ -1590,18 +1615,16 @@
BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar,
LPINT buffer )
{
- INT i, wlen, count = (INT)(lastChar - firstChar + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if(count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(firstChar + i);
-
- wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
+ str = FONT_GetCharsByRangeA(firstChar, lastChar, &i);
+ if(str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL);
for(i = 0; i < wlen; i++)
{
@@ -2296,18 +2319,21 @@
BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar,
LPABC abc )
{
- INT i, wlen, count = (INT)(lastChar - firstChar + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if(count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(firstChar + i);
-
- wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL);
+ str = FONT_GetCharsByRangeA(firstChar, lastChar, &i);
+ if (str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc(hdc, str, i, &wlen, NULL);
+ if (wstr == NULL)
+ {
+ HeapFree(GetProcessHeap(), 0, str);
+ return FALSE;
+ }
for(i = 0; i < wlen; i++)
{
@@ -2979,19 +3005,16 @@
*/
BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf )
{
- INT i, wlen, count = (INT)(last - first + 1);
+ INT i, wlen;
LPSTR str;
LPWSTR wstr;
BOOL ret = TRUE;
- if (count <= 0) return FALSE;
-
- str = HeapAlloc(GetProcessHeap(), 0, count);
-
- for(i = 0; i < count; i++)
- str[i] = (BYTE)(first + i);
-
- wstr = FONT_mbtowc( hdc, str, count, &wlen, NULL );
+ str = FONT_GetCharsByRangeA(first, last, &i);
+ if (str == NULL)
+ return FALSE;
+
+ wstr = FONT_mbtowc( hdc, str, i, &wlen, NULL );
for (i = 0; i < wlen; i++)
{
Modified: vendor/wine/dlls/gdi32/current/tests/font.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/fon…
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/font.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/font.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -37,7 +37,9 @@
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n",
expected, got)
static LONG (WINAPI *pGdiGetCharDimensions)(HDC hdc, LPTEXTMETRICW lptm, LONG *height);
+static DWORD (WINAPI *pGdiGetCodePage)(HDC hdc);
static BOOL (WINAPI *pGetCharABCWidthsI)(HDC hdc, UINT first, UINT count, LPWORD glyphs,
LPABC abc);
+static BOOL (WINAPI *pGetCharABCWidthsA)(HDC hdc, UINT first, UINT last, LPABC abc);
static BOOL (WINAPI *pGetCharABCWidthsW)(HDC hdc, UINT first, UINT last, LPABC abc);
static DWORD (WINAPI *pGetFontUnicodeRanges)(HDC hdc, LPGLYPHSET lpgs);
static DWORD (WINAPI *pGetGlyphIndicesA)(HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi,
DWORD flags);
@@ -54,7 +56,9 @@
hgdi32 = GetModuleHandleA("gdi32.dll");
pGdiGetCharDimensions = (void *)GetProcAddress(hgdi32,
"GdiGetCharDimensions");
+ pGdiGetCodePage = (void *) GetProcAddress(hgdi32,"GdiGetCodePage");
pGetCharABCWidthsI = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsI");
+ pGetCharABCWidthsA = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsA");
pGetCharABCWidthsW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsW");
pGetFontUnicodeRanges = (void *)GetProcAddress(hgdi32,
"GetFontUnicodeRanges");
pGetGlyphIndicesA = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesA");
@@ -729,11 +733,7 @@
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 14, 96, FS_LATIN1 },
{ "System", FW_BOLD, 16, 13, 3, 3, 0, 7, 15, 96, FS_LATIN2 |
FS_CYRILLIC },
-/*
- * TODO: the system for CP932 should be NORMAL, not BOLD. However that would
- * require a new system.sfd for that font
- */
- { "System", FW_BOLD, 18, 16, 2, 0, 2, 8, 16, 96, FS_JISJAPAN },
+ { "System", FW_NORMAL, 18, 16, 2, 0, 2, 8, 16, 96, FS_JISJAPAN },
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 14, 120, FS_LATIN1 },
{ "System", FW_BOLD, 20, 16, 4, 4, 0, 9, 17, 120, FS_LATIN2 |
FS_CYRILLIC },
@@ -800,6 +800,7 @@
{
DWORD fs[2];
CHARSETINFO csi;
+ BOOL bRet;
fs[0] = 1L << bit;
fs[1] = 0;
@@ -812,7 +813,8 @@
hfont = create_font(lf.lfFaceName, &lf);
old_hfont = SelectObject(hdc, hfont);
- ok(GetTextMetrics(hdc, &tm), "GetTextMetrics error %d\n",
GetLastError());
+ bRet = GetTextMetrics(hdc, &tm);
+ ok(bRet, "GetTextMetrics error %d\n", GetLastError());
if(fd[i].dpi == tm.tmDigitizedAspectX)
{
trace("found font %s, height %d charset %x dpi %d\n",
lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi);
@@ -875,6 +877,25 @@
DeleteDC(hdc);
}
+static int CALLBACK create_font_proc(const LOGFONT *lpelfe,
+ const TEXTMETRIC *lpntme,
+ DWORD FontType, LPARAM lParam)
+{
+ if (FontType & TRUETYPE_FONTTYPE)
+ {
+ HFONT hfont;
+
+ hfont = CreateFontIndirect(lpelfe);
+ if (hfont)
+ {
+ *(HFONT *)lParam = hfont;
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
static void test_GetCharABCWidths(void)
{
static const WCHAR str[] = {'a',0};
@@ -885,10 +906,24 @@
ABC abc[1];
WORD glyphs[1];
DWORD nb;
-
- if (!pGetCharABCWidthsW || !pGetCharABCWidthsI)
- {
- win_skip("GetCharABCWidthsW/I not available on this platform\n");
+ static const struct
+ {
+ UINT cs;
+ UINT a;
+ UINT w;
+ } c[] =
+ {
+ {SHIFTJIS_CHARSET, 0x82a0, 0x3042},
+ {HANGEUL_CHARSET, 0x8141, 0xac02},
+ {JOHAB_CHARSET, 0x8446, 0x3135},
+ {GB2312_CHARSET, 0x8141, 0x4e04},
+ {CHINESEBIG5_CHARSET, 0xa142, 0x3001}
+ };
+ UINT i;
+
+ if (!pGetCharABCWidthsA || !pGetCharABCWidthsW || !pGetCharABCWidthsI)
+ {
+ win_skip("GetCharABCWidthsA/W/I not available on this platform\n");
return;
}
@@ -923,6 +958,43 @@
hfont = SelectObject(hdc, hfont);
DeleteObject(hfont);
+
+ for (i = 0; i < sizeof c / sizeof c[0]; ++i)
+ {
+ ABC a[2], w[2];
+ ABC full[256];
+ UINT code = 0x41;
+
+ lf.lfFaceName[0] = '\0';
+ lf.lfCharSet = c[i].cs;
+ lf.lfPitchAndFamily = 0;
+ if (EnumFontFamiliesEx(hdc, &lf, create_font_proc, (LPARAM)&hfont, 0))
+ {
+ skip("TrueType font for charset %u is not installed\n", c[i].cs);
+ continue;
+ }
+
+ memset(a, 0, sizeof a);
+ memset(w, 0, sizeof w);
+ hfont = SelectObject(hdc, hfont);
+ ok(pGetCharABCWidthsA(hdc, c[i].a, c[i].a + 1, a) &&
+ pGetCharABCWidthsW(hdc, c[i].w, c[i].w + 1, w) &&
+ memcmp(a, w, sizeof a) == 0,
+ "GetCharABCWidthsA and GetCharABCWidthsW should return same widths.
charset = %u\n", c[i].cs);
+
+ memset(a, 0xbb, sizeof a);
+ ret = pGetCharABCWidthsA(hdc, code, code, a);
+ ok(ret, "GetCharABCWidthsA should have succeeded\n");
+ memset(full, 0xcc, sizeof full);
+ ret = pGetCharABCWidthsA(hdc, 0x00, code, full);
+ ok(ret, "GetCharABCWidthsA should have succeeded\n");
+ ok(memcmp(&a[0], &full[code], sizeof(ABC)) == 0,
+ "GetCharABCWidthsA info should match. codepage = %u\n", c[i].cs);
+
+ hfont = SelectObject(hdc, hfont);
+ DeleteObject(hfont);
+ }
+
ReleaseDC(NULL, hdc);
}
@@ -1166,6 +1238,7 @@
for (i = 0; i < sizeof(kd)/sizeof(kd[0]); i++)
{
OUTLINETEXTMETRICW otm;
+ UINT uiRet;
if (!is_font_installed(kd[i].face_name))
{
@@ -1185,7 +1258,8 @@
SetLastError(0xdeadbeef);
otm.otmSize = sizeof(otm); /* just in case for Win9x compatibility */
- ok(GetOutlineTextMetricsW(hdc, sizeof(otm), &otm) == sizeof(otm),
"GetOutlineTextMetricsW error %d\n", GetLastError());
+ uiRet = GetOutlineTextMetricsW(hdc, sizeof(otm), &otm);
+ ok(uiRet == sizeof(otm), "GetOutlineTextMetricsW error %d\n",
GetLastError());
ok(match_off_by_1(kd[i].tmHeight, otm.otmTextMetrics.tmHeight), "expected
%d, got %d\n",
kd[i].tmHeight, otm.otmTextMetrics.tmHeight);
@@ -1599,6 +1673,14 @@
}
ok(csi.ciACP == code_page, "expected %d, got %d\n", code_page, csi.ciACP);
+ if (pGdiGetCodePage != NULL && pGdiGetCodePage(hdc) != code_page)
+ {
+ skip("Font code page %d, looking for code page %d\n",
+ pGdiGetCodePage(hdc), code_page);
+ ReleaseDC(0, hdc);
+ return FALSE;
+ }
+
if (unicode)
{
char ansi_buf[128];
@@ -1610,7 +1692,8 @@
SetLastError(0xdeadbeef);
ret = pGetGlyphIndicesW(hdc, unicode_buf, count, idx, 0);
- ok(ret == count, "GetGlyphIndicesW error %u\n", GetLastError());
+ ok(ret == count, "GetGlyphIndicesW expected %d got %d, error %u\n",
+ count, ret, GetLastError());
}
else
{
@@ -1620,7 +1703,8 @@
SetLastError(0xdeadbeef);
ret = pGetGlyphIndicesA(hdc, ansi_buf, count, idx, 0);
- ok(ret == count, "GetGlyphIndicesA error %u\n", GetLastError());
+ ok(ret == count, "GetGlyphIndicesA expected %d got %d, error %u\n",
+ count, ret, GetLastError());
}
SelectObject(hdc, hfont_old);
@@ -1668,9 +1752,9 @@
break;
}
}
- get_glyph_indices(cd[i].charset, cd[i].code_page, cd[i].font_idxA, 128, FALSE);
- get_glyph_indices(cd[i].charset, cd[i].code_page, cd[i].font_idxW, 128, TRUE);
- ok(!memcmp(cd[i].font_idxA, cd[i].font_idxW, 128*sizeof(WORD)), "%d: indices
don't match\n", i);
+ if (get_glyph_indices(cd[i].charset, cd[i].code_page, cd[i].font_idxA, 128,
FALSE) &&
+ get_glyph_indices(cd[i].charset, cd[i].code_page, cd[i].font_idxW, 128,
TRUE))
+ ok(!memcmp(cd[i].font_idxA, cd[i].font_idxW, 128*sizeof(WORD)), "%d:
indices don't match\n", i);
}
ok(memcmp(cd[0].font_idxW, cd[1].font_idxW, 128*sizeof(WORD)), "0 vs 1: indices
shouldn't match\n");
@@ -2228,7 +2312,9 @@
static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V2 *os2, WORD family, const
char *name)
{
- ok((tmA->tmPitchAndFamily & 0xf0) == family, "%s: expected family %02x
got %02x. panose %d-%d-%d-%d-...\n",
+ ok((tmA->tmPitchAndFamily & 0xf0) == family ||
+ broken(PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH),
+ "%s: expected family %02x got %02x. panose %d-%d-%d-%d-...\n",
name, family, tmA->tmPitchAndFamily, os2->panose.bFamilyType,
os2->panose.bSerifStyle,
os2->panose.bWeight, os2->panose.bProportion);
}
@@ -2387,7 +2473,9 @@
const char *font_name = lf->lfFaceName;
DWORD cmap_first = 0, cmap_last = 0;
cmap_type cmap_type;
-
+ BOOL sys_lang_non_english;
+
+ sys_lang_non_english = PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH;
hdc = GetDC(0);
SetLastError(0xdeadbeef);
@@ -2481,12 +2569,16 @@
ok(tmA.tmFirstChar == expect_first_A ||
tmA.tmFirstChar == expect_first_A + 1 /* win9x */,
"A: tmFirstChar for %s got %02x expected %02x\n", font_name,
tmA.tmFirstChar, expect_first_A);
- ok(tmA.tmLastChar == expect_last_A ||
- tmA.tmLastChar == 0xff /* win9x */,
- "A: tmLastChar for %s got %02x expected %02x\n", font_name,
tmA.tmLastChar, expect_last_A);
+ if (pGdiGetCodePage == NULL || ! IsDBCSLeadByteEx(pGdiGetCodePage(hdc),
tmA.tmLastChar))
+ ok(tmA.tmLastChar == expect_last_A ||
+ tmA.tmLastChar == 0xff /* win9x */,
+ "A: tmLastChar for %s got %02x expected %02x\n", font_name,
tmA.tmLastChar, expect_last_A);
+ else
+ skip("tmLastChar is DBCS lead byte\n");
ok(tmA.tmBreakChar == expect_break_A, "A: tmBreakChar for %s got %02x
expected %02x\n",
font_name, tmA.tmBreakChar, expect_break_A);
- ok(tmA.tmDefaultChar == expect_default_A, "A: tmDefaultChar for %s got %02x
expected %02x\n",
+ ok(tmA.tmDefaultChar == expect_default_A || broken(sys_lang_non_english),
+ "A: tmDefaultChar for %s got %02x expected %02x\n",
font_name, tmA.tmDefaultChar, expect_default_A);
@@ -2513,7 +2605,8 @@
font_name, tmW.tmLastChar, expect_last_W);
ok(tmW.tmBreakChar == expect_break_W, "W: tmBreakChar for %s got %02x
expected %02x\n",
font_name, tmW.tmBreakChar, expect_break_W);
- ok(tmW.tmDefaultChar == expect_default_W, "W: tmDefaultChar for %s got
%02x expected %02x\n",
+ ok(tmW.tmDefaultChar == expect_default_W || broken(sys_lang_non_english),
+ "W: tmDefaultChar for %s got %02x expected %02x\n",
font_name, tmW.tmDefaultChar, expect_default_W);
/* Test the aspect ratio while we have tmW */
@@ -2687,7 +2780,7 @@
!lstrcmpiA(buf, "MS Sans Serif"), /* win2k3 */
"Got %s\n", buf);
cs = GetTextCharset(hdc);
- ok(cs == expected_cs, "expected %d, got %d\n", expected_cs, cs);
+ ok(cs == expected_cs || cs == ANSI_CHARSET, "expected %d, got %d\n",
expected_cs, cs);
DeleteObject(SelectObject(hdc, hfont));
memset(&lf, 0, sizeof(lf));
@@ -2752,7 +2845,7 @@
!lstrcmpiA(buf, "MS Sans Serif"), /* win2k3 */
"got %s for font %s\n", buf, font_subst[i].name);
cs = GetTextCharset(hdc);
- ok(cs == expected_cs, "expected %d, got %d for font %s\n", expected_cs,
cs, font_subst[i].name);
+ ok(cs == expected_cs || cs == ANSI_CHARSET, "expected %d, got %d for font
%s\n", expected_cs, cs, font_subst[i].name);
DeleteObject(SelectObject(hdc, hfont));
}
@@ -3197,6 +3290,7 @@
void *font;
DWORD font_size, num_fonts;
HANDLE ret;
+ BOOL bRet;
if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx)
{
@@ -3284,7 +3378,8 @@
free_font(font);
SetLastError(0xdeadbeef);
- ok(pRemoveFontMemResourceEx(ret), "RemoveFontMemResourceEx error %d\n",
GetLastError());
+ bRet = pRemoveFontMemResourceEx(ret);
+ ok(bRet, "RemoveFontMemResourceEx error %d\n", GetLastError());
/* test invalid pointer to number of loaded fonts */
font = load_font("sserife.fon", &font_size);
Modified: vendor/wine/dlls/gdi32/current/tests/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/gdi…
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/gdiobj.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/gdiobj.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -118,6 +118,7 @@
static DWORD WINAPI thread_proc(void *param)
{
LOGPEN lp;
+ DWORD status;
struct hgdiobj_event *hgdiobj_event = param;
hgdiobj_event->hdc = CreateDC("display", NULL, NULL, NULL);
@@ -130,8 +131,8 @@
ok(hgdiobj_event->hgdiobj2 != 0, "Failed to create pen\n");
SetEvent(hgdiobj_event->ready_event);
- ok(WaitForSingleObject(hgdiobj_event->stop_event, INFINITE) == WAIT_OBJECT_0,
- "WaitForSingleObject error %u\n", GetLastError());
+ status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE);
+ ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n",
GetLastError());
ok(!GetObject(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject
should fail\n");
@@ -147,6 +148,8 @@
HANDLE hthread;
struct hgdiobj_event hgdiobj_event;
INT ret;
+ DWORD status;
+ BOOL bRet;
hgdiobj_event.stop_event = CreateEvent(NULL, 0, 0, NULL);
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n",
GetLastError());
@@ -156,11 +159,11 @@
hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid);
ok(hthread != NULL, "CreateThread error %u\n", GetLastError());
- ok(WaitForSingleObject(hgdiobj_event.ready_event, INFINITE) == WAIT_OBJECT_0,
- "WaitForSingleObject error %u\n", GetLastError());
-
- ok(GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp) == sizeof(lp),
- "GetObject error %u\n", GetLastError());
+ status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE);
+ ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n",
GetLastError());
+
+ ret = GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp);
+ ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError());
ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle);
ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y);
@@ -169,20 +172,23 @@
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY
not %d\n", ret);
- ok(DeleteObject(hgdiobj_event.hgdiobj1), "DeleteObject error %u\n",
GetLastError());
- ok(DeleteDC(hgdiobj_event.hdc), "DeleteDC error %u\n", GetLastError());
+ bRet = DeleteObject(hgdiobj_event.hgdiobj1);
+ ok(bRet, "DeleteObject error %u\n", GetLastError());
+ bRet = DeleteDC(hgdiobj_event.hdc);
+ ok(bRet, "DeleteDC error %u\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
SetEvent(hgdiobj_event.stop_event);
- ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0,
- "WaitForSingleObject error %u\n", GetLastError());
+ status = WaitForSingleObject(hthread, INFINITE);
+ ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n",
GetLastError());
CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
- ok(DeleteObject(hgdiobj_event.hgdiobj2), "DeleteObject error %u\n",
GetLastError());
+ bRet = DeleteObject(hgdiobj_event.hgdiobj2);
+ ok(bRet, "DeleteObject error %u\n", GetLastError());
CloseHandle(hgdiobj_event.stop_event);
CloseHandle(hgdiobj_event.ready_event);
Modified: vendor/wine/dlls/gdi32/current/tests/metafile.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/met…
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/metafile.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/metafile.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -340,13 +340,17 @@
ret = GetWorldTransform(hdc, &xform);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
- ok(GetWindowOrgEx(hdc, &pt), "GetWindowOrgEx error %u\n",
GetLastError());
+ ret = GetWindowOrgEx(hdc, &pt);
+ ok(ret, "GetWindowOrgEx error %u\n", GetLastError());
trace("window org (%d,%d)\n", pt.x, pt.y);
- ok(GetViewportOrgEx(hdc, &pt), "GetViewportOrgEx error %u\n",
GetLastError());
+ ret = GetViewportOrgEx(hdc, &pt);
+ ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
trace("vport org (%d,%d)\n", pt.x, pt.y);
- ok(GetWindowExtEx(hdc, &size), "GetWindowExtEx error %u\n",
GetLastError());
+ ret = GetWindowExtEx(hdc, &size);
+ ok(ret, "GetWindowExtEx error %u\n", GetLastError());
trace("window ext (%d,%d)\n", size.cx, size.cy);
- ok(GetViewportExtEx(hdc, &size), "GetViewportExtEx error %u\n",
GetLastError());
+ ret = GetViewportExtEx(hdc, &size);
+ ok(ret, "GetViewportExtEx error %u\n", GetLastError());
trace("vport ext (%d,%d)\n", size.cx, size.cy);
}
else
@@ -458,13 +462,17 @@
ret = GetWorldTransform(hdc, &xform);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
- ok(GetWindowOrgEx(hdc, &pt), "GetWindowOrgEx error %u\n",
GetLastError());
+ ret = GetWindowOrgEx(hdc, &pt);
+ ok(ret, "GetWindowOrgEx error %u\n", GetLastError());
trace("window org (%d,%d)\n", pt.x, pt.y);
- ok(GetViewportOrgEx(hdc, &pt), "GetViewportOrgEx error %u\n",
GetLastError());
+ ret = GetViewportOrgEx(hdc, &pt);
+ ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
trace("vport org (%d,%d)\n", pt.x, pt.y);
- ok(GetWindowExtEx(hdc, &size), "GetWindowExtEx error %u\n",
GetLastError());
+ ret = GetWindowExtEx(hdc, &size);
+ ok(ret, "GetWindowExtEx error %u\n", GetLastError());
trace("window ext (%d,%d)\n", size.cx, size.cy);
- ok(GetViewportExtEx(hdc, &size), "GetViewportExtEx error %u\n",
GetLastError());
+ ret = GetViewportExtEx(hdc, &size);
+ ok(ret, "GetViewportExtEx error %u\n", GetLastError());
trace("vport ext (%d,%d)\n", size.cx, size.cy);
}
else
@@ -1664,6 +1672,7 @@
ret = DeleteMetaFile(hmf);
ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError());
+#ifndef _WIN64 /* Generates access violation on XP x64 and Win2003 x64 */
/* Now with zeroed out mtSize field */
memcpy(buf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS));
mh = (METAHEADER *)buf;
@@ -1681,6 +1690,7 @@
ret = DeleteMetaFile(hmf);
ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError());
+#endif
}
/* Simple APIs from mfdrv/graphics.c
Modified: vendor/wine/dlls/gdi32/current/tests/pen.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/gdi32/current/tests/pen…
==============================================================================
--- vendor/wine/dlls/gdi32/current/tests/pen.c [iso-8859-1] (original)
+++ vendor/wine/dlls/gdi32/current/tests/pen.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -475,6 +475,8 @@
HBITMAP bmp;
HPEN pen;
LOGBRUSH lb;
+ INT iRet;
+ HGDIOBJ hRet;
lb.lbStyle = BS_SOLID;
lb.lbColor = RGB(0xff,0xff,0xff);
@@ -490,9 +492,12 @@
ok(hdc != NULL, "gle=%d\n", GetLastError());
bmp = CreateBitmap(8, 1, 1, 1, NULL);
ok(bmp != NULL, "gle=%d\n", GetLastError());
- ok(SelectObject(hdc, bmp) != NULL, "gle=%d\n", GetLastError());
- ok(SelectObject(hdc, pen) != NULL, "gle=%d\n", GetLastError());
- ok(SetBkMode(hdc, TRANSPARENT), "gle=%d\n", GetLastError());
+ hRet = SelectObject(hdc, bmp);
+ ok(hRet != NULL, "gle=%d\n", GetLastError());
+ hRet = SelectObject(hdc, pen);
+ ok(hRet != NULL, "gle=%d\n", GetLastError());
+ iRet = SetBkMode(hdc, TRANSPARENT);
+ ok(iRet, "gle=%d\n", GetLastError());
TEST_LINE(0, 1, "10000000")
TEST_LINE(0, 2, "10000000")
Modified: vendor/wine/dlls/user32/current/Makefile.in
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/Makefile…
==============================================================================
--- vendor/wine/dlls/user32/current/Makefile.in [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/Makefile.in [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -81,8 +81,9 @@
resources/user32_Uk.rc \
resources/user32_Wa.rc \
resources/user32_Zh.rc \
- resources/user32_bin.rc \
- resources/version.rc
+ user32.rc
+
+PO_SRCS = user32.rc
SVG_SRCS = \
resources/oic_bang.svg \
Modified: vendor/wine/dlls/user32/current/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/cursoric…
==============================================================================
--- vendor/wine/dlls/user32/current/cursoricon.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/cursoricon.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -404,7 +404,7 @@
* The following macro functions account for the irregularities of
* accessing cursor and icon resources in files and resource entries.
*/
-typedef BOOL (*fnGetCIEntry)( LPVOID dir, int n,
+typedef BOOL (*fnGetCIEntry)( LPCVOID dir, int n,
int *width, int *height, int *bits );
/**********************************************************************
@@ -412,7 +412,7 @@
*
* Find the icon closest to the requested size and bit depth.
*/
-static int CURSORICON_FindBestIcon( LPVOID dir, fnGetCIEntry get_entry,
+static int CURSORICON_FindBestIcon( LPCVOID dir, fnGetCIEntry get_entry,
int width, int height, int depth )
{
int i, cx, cy, bits, bestEntry = -1;
@@ -452,11 +452,11 @@
return bestEntry;
}
-static BOOL CURSORICON_GetResIconEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetResIconEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONDIR *resdir = dir;
- ICONRESDIR *icon;
+ const CURSORICONDIR *resdir = dir;
+ const ICONRESDIR *icon;
if ( resdir->idCount <= n )
return FALSE;
@@ -474,7 +474,7 @@
*
* FIXME: parameter 'color' ignored.
*/
-static int CURSORICON_FindBestCursor( LPVOID dir, fnGetCIEntry get_entry,
+static int CURSORICON_FindBestCursor( LPCVOID dir, fnGetCIEntry get_entry,
int width, int height, int depth )
{
int i, maxwidth, maxheight, cx, cy, bits, bestEntry = -1;
@@ -514,11 +514,11 @@
return bestEntry;
}
-static BOOL CURSORICON_GetResCursorEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetResCursorEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONDIR *resdir = dir;
- CURSORDIR *cursor;
+ const CURSORICONDIR *resdir = dir;
+ const CURSORDIR *cursor;
if ( resdir->idCount <= n )
return FALSE;
@@ -529,7 +529,7 @@
return TRUE;
}
-static CURSORICONDIRENTRY *CURSORICON_FindBestIconRes( CURSORICONDIR * dir,
+static const CURSORICONDIRENTRY *CURSORICON_FindBestIconRes( const CURSORICONDIR * dir,
int width, int height, int depth )
{
int n;
@@ -541,7 +541,7 @@
return &dir->idEntries[n];
}
-static CURSORICONDIRENTRY *CURSORICON_FindBestCursorRes( CURSORICONDIR *dir,
+static const CURSORICONDIRENTRY *CURSORICON_FindBestCursorRes( const CURSORICONDIR *dir,
int width, int height, int depth )
{
int n = CURSORICON_FindBestCursor( dir, CURSORICON_GetResCursorEntry,
@@ -551,38 +551,38 @@
return &dir->idEntries[n];
}
-static BOOL CURSORICON_GetFileEntry( LPVOID dir, int n,
+static BOOL CURSORICON_GetFileEntry( LPCVOID dir, int n,
int *width, int *height, int *bits )
{
- CURSORICONFILEDIR *filedir = dir;
- CURSORICONFILEDIRENTRY *entry;
- BITMAPINFOHEADER *info;
+ const CURSORICONFILEDIR *filedir = dir;
+ const CURSORICONFILEDIRENTRY *entry;
+ const BITMAPINFOHEADER *info;
if ( filedir->idCount <= n )
return FALSE;
entry = &filedir->idEntries[n];
/* FIXME: check against file size */
- info = (BITMAPINFOHEADER *)((char *)dir + entry->dwDIBOffset);
+ info = (const BITMAPINFOHEADER *)((const char *)dir + entry->dwDIBOffset);
*width = entry->bWidth;
*height = entry->bHeight;
*bits = info->biBitCount;
return TRUE;
}
-static CURSORICONFILEDIRENTRY *CURSORICON_FindBestCursorFile( CURSORICONFILEDIR *dir,
+static const CURSORICONFILEDIRENTRY *CURSORICON_FindBestCursorFile( const
CURSORICONFILEDIR *dir,
int width, int height, int depth )
{
- int n = CURSORICON_FindBestCursor( dir, CURSORICON_GetFileEntry,
+ int n = CURSORICON_FindBestCursor( (LPCVOID) dir, CURSORICON_GetFileEntry,
width, height, depth );
if ( n < 0 )
return NULL;
return &dir->idEntries[n];
}
-static CURSORICONFILEDIRENTRY *CURSORICON_FindBestIconFile( CURSORICONFILEDIR *dir,
+static const CURSORICONFILEDIRENTRY *CURSORICON_FindBestIconFile( const CURSORICONFILEDIR
*dir,
int width, int height, int depth )
{
- int n = CURSORICON_FindBestIcon( dir, CURSORICON_GetFileEntry,
+ int n = CURSORICON_FindBestIcon((LPCVOID) dir, CURSORICON_GetFileEntry,
width, height, depth );
if ( n < 0 )
return NULL;
@@ -684,7 +684,7 @@
BOOL monochrome = is_dib_monochrome( bmi );
unsigned int size = bitmap_info_size( bmi, DIB_RGB_COLORS );
BITMAPINFO *info;
- void *color_bits, *mask_bits;
+ const void *color_bits, *mask_bits;
BOOL ret = FALSE;
HDC hdc = 0;
@@ -695,8 +695,8 @@
memcpy( info, bmi, size );
info->bmiHeader.biHeight /= 2;
- color_bits = (char *)bmi + size;
- mask_bits = (char *)color_bits +
+ color_bits = (const char*)bmi + size;
+ mask_bits = (const char*)color_bits +
get_dib_width_bytes( bmi->bmiHeader.biWidth,
bmi->bmiHeader.biBitCount ) *
abs(info->bmiHeader.biHeight);
@@ -997,15 +997,15 @@
icon_data = fram_chunk.data + (2 * sizeof(DWORD));
for (i=0; i<header.num_frames; i++)
{
- DWORD chunk_size = *(DWORD *)(icon_chunk + sizeof(DWORD));
+ const DWORD chunk_size = *(const DWORD *)(icon_chunk + sizeof(DWORD));
struct cursoricon_frame *frame = &info->frames[i];
- CURSORICONFILEDIRENTRY *entry;
- BITMAPINFO *bmi;
-
- entry = CURSORICON_FindBestIconFile( (CURSORICONFILEDIR *) icon_data,
+ const CURSORICONFILEDIRENTRY *entry;
+ const BITMAPINFO *bmi;
+
+ entry = CURSORICON_FindBestIconFile((const CURSORICONFILEDIR *) icon_data,
width, height, depth );
- bmi = (BITMAPINFO *) (icon_data + entry->dwDIBOffset);
+ bmi = (const BITMAPINFO *) (icon_data + entry->dwDIBOffset);
info->hotspot.x = entry->xHotspot;
info->hotspot.y = entry->yHotspot;
if (!header.width || !header.height)
@@ -1115,8 +1115,8 @@
INT width, INT height, INT depth,
BOOL fCursor, UINT loadflags)
{
- CURSORICONFILEDIRENTRY *entry;
- CURSORICONFILEDIR *dir;
+ const CURSORICONFILEDIRENTRY *entry;
+ const CURSORICONFILEDIR *dir;
DWORD filesize = 0;
HICON hIcon = 0;
LPBYTE bits;
@@ -1136,7 +1136,7 @@
goto end;
}
- dir = (CURSORICONFILEDIR*) bits;
+ dir = (const CURSORICONFILEDIR*) bits;
if ( filesize < sizeof(*dir) )
goto end;
@@ -1179,8 +1179,8 @@
HANDLE handle = 0;
HICON hIcon = 0;
HRSRC hRsrc;
- CURSORICONDIR *dir;
- CURSORICONDIRENTRY *dirEntry;
+ const CURSORICONDIR *dir;
+ const CURSORICONDIRENTRY *dirEntry;
LPBYTE bits;
WORD wResId;
POINT hotspot;
@@ -1536,11 +1536,11 @@
INT WINAPI LookupIconIdFromDirectoryEx( LPBYTE xdir, BOOL bIcon,
INT width, INT height, UINT cFlag )
{
- CURSORICONDIR *dir = (CURSORICONDIR*)xdir;
+ const CURSORICONDIR *dir = (const CURSORICONDIR*)xdir;
UINT retVal = 0;
if( dir && !dir->idReserved && (dir->idType & 3) )
{
- CURSORICONDIRENTRY* entry;
+ const CURSORICONDIRENTRY* entry;
const HDC hdc = GetDC(0);
const int depth = (cFlag & LR_MONOCHROME) ?
Modified: vendor/wine/dlls/user32/current/tests/class.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/cl…
==============================================================================
--- vendor/wine/dlls/user32/current/tests/class.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/class.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -617,6 +617,7 @@
static const WCHAR classW[] =
{'d','e','f','t','e','s','t',0};
WCHAR unistring[] = {0x142, 0x40e, 0x3b4, 0}; /* a string that would be destroyed by
a W->A->W conversion */
WNDPROC pDefWindowProcA, pDefWindowProcW;
+ WNDPROC pNtdllDefWindowProcA, pNtdllDefWindowProcW;
WNDPROC oldproc;
WNDCLASSEXA cls; /* the memory layout of WNDCLASSEXA and WNDCLASSEXW is the same */
WCHAR buf[128];
@@ -626,45 +627,56 @@
pDefWindowProcA = (void *)GetProcAddress(GetModuleHandle("user32.dll"),
"DefWindowProcA");
pDefWindowProcW = (void *)GetProcAddress(GetModuleHandle("user32.dll"),
"DefWindowProcW");
-
- for (i = 0; i < 4; i++)
- {
- ZeroMemory(&cls, sizeof(cls));
- cls.cbSize = sizeof(cls);
- cls.hInstance = GetModuleHandle(NULL);
- cls.hbrBackground = GetStockObject (WHITE_BRUSH);
- if (i & 1)
- cls.lpfnWndProc = pDefWindowProcA;
- else
- cls.lpfnWndProc = pDefWindowProcW;
-
- if (i & 2)
+ pNtdllDefWindowProcA = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"),
"NtdllDefWindowProc_A");
+ pNtdllDefWindowProcW = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"),
"NtdllDefWindowProc_W");
+
+ /* On Vista+, the user32.dll export DefWindowProcA/W is forwarded to */
+ /* ntdll.NtdllDefWindowProc_A/W. However, the wndproc returned by */
+ /* GetClassLong/GetWindowLong points to an unexported user32 function */
+ if (pDefWindowProcA == pNtdllDefWindowProcA &&
+ pDefWindowProcW == pNtdllDefWindowProcW)
+ skip("user32.DefWindowProcX forwarded to
ntdll.NtdllDefWindowProc_X\n");
+ else
+ {
+ for (i = 0; i < 4; i++)
{
- cls.lpszClassName = classA;
- atom = RegisterClassExA(&cls);
+ ZeroMemory(&cls, sizeof(cls));
+ cls.cbSize = sizeof(cls);
+ cls.hInstance = GetModuleHandle(NULL);
+ cls.hbrBackground = GetStockObject (WHITE_BRUSH);
+ if (i & 1)
+ cls.lpfnWndProc = pDefWindowProcA;
+ else
+ cls.lpfnWndProc = pDefWindowProcW;
+
+ if (i & 2)
+ {
+ cls.lpszClassName = classA;
+ atom = RegisterClassExA(&cls);
+ }
+ else
+ {
+ cls.lpszClassName = (LPCSTR)classW;
+ atom = RegisterClassExW((WNDCLASSEXW *)&cls);
+ }
+ ok(atom != 0, "Couldn't register class, i=%d, %d\n", i,
GetLastError());
+
+ hwnd = CreateWindowA(classA, NULL, 0, 0, 0, 100, 100, NULL, NULL,
GetModuleHandle(NULL), NULL);
+ ok(hwnd != NULL, "Couldn't create window i=%d\n", i);
+
+ ok(GetWindowLongPtrA(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA,
"Wrong ANSI wndproc: %p vs %p\n",
+ (void *)GetWindowLongPtrA(hwnd, GWLP_WNDPROC), pDefWindowProcA);
+ ok(GetClassLongPtrA(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcA,
"Wrong ANSI wndproc: %p vs %p\n",
+ (void *)GetClassLongPtrA(hwnd, GCLP_WNDPROC), pDefWindowProcA);
+
+ ok(GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcW,
"Wrong Unicode wndproc: %p vs %p\n",
+ (void *)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), pDefWindowProcW);
+ ok(GetClassLongPtrW(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcW,
"Wrong Unicode wndproc: %p vs %p\n",
+ (void *)GetClassLongPtrW(hwnd, GCLP_WNDPROC), pDefWindowProcW);
+
+ DestroyWindow(hwnd);
+ UnregisterClass((LPSTR)(DWORD_PTR)atom, GetModuleHandle(NULL));
}
- else
- {
- cls.lpszClassName = (LPCSTR)classW;
- atom = RegisterClassExW((WNDCLASSEXW *)&cls);
- }
- ok(atom != 0, "Couldn't register class, i=%d, %d\n", i,
GetLastError());
-
- hwnd = CreateWindowA(classA, NULL, 0, 0, 0, 100, 100, NULL, NULL,
GetModuleHandle(NULL), NULL);
- ok(hwnd != NULL, "Couldn't create window i=%d\n", i);
-
- ok(GetWindowLongPtrA(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA,
"Wrong ANSI wndproc: %p vs %p\n",
- (void *)GetWindowLongPtrA(hwnd, GWLP_WNDPROC), pDefWindowProcA);
- ok(GetClassLongPtrA(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcA,
"Wrong ANSI wndproc: %p vs %p\n",
- (void *)GetClassLongPtrA(hwnd, GCLP_WNDPROC), pDefWindowProcA);
-
- ok(GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcW,
"Wrong Unicode wndproc: %p vs %p\n",
- (void *)GetWindowLongPtrW(hwnd, GWLP_WNDPROC), pDefWindowProcW);
- ok(GetClassLongPtrW(hwnd, GCLP_WNDPROC) == (ULONG_PTR)pDefWindowProcW,
"Wrong Unicode wndproc: %p vs %p\n",
- (void *)GetClassLongPtrW(hwnd, GCLP_WNDPROC), pDefWindowProcW);
-
- DestroyWindow(hwnd);
- UnregisterClass((LPSTR)(DWORD_PTR)atom, GetModuleHandle(NULL));
}
/* built-in winproc - window A/W type automatically detected */
Modified: vendor/wine/dlls/user32/current/tests/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/cl…
==============================================================================
--- vendor/wine/dlls/user32/current/tests/clipboard.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/clipboard.c [iso-8859-1] Thu Jan 27 18:02:02
2011
@@ -68,8 +68,8 @@
ok(OpenClipboard(hWnd1), "OpenClipboard failed\n");
SetLastError(0xdeadbeef);
- ok(!OpenClipboard(hWnd2) &&
- (GetLastError() == 0xdeadbeef || GetLastError() == ERROR_ACCESS_DENIED),
+ ret = OpenClipboard(hWnd2);
+ ok(!ret && (GetLastError() == 0xdeadbeef || GetLastError() ==
ERROR_ACCESS_DENIED),
"OpenClipboard should fail without setting last error value, or with
ERROR_ACCESS_DENIED, got error %d\n", GetLastError());
SetLastError(0xdeadbeef);
@@ -79,8 +79,8 @@
ok(GetClipboardOwner() == hWnd1, "clipboard should be owned by %p, not by
%p\n", hWnd1, GetClipboardOwner());
SetLastError(0xdeadbeef);
- ok(!OpenClipboard(hWnd2) &&
- (GetLastError() == 0xdeadbeef || GetLastError() == ERROR_ACCESS_DENIED),
+ ret = OpenClipboard(hWnd2);
+ ok(!ret && (GetLastError() == 0xdeadbeef || GetLastError() ==
ERROR_ACCESS_DENIED),
"OpenClipboard should fail without setting last error valuei, or with
ERROR_ACCESS_DENIED, got error %d\n", GetLastError());
ret = CloseClipboard();
Modified: vendor/wine/dlls/user32/current/tests/dde.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/dd…
==============================================================================
--- vendor/wine/dlls/user32/current/tests/dde.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/dde.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -1295,7 +1295,7 @@
if (!conv_unicode)
ok( !lstrcmpA(cmd, exec_cmdA), "server A got wrong command
'%s'\n", cmd );
else /* we get garbage as the A command was mapped W->A */
- ok( cmd[0] == '?', "server A got wrong command
'%s'\n", cmd );
+ ok( cmd[0] != exec_cmdA[0], "server A got wrong command
'%s'\n", cmd );
break;
case 2: /* ANSI command in Unicode format */
@@ -1316,7 +1316,7 @@
if (!conv_unicode)
ok( !lstrcmpA(cmd, exec_cmdWA), "server A got wrong command
'%s'\n", cmd );
else /* we get garbage as the A command was mapped W->A */
- ok( cmd[0] == '?', "server A got wrong command
'%s'\n", cmd );
+ ok( cmd[0] != exec_cmdWA[0], "server A got wrong command
'%s'\n", cmd );
break;
}
GlobalUnlock((HGLOBAL)hi);
@@ -1430,7 +1430,7 @@
case 1: /* ANSI command */
if (conv_unicode && !client_unicode) /* W->A mapping ->
garbage */
- ok( cmd[0] == '?', "server W got wrong command
'%s'\n", cmd );
+ ok( cmd[0] != exec_cmdA[0], "server W got wrong command
'%s'\n", cmd );
else if (!conv_unicode && client_unicode) /* A->W mapping */
ok( !lstrcmpW((LPCWSTR)cmd, exec_cmdAW), "server W got wrong
command '%s'\n", cmd );
else
@@ -1457,7 +1457,7 @@
case 4: /* Unicode command in ANSI format */
if (conv_unicode && !client_unicode) /* W->A mapping ->
garbage */
- ok( cmd[0] == '?', "server W got wrong command
'%s'\n", cmd );
+ ok( cmd[0] != exec_cmdWA[0], "server W got wrong command
'%s'\n", cmd );
else if (!conv_unicode && client_unicode) /* A->W mapping */
ok( !lstrcmpW((LPCWSTR)cmd, exec_cmdW), "server W got wrong
command '%s'\n", cmd );
else
@@ -2487,8 +2487,6 @@
else if (unicode_client)
{
/* ASCII string mapped W->A -> garbage */
- ok(size == size_a / sizeof(WCHAR) || size == size_a / sizeof(WCHAR) + 1,
- "Wrong size %d, msg_index=%d\n", size, msg_index);
}
else
{
@@ -2530,7 +2528,8 @@
DWORD nt_size = MultiByteToWideChar( CP_ACP, 0, (char *)cmd_w, size_w,
test_cmd_a_to_w,
sizeof(test_cmd_a_to_w)/sizeof(WCHAR) ) * sizeof(WCHAR);
DWORD xp_size = MultiByteToWideChar( CP_ACP, 0, (char *)cmd_w, -1, NULL,
0 ) * sizeof(WCHAR);
- ok(size == xp_size || broken(size == nt_size),
+ ok(size == xp_size || broken(size == nt_size) ||
+ broken(str_index == 4 && IsDBCSLeadByte(cmd_w[0])) /* East
Asian */,
"Wrong size %d/%d, msg_index=%d\n", size, size_a_to_w,
msg_index);
ok(!lstrcmpW((WCHAR*)buffer, test_cmd_a_to_w),
"Expected %s, msg_index=%d\n",
wine_dbgstr_w(test_cmd_a_to_w), msg_index);
Modified: vendor/wine/dlls/user32/current/tests/menu.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/me…
==============================================================================
--- vendor/wine/dlls/user32/current/tests/menu.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/menu.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -954,7 +954,9 @@
"wrong bmpitem %p/%p\n", info.hbmpItem, item );
ok_(__FILE__, line)( info.dwTypeData == type_data || (ULONG_PTR)info.dwTypeData ==
LOWORD(type_data),
"wrong type data %p/%p\n", info.dwTypeData, type_data
);
- ok_(__FILE__, line)( info.cch == out_len, "wrong len %x/%x\n", info.cch,
out_len );
+ ok_(__FILE__, line)( info.cch == out_len ||
+ broken(! ansi && info.cch == 2 * out_len) /* East-Asian
*/,
+ "wrong len %x/%x\n", info.cch, out_len );
if (expname)
{
if(ansi)
Modified: vendor/wine/dlls/user32/current/tests/win.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/user32/current/tests/wi…
==============================================================================
--- vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] (original)
+++ vendor/wine/dlls/user32/current/tests/win.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -2586,7 +2586,8 @@
hwnd2 = GetForegroundWindow();
ok(hwnd2 == hwnd, "Wrong foreground window %p\n", hwnd2);
- ok(SetForegroundWindow( GetDesktopWindow() ), "SetForegroundWindow(desktop)
error: %d\n", GetLastError());
+ ret = SetForegroundWindow( GetDesktopWindow() );
+ ok(ret, "SetForegroundWindow(desktop) error: %d\n", GetLastError());
hwnd2 = GetForegroundWindow();
ok(hwnd2 != hwnd, "Wrong foreground window %p\n", hwnd2);
@@ -4529,10 +4530,12 @@
HMENU hmenu;
RECT rc, rc_minmax;
MINMAXINFO minmax;
+ BOOL res;
#define expect_menu(window, menu) \
SetLastError(0xdeadbeef); \
- ok(GetMenu(window) == (HMENU)menu, "GetMenu error %d\n", GetLastError())
+ res = (GetMenu(window) == (HMENU)menu); \
+ ok(res, "GetMenu error %d\n", GetLastError())
#define expect_style(window, style)\
ok((ULONG)GetWindowLong(window, GWL_STYLE) == (style), "expected style %x !=
%x\n", (LONG)(style), GetWindowLong(window, GWL_STYLE))
@@ -4551,7 +4554,8 @@
assert(parent != 0);
SetLastError(0xdeadbeef);
- ok(IsMenu(hmenu), "IsMenu error %d\n", GetLastError());
+ res = IsMenu(hmenu);
+ ok(res, "IsMenu error %d\n", GetLastError());
/* WS_CHILD */
SetLastError(0xdeadbeef);
@@ -6051,7 +6055,8 @@
cls.lpszMenuName = NULL;
cls.lpszClassName = className;
SetLastError(0xdeadbeef);
- ok(RegisterClassA(&cls),"RegisterClassA failed, error: %u\n",
GetLastError());
+ success = RegisterClassA(&cls);
+ ok(success,"RegisterClassA failed, error: %u\n", GetLastError());
for(i = 0; i < NUMBER_OF_THICK_CHILD_TESTS; i++)
{
Modified: vendor/wine/dlls/winex11.drv/current/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/key…
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/keyboard.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/keyboard.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -1297,7 +1297,7 @@
if (!state) flags |= KEYEVENTF_KEYUP;
- TRACE("Adjusting state for vkey %#.2X. State before %#.2x\n",
+ TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n",
vkey, key_state_table[vkey & 0xff]);
/* Fake key being pressed inside wine */
Modified: vendor/wine/dlls/winex11.drv/current/opengl.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/ope…
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/opengl.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/opengl.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -505,9 +505,11 @@
/* It doesn't matter if these fail. They'll only be used if the driver reports
the associated extension is available (and if a driver reports the extension
is available but fails to provide the functions, it's quite broken) */
-#define LOAD_FUNCPTR(f) p##f = (void*)pglXGetProcAddressARB((const unsigned char*)#f)
+#define LOAD_FUNCPTR(f) p##f = pglXGetProcAddressARB((const GLubyte *)#f)
/* ARB GLX Extension */
LOAD_FUNCPTR(glXCreateContextAttribsARB);
+ /* SGI GLX Extension */
+ LOAD_FUNCPTR(glXSwapIntervalSGI);
/* NV GLX Extension */
LOAD_FUNCPTR(glXAllocateMemoryNV);
LOAD_FUNCPTR(glXFreeMemoryNV);
@@ -3400,7 +3402,9 @@
* WGL_EXT_swap_control: wglGetSwapIntervalEXT
*/
static int WINAPI X11DRV_wglGetSwapIntervalEXT(VOID) {
- FIXME("(),stub!\n");
+ /* GLX_SGI_swap_control doesn't have any provisions for getting the swap
+ * interval, so the swap interval has to be tracked. */
+ TRACE("()\n");
return swap_interval;
}
@@ -3413,13 +3417,37 @@
BOOL ret = TRUE;
TRACE("(%d)\n", interval);
- swap_interval = interval;
- if (NULL != pglXSwapIntervalSGI) {
- wine_tsx11_lock();
- ret = !pglXSwapIntervalSGI(interval);
- wine_tsx11_unlock();
- }
- else WARN("(): GLX_SGI_swap_control extension seems not supported\n");
+
+ if (interval < 0)
+ {
+ SetLastError(ERROR_INVALID_DATA);
+ return FALSE;
+ }
+ else if (interval == 0)
+ {
+ /* wglSwapIntervalEXT considers an interval value of zero to mean that
+ * vsync should be disabled, but glXSwapIntervalSGI considers such a
+ * value to be an error. Just silently ignore the request for now. */
+ WARN("Request to disable vertical sync is not handled\n");
+ swap_interval = 0;
+ }
+ else
+ {
+ if (pglXSwapIntervalSGI)
+ {
+ wine_tsx11_lock();
+ ret = !pglXSwapIntervalSGI(interval);
+ wine_tsx11_unlock();
+ }
+ else
+ WARN("GLX_SGI_swap_control extension is not available\n");
+
+ if (ret)
+ swap_interval = interval;
+ else
+ SetLastError(ERROR_DC_NOT_FOUND);
+ }
+
return ret;
}
Modified: vendor/wine/dlls/winex11.drv/current/window.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/dlls/winex11.drv/current/win…
==============================================================================
--- vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] (original)
+++ vendor/wine/dlls/winex11.drv/current/window.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -1198,10 +1198,9 @@
else if (style & WS_MINIMIZEBOX) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
else if (style & WS_DLGFRAME) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
else if (ex_style & WS_EX_DLGMODALFRAME) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
+ /* many window managers don't handle utility windows very well, so we don't
use TYPE_UTILITY here */
+ else if (ex_style & WS_EX_TOOLWINDOW) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
else if ((style & WS_POPUP) && owner) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
-#if 0 /* many window managers don't handle utility windows very well */
- else if (ex_style & WS_EX_TOOLWINDOW) window_type =
x11drv_atom(_NET_WM_WINDOW_TYPE_UTILITY);
-#endif
else window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_WINDOW_TYPE),
Modified: vendor/wine/server/current/change.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/change.c?rev=…
==============================================================================
--- vendor/wine/server/current/change.c [iso-8859-1] (original)
+++ vendor/wine/server/current/change.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -123,9 +123,8 @@
struct change_record {
struct list entry;
- int action;
- int len;
- char name[1];
+ unsigned int cookie;
+ struct filesystem_event event;
};
struct dir
@@ -607,7 +606,7 @@
}
static void inotify_do_change_notify( struct dir *dir, unsigned int action,
- const char *relpath )
+ unsigned int cookie, const char *relpath )
{
struct change_record *record;
@@ -616,13 +615,14 @@
if (dir->want_data)
{
size_t len = strlen(relpath);
- record = malloc( offsetof(struct change_record, name[len]) );
+ record = malloc( offsetof(struct change_record, event.name[len]) );
if (!record)
return;
- record->action = action;
- memcpy( record->name, relpath, len );
- record->len = len;
+ record->cookie = cookie;
+ record->event.action = action;
+ memcpy( record->event.name, relpath, len );
+ record->event.len = len;
list_add_tail( &dir->change_records, &record->entry );
}
@@ -811,7 +811,7 @@
{
LIST_FOR_EACH_ENTRY( dir, &i->dirs, struct dir, in_entry )
if ((filter & dir->filter) && (i==inode || dir->subtree))
- inotify_do_change_notify( dir, action, path );
+ inotify_do_change_notify( dir, action, ie->cookie, path );
if (!i->name || !prepend( &path, i->name ))
break;
@@ -1145,21 +1145,70 @@
DECL_HANDLER(read_change)
{
- struct change_record *record;
+ struct change_record *record, *next;
struct dir *dir;
+ struct list events;
+ char *data, *event;
+ int size = 0;
dir = get_dir_obj( current->process, req->handle, 0 );
if (!dir)
return;
- if ((record = get_first_change_record( dir )) != NULL)
- {
- reply->action = record->action;
- set_reply_data( record->name, record->len );
+ list_init( &events );
+ list_move_tail( &events, &dir->change_records );
+ release_object( dir );
+
+ if (list_empty( &events ))
+ {
+ set_error( STATUS_NO_DATA_DETECTED );
+ return;
+ }
+
+ LIST_FOR_EACH_ENTRY( record, &events, struct change_record, entry )
+ {
+ size += (offsetof(struct filesystem_event, name[record->event.len])
+ + sizeof(int)-1) / sizeof(int) * sizeof(int);
+ }
+
+ if (size > get_reply_max_size())
+ set_error( STATUS_BUFFER_TOO_SMALL );
+ else if ((data = mem_alloc( size )) != NULL)
+ {
+ event = data;
+ LIST_FOR_EACH_ENTRY( record, &events, struct change_record, entry )
+ {
+ data_size_t len = offsetof( struct filesystem_event,
name[record->event.len] );
+
+ /* FIXME: rename events are sometimes reported as delete/create */
+ if (record->event.action == FILE_ACTION_RENAMED_OLD_NAME)
+ {
+ struct list *elem = list_next( &events, &record->entry );
+ if (elem)
+ next = LIST_ENTRY(elem, struct change_record, entry);
+
+ if (elem && next->cookie == record->cookie)
+ next->cookie = 0;
+ else
+ record->event.action = FILE_ACTION_REMOVED;
+ }
+ else if (record->event.action == FILE_ACTION_RENAMED_NEW_NAME &&
record->cookie)
+ record->event.action = FILE_ACTION_ADDED;
+
+ memcpy( event, &record->event, len );
+ event += len;
+ if (len % sizeof(int))
+ {
+ memset( event, 0, sizeof(int) - len % sizeof(int) );
+ event += sizeof(int) - len % sizeof(int);
+ }
+ }
+ set_reply_data_ptr( data, size );
+ }
+
+ LIST_FOR_EACH_ENTRY_SAFE( record, next, &events, struct change_record, entry )
+ {
+ list_remove( &record->entry );
free( record );
}
- else
- set_error( STATUS_NO_DATA_DETECTED );
-
- release_object( dir );
-}
+}
Modified: vendor/wine/server/current/console.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/console.c?rev…
==============================================================================
--- vendor/wine/server/current/console.c [iso-8859-1] (original)
+++ vendor/wine/server/current/console.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -302,7 +302,8 @@
if (!(console_input = alloc_object( &console_input_ops ))) return NULL;
console_input->renderer = renderer;
console_input->mode = ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
- ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT;
+ ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT |
ENABLE_INSERT_MODE |
+ ENABLE_EXTENDED_FLAGS;
console_input->num_proc = 0;
console_input->active = NULL;
console_input->recnum = 0;
Modified: vendor/wine/server/current/protocol.def
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/protocol.def?…
==============================================================================
--- vendor/wine/server/current/protocol.def [iso-8859-1] (original)
+++ vendor/wine/server/current/protocol.def [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -332,6 +332,14 @@
unsigned short attr;
} char_info_t;
+/* structure returned in filesystem events */
+struct filesystem_event
+{
+ int action;
+ data_size_t len;
+ char name[1];
+};
+
typedef struct
{
unsigned int low_part;
@@ -1448,8 +1456,7 @@
@REQ(read_change)
obj_handle_t handle;
@REPLY
- int action; /* type of change */
- VARARG(name,string); /* name of directory entry that changed */
+ VARARG(events,filesystem_event); /* collected filesystem events */
@END
Modified: vendor/wine/server/current/ptrace.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/ptrace.c?rev=…
==============================================================================
--- vendor/wine/server/current/ptrace.c [iso-8859-1] (original)
+++ vendor/wine/server/current/ptrace.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -37,6 +37,9 @@
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
+#ifdef HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+#endif
#ifdef HAVE_SYS_THR_H
# include <sys/ucontext.h>
# include <sys/thr.h>
@@ -213,18 +216,10 @@
static inline int tkill( int tgid, int pid, int sig )
{
#ifdef __linux__
-# ifdef __i386__
- int ret = syscall(270 /*SYS_tgkill*/, tgid, pid, sig);
- if (ret < 0 && errno == -ENOSYS)
- ret = syscall(238 /*SYS_tkill*/, pid, sig);
+ int ret = syscall( SYS_tgkill, tgid, pid, sig );
+ if (ret < 0 && errno == ENOSYS) ret = syscall( SYS_tkill, pid, sig );
return ret;
-# elif defined(__x86_64__)
- return syscall(234 /*SYS_tgkill*/, tgid, pid, sig);
-# else
- errno = ENOSYS;
- return -1;
-# endif
-#elif defined(__FreeBSD__) && defined(HAVE_THR_KILL2)
+#elif (defined(__FreeBSD__) || defined (__FreeBSD_kernel__)) &&
defined(HAVE_THR_KILL2)
return thr_kill2( tgid, pid, sig );
#else
errno = ENOSYS;
Modified: vendor/wine/server/current/request.h
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/request.h?rev…
==============================================================================
--- vendor/wine/server/current/request.h [iso-8859-1] (original)
+++ vendor/wine/server/current/request.h [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -1103,8 +1103,7 @@
C_ASSERT( sizeof(struct read_directory_changes_request) == 64 );
C_ASSERT( FIELD_OFFSET(struct read_change_request, handle) == 12 );
C_ASSERT( sizeof(struct read_change_request) == 16 );
-C_ASSERT( FIELD_OFFSET(struct read_change_reply, action) == 8 );
-C_ASSERT( sizeof(struct read_change_reply) == 16 );
+C_ASSERT( sizeof(struct read_change_reply) == 8 );
C_ASSERT( FIELD_OFFSET(struct create_mapping_request, access) == 12 );
C_ASSERT( FIELD_OFFSET(struct create_mapping_request, attributes) == 16 );
C_ASSERT( FIELD_OFFSET(struct create_mapping_request, protect) == 20 );
Modified: vendor/wine/server/current/trace.c
URL:
http://svn.reactos.org/svn/reactos/vendor/wine/server/current/trace.c?rev=5…
==============================================================================
--- vendor/wine/server/current/trace.c [iso-8859-1] (original)
+++ vendor/wine/server/current/trace.c [iso-8859-1] Thu Jan 27 18:02:02 2011
@@ -991,6 +991,39 @@
fputc( '}', stderr );
}
+static void dump_varargs_filesystem_event( const char *prefix, data_size_t size )
+{
+ static const char * const actions[] = {
+ NULL,
+ "ADDED",
+ "REMOVED",
+ "MODIFIED",
+ "RENAMED_OLD_NAME",
+ "RENAMED_NEW_NAME",
+ "ADDED_STREAM",
+ "REMOVED_STREAM",
+ "MODIFIED_STREAM"
+ };
+
+ fprintf( stderr,"%s{", prefix );
+ while (size)
+ {
+ const struct filesystem_event *event = cur_data;
+ data_size_t len = (offsetof( struct filesystem_event, name[event->len] ) +
sizeof(int)-1)
+ / sizeof(int) * sizeof(int);
+ if (size < len) break;
+ if (event->action < sizeof(actions)/sizeof(actions[0]) &&
actions[event->action])
+ fprintf( stderr, "{action=%s", actions[event->action] );
+ else
+ fprintf( stderr, "{action=%u", event->action );
+ fprintf( stderr, ",name=\"%.*s\"}", event->len,
event->name );
+ size -= len;
+ remove_data( len );
+ if (size)fputc( ',', stderr );
+ }
+ fputc( '}', stderr );
+}
+
typedef void (*dump_func)( const void *req );
/* Everything below this line is generated automatically by tools/make_requests */
@@ -1865,8 +1898,7 @@
static void dump_read_change_reply( const struct read_change_reply *req )
{
- fprintf( stderr, " action=%d", req->action );
- dump_varargs_string( ", name=", cur_size );
+ dump_varargs_filesystem_event( " events=", cur_size );
}
static void dump_create_mapping_request( const struct create_mapping_request *req )