|
- Winelib
+ Winelib
|
Documentation on development with Winelib, our application porting tools.
From jnewman at winehq.org Thu Sep 6 11:01:30 2012
From: jnewman at winehq.org (Jeremy Newman)
Date: Thu, 06 Sep 2012 11:01:30 -0500
Subject: Kyle Auble : Move static Winelib pages to wiki
Message-ID:
Module: website
Branch: master
Commit: 667ac9f284d67484db438cd2ad1f2b9eb1b0f020
URL: http://source.winehq.org/git/website.git/?a=commit;h=667ac9f284d67484db438cd2ad1f2b9eb1b0f020
Author: Kyle Auble
Date: Wed Sep 5 17:36:21 2012 -0700
Move static Winelib pages to wiki
---
templates/en/winelib.template | 450 -----------------------------------------
templates/he/winelib.template | 437 ---------------------------------------
2 files changed, 0 insertions(+), 887 deletions(-)
Diff: http://source.winehq.org/git/website.git/?a=commitdiff;h=667ac9f284d67484db438cd2ad1f2b9eb1b0f020
From jnewman at winehq.org Thu Sep 6 11:01:30 2012
From: jnewman at winehq.org (Jeremy Newman)
Date: Thu, 06 Sep 2012 11:01:30 -0500
Subject: Kyle Auble : Fix links to wiki in various languages
Message-ID:
Module: website
Branch: master
Commit: 521e23737d003d206ca66867552269bdabc3471f
URL: http://source.winehq.org/git/website.git/?a=commit;h=521e23737d003d206ca66867552269bdabc3471f
Author: Kyle Auble
Date: Wed Sep 5 17:36:38 2012 -0700
Fix links to wiki in various languages
http://bugs.winehq.org/show_bug.cgi?id=31273
---
templates/es/about.template | 1 +
templates/he/about.template | 1 +
templates/pl/about.template | 2 +-
templates/pl/help.template | 4 ++--
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/templates/es/about.template b/templates/es/about.template
index 517c717..2d6799b 100644
--- a/templates/es/about.template
+++ b/templates/es/about.template
@@ -19,4 +19,5 @@
Mitos Comunes sobre Wine
Historia del Proyecto Wine
Organizaci?n y Liderazgo
+ Caracter?sticas de Wine
diff --git a/templates/he/about.template b/templates/he/about.template
index 2574ff8..5ce7df3 100644
--- a/templates/he/about.template
+++ b/templates/he/about.template
@@ -19,4 +19,5 @@
????? ?????? ?? Wine
????????? ???? Wine
????? ????????
+ ??????? ?? Wine
diff --git a/templates/pl/about.template b/templates/pl/about.template
index 7d67496..ebb7764 100644
--- a/templates/pl/about.template
+++ b/templates/pl/about.template
@@ -37,7 +37,7 @@ Julliard kieruje projektem Wine, i mo?na si? z nim skontaktowa? przez e-mail
Historia Wine
Dlaczego Wine jest tak wa?ny
Obalanie mit?w o Wine
- Mo?liwo?ci Wine
+ Mo?liwo?ci Wine
Dowody uznania
World Wine News
Wywiady
diff --git a/templates/pl/help.template b/templates/pl/help.template
index 1c3bac2..8b95def 100644
--- a/templates/pl/help.template
+++ b/templates/pl/help.template
@@ -23,11 +23,11 @@
-  FAQ
+  FAQ
|
Na wi?kszo?? Twoich pyta? ?atwo znajdziesz odpowied? przegl?daj?c nasze
- FAQ.
+ FAQ.
Je?eli jeste? w potrzebie zajrzyj tam w pierwszej kolejno?ci.
|
From julliard at winehq.org Thu Sep 6 13:37:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:21 -0500
Subject: Alexandre Julliard : gdi32: Add a graphics driver to render windows
contents through the DIB engine.
Message-ID:
Module: wine
Branch: master
Commit: 27b0b88a0b8f54dd8940841fc85df910417b8a43
URL: http://source.winehq.org/git/wine.git/?a=commit;h=27b0b88a0b8f54dd8940841fc85df910417b8a43
Author: Alexandre Julliard
Date: Thu Sep 6 12:23:10 2012 +0200
gdi32: Add a graphics driver to render windows contents through the DIB engine.
---
dlls/gdi32/clipping.c | 7 +-
dlls/gdi32/dibdrv/dc.c | 608 +++++++++++++++++++++++++++++++++++++++++++++
dlls/gdi32/gdi32.spec | 2 +-
dlls/gdi32/gdi_private.h | 1 +
dlls/user32/painting.c | 2 +-
include/wine/gdi_driver.h | 39 +++-
6 files changed, 654 insertions(+), 5 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=27b0b88a0b8f54dd8940841fc85df910417b8a43
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Alexandre Julliard : user32: Add support for managing a DIB surface
for a window.
Message-ID:
Module: wine
Branch: master
Commit: a5ef549c6e4266d9a7e129b42ff49b109c6cadb8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a5ef549c6e4266d9a7e129b42ff49b109c6cadb8
Author: Alexandre Julliard
Date: Thu Sep 6 12:32:52 2012 +0200
user32: Add support for managing a DIB surface for a window.
---
dlls/user32/driver.c | 14 +++++----
dlls/user32/painting.c | 58 +++++++++++++++++++++++++++++++++++-
dlls/user32/user_private.h | 10 +++++-
dlls/user32/win.c | 9 ++++++
dlls/user32/win.h | 2 +
dlls/user32/winpos.c | 38 ++++++++++++++++++++----
dlls/winex11.drv/window.c | 6 ++-
dlls/winex11.drv/winex11.drv.spec | 4 +-
8 files changed, 121 insertions(+), 20 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=a5ef549c6e4266d9a7e129b42ff49b109c6cadb8
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Alexandre Julliard : user32: Maintain a list of active window
surfaces and flush them periodically.
Message-ID:
Module: wine
Branch: master
Commit: 7304445a7efa9f30e4541b075a2022319f291e4e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7304445a7efa9f30e4541b075a2022319f291e4e
Author: Alexandre Julliard
Date: Thu Sep 6 12:38:13 2012 +0200
user32: Maintain a list of active window surfaces and flush them periodically.
---
dlls/user32/painting.c | 16 ++----------
dlls/user32/win.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++-
dlls/user32/win.h | 2 +
dlls/user32/winpos.c | 1 +
dlls/user32/winproc.c | 5 +++-
5 files changed, 70 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index 3869b48..4def070 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -801,23 +801,11 @@ void move_window_bits( HWND hwnd, struct window_surface *old_surface,
* update_now
*
* Implementation of RDW_UPDATENOW behavior.
- *
- * FIXME: Windows uses WM_SYNCPAINT to cut down the number of intertask
- * SendMessage() calls. This is a comment inside DefWindowProc() source
- * from 16-bit SDK:
- *
- * This message avoids lots of inter-app message traffic
- * by switching to the other task and continuing the
- * recursion there.
- *
- * wParam = flags
- * LOWORD(lParam) = hrgnClip
- * HIWORD(lParam) = hwndSkip (not used; always NULL)
- *
*/
static void update_now( HWND hwnd, UINT rdw_flags )
{
HWND child = 0;
+ int count = 0;
/* desktop window never gets WM_PAINT, only WM_ERASEBKGND */
if (hwnd == GetDesktopWindow()) erase_now( hwnd, rdw_flags | RDW_NOCHILDREN );
@@ -834,8 +822,10 @@ static void update_now( HWND hwnd, UINT rdw_flags )
if (!flags) break; /* nothing more to do */
SendMessageW( child, WM_PAINT, 0, 0 );
+ count++;
if (rdw_flags & RDW_NOCHILDREN) break;
}
+ if (count) flush_window_surfaces( FALSE );
}
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index c03ff42..2a0848e 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -44,6 +44,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
static DWORD process_layout = ~0u;
+static struct list window_surfaces = LIST_INIT( window_surfaces );
+
+static CRITICAL_SECTION surfaces_section;
+static CRITICAL_SECTION_DEBUG critsect_debug =
+{
+ 0, 0, &surfaces_section,
+ { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": surfaces_section") }
+};
+static CRITICAL_SECTION surfaces_section = { &critsect_debug, -1, 0, 0, 0, 0 };
+
/**********************************************************************/
/* helper for Get/SetWindowLong */
@@ -475,6 +486,45 @@ BOOL is_desktop_window( HWND hwnd )
}
+/*******************************************************************
+ * register_window_surface
+ *
+ * Register a window surface in the global list, possibly replacing another one.
+ */
+void register_window_surface( struct window_surface *old, struct window_surface *new )
+{
+ if (old == new) return;
+ EnterCriticalSection( &surfaces_section );
+ if (old) list_remove( &old->entry );
+ if (new) list_add_tail( &window_surfaces, &new->entry );
+ LeaveCriticalSection( &surfaces_section );
+}
+
+
+/*******************************************************************
+ * flush_window_surfaces
+ *
+ * Flush pending output from all window surfaces.
+ */
+void flush_window_surfaces( BOOL idle )
+{
+ static DWORD last_idle;
+ DWORD now;
+ struct window_surface *surface;
+
+ EnterCriticalSection( &surfaces_section );
+ now = GetTickCount();
+ if (idle) last_idle = now;
+ /* if not idle, we only flush if there's evidence that the app never goes idle */
+ else if ((int)(now - last_idle) < 1000) goto done;
+
+ LIST_FOR_EACH_ENTRY( surface, &window_surfaces, struct window_surface, entry )
+ surface->funcs->flush( surface );
+done:
+ LeaveCriticalSection( &surfaces_section );
+}
+
+
/***********************************************************************
* WIN_GetPtr
*
@@ -863,7 +913,11 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
if (icon_title) DestroyWindow( icon_title );
if (menu) DestroyMenu( menu );
if (sys_menu) DestroyMenu( sys_menu );
- if (surface) window_surface_release( surface );
+ if (surface)
+ {
+ register_window_surface( surface, NULL );
+ window_surface_release( surface );
+ }
USER_Driver->pDestroyWindow( hwnd );
@@ -917,7 +971,11 @@ static void destroy_thread_window( HWND hwnd )
HeapFree( GetProcessHeap(), 0, wndPtr );
if (menu) DestroyMenu( menu );
if (sys_menu) DestroyMenu( sys_menu );
- if (surface) window_surface_release( surface );
+ if (surface)
+ {
+ register_window_surface( surface, NULL );
+ window_surface_release( surface );
+ }
}
diff --git a/dlls/user32/win.h b/dlls/user32/win.h
index 81e81b2..4bbe7ae 100644
--- a/dlls/user32/win.h
+++ b/dlls/user32/win.h
@@ -80,6 +80,8 @@ typedef struct tagWND
/* Window functions */
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
+extern void register_window_surface( struct window_surface *old, struct window_surface *new ) DECLSPEC_HIDDEN;
+extern void flush_window_surfaces( BOOL idle ) DECLSPEC_HIDDEN;
extern WND *WIN_GetPtr( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND WIN_GetFullHandle( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND WIN_IsCurrentProcess( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 60a539b..fa74567 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -2020,6 +2020,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
if (ret)
{
TRACE( "win %p surface %p -> %p\n", hwnd, old_surface, new_surface );
+ register_window_surface( old_surface, new_surface );
if (old_surface)
{
if (!IsRectEmpty( valid_rects ))
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c
index b06e93d..de7de6f 100644
--- a/dlls/user32/winproc.c
+++ b/dlls/user32/winproc.c
@@ -1123,7 +1123,10 @@ static LRESULT WINAPI StaticWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM
static DWORD wait_message( DWORD count, CONST HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags )
{
- DWORD ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
+ DWORD ret;
+
+ flush_window_surfaces( TRUE );
+ ret = USER_Driver->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
if (ret == WAIT_TIMEOUT && !count && !timeout) NtYieldExecution();
return ret;
}
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Alexandre Julliard : winex11: Use window surfaces for rendering
top-level windows.
Message-ID:
Module: wine
Branch: master
Commit: 33ac850c80634c891b0c157bbffa612f70954a40
URL: http://source.winehq.org/git/wine.git/?a=commit;h=33ac850c80634c891b0c157bbffa612f70954a40
Author: Alexandre Julliard
Date: Thu Sep 6 12:39:34 2012 +0200
winex11: Use window surfaces for rendering top-level windows.
It can be disabled by setting "ClientSideGraphics"="n".
---
dlls/winex11.drv/bitblt.c | 192 ++++++++++++++++++++++++++++++++++++++++
dlls/winex11.drv/window.c | 49 ++++++++++
dlls/winex11.drv/x11drv.h | 3 +
dlls/winex11.drv/x11drv_main.c | 4 +
4 files changed, 248 insertions(+), 0 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=33ac850c80634c891b0c157bbffa612f70954a40
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Alexandre Julliard : winex11: Handle Expose events by refreshing from
the window surface.
Message-ID:
Module: wine
Branch: master
Commit: 2eebedf38e4d5fd49075f8f89e63f869ca85cceb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2eebedf38e4d5fd49075f8f89e63f869ca85cceb
Author: Alexandre Julliard
Date: Mon Apr 30 15:09:03 2012 +0200
winex11: Handle Expose events by refreshing from the window surface.
---
dlls/winex11.drv/event.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 7da0947..dc7d1e3 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -791,7 +791,7 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
XExposeEvent *event = &xev->xexpose;
RECT rect;
struct x11drv_win_data *data;
- int flags = RDW_INVALIDATE | RDW_ERASE;
+ int flags = RDW_INVALIDATE | RDW_ERASE | RDW_FRAME;
TRACE( "win %p (%lx) %d,%d %dx%d\n",
hwnd, event->window, event->x, event->y, event->width, event->height );
@@ -802,15 +802,19 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
rect.top = event->y;
rect.right = event->x + event->width;
rect.bottom = event->y + event->height;
- if (event->window == data->whole_window)
+
+ if (data->surface)
{
- OffsetRect( &rect, data->whole_rect.left - data->client_rect.left,
- data->whole_rect.top - data->client_rect.top );
- flags |= RDW_FRAME;
+ data->surface->funcs->lock( data->surface );
+ add_bounds_rect( data->surface->funcs->get_bounds( data->surface ), &rect );
+ data->surface->funcs->unlock( data->surface );
}
if (event->window != root_window)
{
+ OffsetRect( &rect, data->whole_rect.left - data->client_rect.left,
+ data->whole_rect.top - data->client_rect.top );
+
if (GetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL)
mirror_rect( &data->client_rect, &rect );
@@ -829,7 +833,7 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
}
else OffsetRect( &rect, virtual_screen_rect.left, virtual_screen_rect.top );
- RedrawWindow( hwnd, &rect, 0, flags );
+ if (!data->surface) RedrawWindow( hwnd, &rect, 0, flags );
}
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Alexandre Julliard : winex11: Check for changes in min/ maximize
state even when the window rectangle didn't change.
Message-ID:
Module: wine
Branch: master
Commit: 6f1d43b16ecd8018f61f8fc947e78b9f5255cd63
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6f1d43b16ecd8018f61f8fc947e78b9f5255cd63
Author: Alexandre Julliard
Date: Thu Sep 6 14:09:06 2012 +0200
winex11: Check for changes in min/maximize state even when the window rectangle didn't change.
---
dlls/winex11.drv/event.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index dc7d1e3..ba80439 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -1019,14 +1019,7 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
if ((data->window_rect.right - data->window_rect.left == cx &&
data->window_rect.bottom - data->window_rect.top == cy) ||
(IsRectEmpty( &data->window_rect ) && event->width == 1 && event->height == 1))
- {
- if (flags & SWP_NOMOVE) /* if nothing changed, don't do anything */
- {
- TRACE( "Nothing has changed, ignoring event\n" );
- return;
- }
flags |= SWP_NOSIZE;
- }
else
TRACE( "%p resizing from (%dx%d) to (%dx%d)\n",
hwnd, data->window_rect.right - data->window_rect.left,
@@ -1051,7 +1044,8 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev )
}
}
- SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
+ if ((flags & (SWP_NOSIZE | SWP_NOMOVE)) != (SWP_NOSIZE | SWP_NOMOVE))
+ SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
}
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Vincent Povirk : mscoree: Preserve %ecx when calling
ReallyFixupVTable.
Message-ID:
Module: wine
Branch: master
Commit: b5c663ee1e4fd092e51735de219007bdb47d46d1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b5c663ee1e4fd092e51735de219007bdb47d46d1
Author: Vincent Povirk
Date: Wed Sep 5 15:25:59 2012 -0500
mscoree: Preserve %ecx when calling ReallyFixupVTable.
---
dlls/mscoree/corruntimehost.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c
index ecefe75..da46d61 100644
--- a/dlls/mscoree/corruntimehost.c
+++ b/dlls/mscoree/corruntimehost.c
@@ -827,6 +827,8 @@ static void get_utf8_args(int *argc, char ***argv)
struct vtable_fixup_thunk
{
+ /* push %ecx */
+ BYTE i7;
/* sub $0x4,%esp */
BYTE i1[3];
/* mov fixup,(%esp) */
@@ -839,12 +841,15 @@ struct vtable_fixup_thunk
BYTE i4[2];
/* pop %eax */
BYTE i5;
+ /* pop %ecx */
+ BYTE i8;
/* jmp *vtable_entry */
BYTE i6[2];
void *vtable_entry;
};
static const struct vtable_fixup_thunk thunk_template = {
+ 0x51,
{0x83,0xec,0x04},
{0xc7,0x04,0x24},
NULL,
@@ -852,6 +857,7 @@ static const struct vtable_fixup_thunk thunk_template = {
NULL,
{0xff,0xd0},
0x58,
+ 0x59,
{0xff,0x25},
NULL
};
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: =?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Move D3DXPARAMETER_TYPE
conversion helpers to util.
Message-ID:
Module: wine
Branch: master
Commit: 65c651e37661f8498011f57b6b36ff9606610b34
URL: http://source.winehq.org/git/wine.git/?a=commit;h=65c651e37661f8498011f57b6b36ff9606610b34
Author: Rico Sch?ller
Date: Wed Sep 5 22:51:22 2012 +0200
d3dx9: Move D3DXPARAMETER_TYPE conversion helpers to util.
---
dlls/d3dx9_36/d3dx9_36_private.h | 6 +++
dlls/d3dx9_36/effect.c | 84 -------------------------------------
dlls/d3dx9_36/util.c | 85 ++++++++++++++++++++++++++++++++++++++
3 files changed, 91 insertions(+), 84 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h
index f6f797e..c4cc69c 100644
--- a/dlls/d3dx9_36/d3dx9_36_private.h
+++ b/dlls/d3dx9_36/d3dx9_36_private.h
@@ -93,4 +93,10 @@ const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN;
const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) DECLSPEC_HIDDEN;
const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN;
+/* parameter type conversion helpers */
+INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data) DECLSPEC_HIDDEN;
+FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data) DECLSPEC_HIDDEN;
+BOOL get_bool(LPCVOID data) DECLSPEC_HIDDEN;
+void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN;
+
#endif /* __WINE_D3DX9_36_PRIVATE_H */
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index 162cbf8..f3a5549 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -847,90 +847,6 @@ static void free_effect_compiler(struct ID3DXEffectCompilerImpl *compiler)
}
}
-static INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
-{
- INT i;
-
- switch (type)
- {
- case D3DXPT_FLOAT:
- i = *(FLOAT *)data;
- break;
-
- case D3DXPT_INT:
- i = *(INT *)data;
- break;
-
- case D3DXPT_BOOL:
- i = *(BOOL *)data;
- break;
-
- default:
- i = 0;
- FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(type));
- break;
- }
-
- return i;
-}
-
-inline static FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data)
-{
- FLOAT f;
-
- switch (type)
- {
- case D3DXPT_FLOAT:
- f = *(FLOAT *)data;
- break;
-
- case D3DXPT_INT:
- f = *(INT *)data;
- break;
-
- case D3DXPT_BOOL:
- f = *(BOOL *)data;
- break;
-
- default:
- f = 0.0f;
- FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(type));
- break;
- }
-
- return f;
-}
-
-static inline BOOL get_bool(LPCVOID data)
-{
- return (*(DWORD *)data) != 0;
-}
-
-static void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype)
-{
- TRACE("Changing from type %s to type %s\n", debug_d3dxparameter_type(intype), debug_d3dxparameter_type(outtype));
-
- switch (outtype)
- {
- case D3DXPT_FLOAT:
- *(FLOAT *)outdata = get_float(intype, indata);
- break;
-
- case D3DXPT_BOOL:
- *(BOOL *)outdata = get_bool(indata);
- break;
-
- case D3DXPT_INT:
- *(INT *)outdata = get_int(intype, indata);
- break;
-
- default:
- FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(outtype));
- *(INT *)outdata = 0;
- break;
- }
-}
-
static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector)
{
UINT i;
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index 7615846..6daddd7 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -269,3 +269,88 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r)
}
#undef WINE_D3DX_TO_STR
+
+/* parameter type conversion helpers */
+INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
+{
+ INT i;
+
+ switch (type)
+ {
+ case D3DXPT_FLOAT:
+ i = *(FLOAT *)data;
+ break;
+
+ case D3DXPT_INT:
+ i = *(INT *)data;
+ break;
+
+ case D3DXPT_BOOL:
+ i = *(BOOL *)data;
+ break;
+
+ default:
+ i = 0;
+ FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(type));
+ break;
+ }
+
+ return i;
+}
+
+FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data)
+{
+ FLOAT f;
+
+ switch (type)
+ {
+ case D3DXPT_FLOAT:
+ f = *(FLOAT *)data;
+ break;
+
+ case D3DXPT_INT:
+ f = *(INT *)data;
+ break;
+
+ case D3DXPT_BOOL:
+ f = *(BOOL *)data;
+ break;
+
+ default:
+ f = 0.0f;
+ FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(type));
+ break;
+ }
+
+ return f;
+}
+
+BOOL get_bool(LPCVOID data)
+{
+ return (*(DWORD *)data) != 0;
+}
+
+void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype)
+{
+ TRACE("Changing from type %s to type %s\n", debug_d3dxparameter_type(intype), debug_d3dxparameter_type(outtype));
+
+ switch (outtype)
+ {
+ case D3DXPT_FLOAT:
+ *(FLOAT *)outdata = get_float(intype, indata);
+ break;
+
+ case D3DXPT_BOOL:
+ *(BOOL *)outdata = get_bool(indata);
+ break;
+
+ case D3DXPT_INT:
+ *(INT *)outdata = get_int(intype, indata);
+ break;
+
+ default:
+ FIXME("Unhandled type %s. This should not happen!\n", debug_d3dxparameter_type(outtype));
+ *(INT *)outdata = 0;
+ break;
+ }
+}
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: =?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: d3dx9: Move bool cropping into
helper function.
Message-ID:
Module: wine
Branch: master
Commit: 823d1fbc3887ab4b52b88555a8ef954f617b6194
URL: http://source.winehq.org/git/wine.git/?a=commit;h=823d1fbc3887ab4b52b88555a8ef954f617b6194
Author: Rico Sch?ller
Date: Wed Sep 5 22:51:42 2012 +0200
d3dx9: Move bool cropping into helper function.
---
dlls/d3dx9_36/effect.c | 5 ++---
dlls/d3dx9_36/util.c | 20 +++++++++++++-------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index f3a5549..a6dcd98 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -1649,8 +1649,6 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetBool(ID3DXBaseEffect *iface, D3DXHA
if (param && !param->element_count && param->rows == 1 && param->columns == 1)
{
- /* crop input */
- b = b != 0;
set_number(param->data, param->type, &b, D3DXPT_BOOL);
return D3D_OK;
}
@@ -1699,7 +1697,8 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetBoolArray(ID3DXBaseEffect *iface, D
case D3DXPC_MATRIX_ROWS:
for (i = 0; i < size; ++i)
{
- set_number((DWORD *)param->data + i, param->type, &b[i], D3DXPT_BOOL);
+ /* don't crop the input, use D3DXPT_INT instead of D3DXPT_BOOL */
+ set_number((DWORD *)param->data + i, param->type, &b[i], D3DXPT_INT);
}
return D3D_OK;
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
index 6daddd7..c5160fa 100644
--- a/dlls/d3dx9_36/util.c
+++ b/dlls/d3dx9_36/util.c
@@ -271,6 +271,11 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r)
#undef WINE_D3DX_TO_STR
/* parameter type conversion helpers */
+BOOL get_bool(LPCVOID data)
+{
+ return (*(DWORD *)data) != 0;
+}
+
INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
{
INT i;
@@ -286,7 +291,7 @@ INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
break;
case D3DXPT_BOOL:
- i = *(BOOL *)data;
+ i = get_bool(data);
break;
default:
@@ -313,7 +318,7 @@ FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data)
break;
case D3DXPT_BOOL:
- f = *(BOOL *)data;
+ f = get_bool(data);
break;
default:
@@ -325,15 +330,16 @@ FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data)
return f;
}
-BOOL get_bool(LPCVOID data)
-{
- return (*(DWORD *)data) != 0;
-}
-
void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype)
{
TRACE("Changing from type %s to type %s\n", debug_d3dxparameter_type(intype), debug_d3dxparameter_type(outtype));
+ if (outtype == intype)
+ {
+ *(DWORD *)outdata = *(DWORD *)indata;
+ return;
+ }
+
switch (outtype)
{
case D3DXPT_FLOAT:
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Michael Stefaniuc : dsound: Inline some of the IDirectSound helpers.
Message-ID:
Module: wine
Branch: master
Commit: 1440b25267b97a8e774d294b4036aff3b4c94b0c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1440b25267b97a8e774d294b4036aff3b4c94b0c
Author: Michael Stefaniuc
Date: Wed Sep 5 23:19:12 2012 +0200
dsound: Inline some of the IDirectSound helpers.
---
dlls/dsound/dsound.c | 274 +++++++++++++++++-------------------------
dlls/dsound/dsound_private.h | 14 --
2 files changed, 113 insertions(+), 175 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=1440b25267b97a8e774d294b4036aff3b4c94b0c
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Henri Verbeet : d3d10core: Update the MipLevels field after texture
creation.
Message-ID:
Module: wine
Branch: master
Commit: 129ad9cbf56e6dfcbbb1b01d31cd6350999f3c26
URL: http://source.winehq.org/git/wine.git/?a=commit;h=129ad9cbf56e6dfcbbb1b01d31cd6350999f3c26
Author: Henri Verbeet
Date: Thu Sep 6 11:25:01 2012 +0200
d3d10core: Update the MipLevels field after texture creation.
---
dlls/d3d10core/tests/device.c | 24 ++++++++++++++++++++++++
dlls/d3d10core/texture.c | 2 ++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 57a61c4..e9ade68 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -127,6 +127,19 @@ static void test_create_texture2d(ID3D10Device *device)
hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture);
ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x\n", hr);
+ ID3D10Texture2D_GetDesc(texture, &desc);
+ ok(desc.Width == 512, "Got unexpected Width %u.\n", desc.Width);
+ ok(desc.Height == 512, "Got unexpected Height %u.\n", desc.Height);
+ ok(desc.MipLevels == 10, "Got unexpected MipLevels %u.\n", desc.MipLevels);
+ ok(desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", desc.ArraySize);
+ ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format);
+ ok(desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", desc.SampleDesc.Count);
+ ok(desc.SampleDesc.Quality == 0, "Got unexpected SampleDesc.Quality %u.\n", desc.SampleDesc.Quality);
+ ok(desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected MipLevels %u.\n", desc.Usage);
+ ok(desc.BindFlags == D3D10_BIND_RENDER_TARGET, "Got unexpected BindFlags %u.\n", desc.BindFlags);
+ ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %u.\n", desc.CPUAccessFlags);
+ ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %u.\n", desc.MiscFlags);
+
hr = ID3D10Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
ok(FAILED(hr), "Texture should not implement IDXGISurface\n");
if (SUCCEEDED(hr)) IDXGISurface_Release(surface);
@@ -172,6 +185,17 @@ static void test_create_texture3d(ID3D10Device *device)
hr = ID3D10Device_CreateTexture3D(device, &desc, NULL, &texture);
ok(SUCCEEDED(hr), "Failed to create a 3d texture, hr %#x.\n", hr);
+ ID3D10Texture3D_GetDesc(texture, &desc);
+ ok(desc.Width == 64, "Got unexpected Width %u.\n", desc.Width);
+ ok(desc.Height == 64, "Got unexpected Height %u.\n", desc.Height);
+ ok(desc.Depth == 64, "Got unexpected Depth %u.\n", desc.Depth);
+ ok(desc.MipLevels == 7, "Got unexpected MipLevels %u.\n", desc.MipLevels);
+ ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format);
+ ok(desc.Usage == D3D10_USAGE_DEFAULT, "Got unexpected MipLevels %u.\n", desc.Usage);
+ ok(desc.BindFlags == D3D10_BIND_RENDER_TARGET, "Got unexpected BindFlags %u.\n", desc.BindFlags);
+ ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %u.\n", desc.CPUAccessFlags);
+ ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %u.\n", desc.MiscFlags);
+
hr = ID3D10Texture3D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface);
ok(FAILED(hr), "Texture should not implement IDXGISurface.\n");
if (SUCCEEDED(hr)) IDXGISurface_Release(surface);
diff --git a/dlls/d3d10core/texture.c b/dlls/d3d10core/texture.c
index 41bd80f..a065991 100644
--- a/dlls/d3d10core/texture.c
+++ b/dlls/d3d10core/texture.c
@@ -273,6 +273,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
IUnknown_Release(texture->dxgi_surface);
return hr;
}
+ texture->desc.MipLevels = wined3d_texture_get_level_count(texture->wined3d_texture);
return S_OK;
}
@@ -480,6 +481,7 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
WARN("Failed to create wined3d texture, hr %#x.\n", hr);
return hr;
}
+ texture->desc.MipLevels = wined3d_texture_get_level_count(texture->wined3d_texture);
return S_OK;
}
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Henri Verbeet : wined3d: wined3d_device_set_index_buffer() never
fails.
Message-ID:
Module: wine
Branch: master
Commit: a3e28f6ce5ffaa6c7cbe4ba49a5a90274016f1e4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a3e28f6ce5ffaa6c7cbe4ba49a5a90274016f1e4
Author: Henri Verbeet
Date: Thu Sep 6 11:25:02 2012 +0200
wined3d: wined3d_device_set_index_buffer() never fails.
---
dlls/d3d8/device.c | 5 ++---
dlls/d3d9/device.c | 5 ++---
dlls/ddraw/device.c | 2 +-
dlls/wined3d/device.c | 6 ++----
include/wine/wined3d.h | 2 +-
5 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index d90161f..49436da 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2344,7 +2344,6 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
struct d3d8_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer8(buffer);
- HRESULT hr;
TRACE("iface %p, buffer %p, base_vertex_idx %u.\n", iface, buffer, base_vertex_idx);
@@ -2356,12 +2355,12 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
*/
wined3d_mutex_lock();
wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx);
- hr = wined3d_device_set_index_buffer(device->wined3d_device,
+ wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 8f8f177..523c9ac 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -2524,17 +2524,16 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
struct d3d9_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer9(buffer);
- HRESULT hr;
TRACE("iface %p, buffer %p.\n", iface, buffer);
wined3d_mutex_lock();
- hr = wined3d_device_set_index_buffer(device->wined3d_device,
+ wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index a0526d1..24bd993 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -4158,7 +4158,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
/* Set the index stream */
wined3d_device_set_base_vertex_index(This->wined3d_device, StartVertex);
- hr = wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
+ wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
/* Set the vertex stream source */
hr = wined3d_device_set_stream_source(This->wined3d_device, 0, vb->wineD3DVertexBuffer, 0, stride);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 386fd25..2d6563f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2215,7 +2215,7 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s
return WINED3D_OK;
}
-HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
+void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *buffer, enum wined3d_format_id format_id)
{
struct wined3d_buffer *prev_buffer;
@@ -2237,7 +2237,7 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_incref(buffer);
if (prev_buffer)
wined3d_buffer_decref(prev_buffer);
- return WINED3D_OK;
+ return;
}
if (prev_buffer != buffer)
@@ -2254,8 +2254,6 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_decref(prev_buffer);
}
}
-
- return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, struct wined3d_buffer **buffer)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 82a1c80..28a6719 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2204,7 +2204,7 @@ HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);
void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp);
-HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
+void __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id);
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
UINT light_idx, const struct wined3d_light *light);
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Henri Verbeet : wined3d: Just return the buffer from
wined3d_device_get_index_buffer().
Message-ID:
Module: wine
Branch: master
Commit: c8f4ca315e5514c71ae14eca06a2a674515a9248
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c8f4ca315e5514c71ae14eca06a2a674515a9248
Author: Henri Verbeet
Date: Thu Sep 6 11:25:03 2012 +0200
wined3d: Just return the buffer from wined3d_device_get_index_buffer().
---
dlls/d3d8/device.c | 11 +++--------
dlls/d3d9/device.c | 13 ++++---------
dlls/wined3d/device.c | 13 +++----------
dlls/wined3d/wined3d.spec | 2 +-
include/wine/wined3d.h | 3 +--
5 files changed, 12 insertions(+), 30 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 49436da..36b8a7e 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -2367,9 +2367,8 @@ static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
IDirect3DIndexBuffer8 **buffer, UINT *base_vertex_index)
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
- struct wined3d_buffer *wined3d_buffer = NULL;
+ struct wined3d_buffer *wined3d_buffer;
struct d3d8_indexbuffer *buffer_impl;
- HRESULT hr;
TRACE("iface %p, buffer %p, base_vertex_index %p.\n", iface, buffer, base_vertex_index);
@@ -2379,23 +2378,19 @@ static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
/* The case from UINT to INT is safe because d3d8 will never set negative values */
wined3d_mutex_lock();
*base_vertex_index = wined3d_device_get_base_vertex_index(device->wined3d_device);
- hr = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_buffer);
- if (SUCCEEDED(hr) && wined3d_buffer)
+ if ((wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device)))
{
buffer_impl = wined3d_buffer_get_parent(wined3d_buffer);
*buffer = &buffer_impl->IDirect3DIndexBuffer8_iface;
IDirect3DIndexBuffer8_AddRef(*buffer);
- wined3d_buffer_decref(wined3d_buffer);
}
else
{
- if (FAILED(hr))
- ERR("Failed to get wined3d index buffer, hr %#x.\n", hr);
*buffer = NULL;
}
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d8_device_CreatePixelShader(IDirect3DDevice8 *iface,
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 523c9ac..0399ba3 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -2539,9 +2539,8 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3
static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
- struct wined3d_buffer *retIndexData = NULL;
+ struct wined3d_buffer *wined3d_buffer;
struct d3d9_indexbuffer *buffer_impl;
- HRESULT hr;
TRACE("iface %p, buffer %p.\n", iface, buffer);
@@ -2549,23 +2548,19 @@ static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3
return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
- hr = wined3d_device_get_index_buffer(device->wined3d_device, &retIndexData);
- if (SUCCEEDED(hr) && retIndexData)
+ if ((wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device)))
{
- buffer_impl = wined3d_buffer_get_parent(retIndexData);
+ buffer_impl = wined3d_buffer_get_parent(wined3d_buffer);
*buffer = &buffer_impl->IDirect3DIndexBuffer9_iface;
IDirect3DIndexBuffer9_AddRef(*buffer);
- wined3d_buffer_decref(retIndexData);
}
else
{
- if (FAILED(hr))
- FIXME("Call to GetIndices failed\n");
*buffer = NULL;
}
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d9_device_CreatePixelShader(IDirect3DDevice9Ex *iface,
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2d6563f..7a57195 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2256,18 +2256,11 @@ void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
}
}
-HRESULT CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, struct wined3d_buffer **buffer)
+struct wined3d_buffer * CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device)
{
- TRACE("device %p, buffer %p.\n", device, buffer);
-
- *buffer = device->stateBlock->state.index_buffer;
-
- if (*buffer)
- wined3d_buffer_incref(*buffer);
-
- TRACE("Returning %p.\n", *buffer);
+ TRACE("device %p.\n", device);
- return WINED3D_OK;
+ return device->stateBlock->state.index_buffer;
}
/* Method to offer d3d9 a simple way to set the base vertex index without messing with the index buffer */
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index aa0c186..c211e4a 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -64,7 +64,7 @@
@ cdecl wined3d_device_get_display_mode(ptr long ptr ptr)
@ cdecl wined3d_device_get_front_buffer_data(ptr long ptr)
@ cdecl wined3d_device_get_gamma_ramp(ptr long ptr)
-@ cdecl wined3d_device_get_index_buffer(ptr ptr)
+@ cdecl wined3d_device_get_index_buffer(ptr)
@ cdecl wined3d_device_get_light(ptr long ptr)
@ cdecl wined3d_device_get_light_enable(ptr long ptr)
@ cdecl wined3d_device_get_material(ptr ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 28a6719..afb007c 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2125,8 +2125,7 @@ HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device
UINT swapchain_idx, struct wined3d_surface *dst_surface);
void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_gamma_ramp *ramp);
-HRESULT __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device,
- struct wined3d_buffer **index_buffer);
+struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device);
HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device,
UINT light_idx, struct wined3d_light *light);
HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable);
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Piotr Caban : msvcp90: Fixed basic_stringbuf_wchar_overflow
implementation.
Message-ID:
Module: wine
Branch: master
Commit: 0e6171f6d7b969a7a48bca7b02d88c3a56850cfb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0e6171f6d7b969a7a48bca7b02d88c3a56850cfb
Author: Piotr Caban
Date: Thu Sep 6 11:40:56 2012 +0200
msvcp90: Fixed basic_stringbuf_wchar_overflow implementation.
---
dlls/msvcp100/ios.c | 2 +-
dlls/msvcp90/ios.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c
index 3e3bad8..5889d57 100644
--- a/dlls/msvcp100/ios.c
+++ b/dlls/msvcp100/ios.c
@@ -4133,7 +4133,7 @@ unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *
this->state |= STRINGBUF_allocated;
}else {
ptr = basic_streambuf_wchar_eback(&this->base);
- memcpy(buf, ptr, oldsize);
+ memcpy(buf, ptr, oldsize*sizeof(wchar_t));
this->seekhigh = buf+(this->seekhigh-ptr);
basic_streambuf_wchar_setp_next(&this->base, buf,
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 88ed0e9..e5d7233 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -4123,7 +4123,7 @@ unsigned short __thiscall basic_stringbuf_wchar_overflow(basic_stringbuf_wchar *
this->state |= STRINGBUF_allocated;
}else {
ptr = basic_streambuf_wchar_eback(&this->base);
- memcpy(buf, ptr, oldsize);
+ memcpy(buf, ptr, oldsize*sizeof(wchar_t));
this->seekhigh = buf+(this->seekhigh-ptr);
basic_streambuf_wchar_setp_next(&this->base, buf,
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Piotr Caban : msvcp90: Fixed locale_ctor_cstr implementation.
Message-ID:
Module: wine
Branch: master
Commit: 225cab98425484e92146d7c05c91502e2ccc3cb3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=225cab98425484e92146d7c05c91502e2ccc3cb3
Author: Piotr Caban
Date: Thu Sep 6 11:41:31 2012 +0200
msvcp90: Fixed locale_ctor_cstr implementation.
---
dlls/msvcp100/locale.c | 4 +++-
dlls/msvcp90/locale.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c
index b217232..1bba834 100644
--- a/dlls/msvcp100/locale.c
+++ b/dlls/msvcp100/locale.c
@@ -8142,7 +8142,9 @@ locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category
ERR("Out of memory\n");
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
}
- this->ptr = locale__Init();
+ locale__Locimp_ctor(this->ptr);
+
+ locale__Init();
_Locinfo_ctor_cat_cstr(&locinfo, cat, locname);
if(!memcmp(MSVCP_basic_string_char_c_str(&locinfo.newlocname), "*", 2)) {
diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 7e6b10f..1d9eb33 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -8293,7 +8293,9 @@ locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category
ERR("Out of memory\n");
throw_exception(EXCEPTION_BAD_ALLOC, NULL);
}
- this->ptr = locale__Init();
+ locale__Locimp_ctor(this->ptr);
+
+ locale__Init();
_Locinfo_ctor_cat_cstr(&locinfo, cat, locname);
if(!memcmp(MSVCP_basic_string_char_c_str(&locinfo.newlocname), "*", 2)) {
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Piotr Caban : msvcp90: Added locale_ctor_locale_locale implementation.
Message-ID:
Module: wine
Branch: master
Commit: e9b51093deeca572e93906c45fc08f6fefefc728
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e9b51093deeca572e93906c45fc08f6fefefc728
Author: Piotr Caban
Date: Thu Sep 6 11:42:05 2012 +0200
msvcp90: Added locale_ctor_locale_locale implementation.
---
dlls/msvcp100/locale.c | 19 +++++++++++++++++--
dlls/msvcp90/locale.c | 19 +++++++++++++++++--
2 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c
index 1bba834..55b3134 100644
--- a/dlls/msvcp100/locale.c
+++ b/dlls/msvcp100/locale.c
@@ -8104,8 +8104,23 @@ locale__Locimp* __cdecl locale__Init(void)
DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16)
locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat)
{
- FIXME("(%p %p %p %d) stub\n", this, loc, other, cat);
- return NULL;
+ _Locinfo locinfo;
+
+ TRACE("(%p %p %p %d)\n", this, loc, other, cat);
+
+ this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
+ if(!this->ptr) {
+ ERR("Out of memory\n");
+ throw_exception(EXCEPTION_BAD_ALLOC, NULL);
+ }
+ locale__Locimp_copy_ctor(this->ptr, loc->ptr);
+
+ _Locinfo_ctor_cat_cstr(&locinfo, loc->ptr->catmask, MSVCP_basic_string_char_c_str(&loc->ptr->name));
+ _Locinfo__Addcats(&locinfo, cat & other->ptr->catmask, MSVCP_basic_string_char_c_str(&other->ptr->name));
+ locale__Locimp__Makeloc(&locinfo, cat, this->ptr, other);
+ _Locinfo_dtor(&locinfo);
+
+ return this;
}
/* ??0locale at std@@QAE at ABV01@@Z */
diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 1d9eb33..f5a4534 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -8255,8 +8255,23 @@ locale__Locimp* __cdecl locale__Init(void)
DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16)
locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat)
{
- FIXME("(%p %p %p %d) stub\n", this, loc, other, cat);
- return NULL;
+ _Locinfo locinfo;
+
+ TRACE("(%p %p %p %d)\n", this, loc, other, cat);
+
+ this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
+ if(!this->ptr) {
+ ERR("Out of memory\n");
+ throw_exception(EXCEPTION_BAD_ALLOC, NULL);
+ }
+ locale__Locimp_copy_ctor(this->ptr, loc->ptr);
+
+ _Locinfo_ctor_cat_cstr(&locinfo, loc->ptr->catmask, MSVCP_basic_string_char_c_str(&loc->ptr->name));
+ _Locinfo__Addcats(&locinfo, cat & other->ptr->catmask, MSVCP_basic_string_char_c_str(&other->ptr->name));
+ locale__Locimp__Makeloc(&locinfo, cat, this->ptr, other);
+ _Locinfo_dtor(&locinfo);
+
+ return this;
}
/* ??0locale at std@@QAE at ABV01@@Z */
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Jacek Caban : vbscript: Fixed uninitialized opcode param in forto
statement bytecode.
Message-ID:
Module: wine
Branch: master
Commit: 080169f1d2bf280b149943230d0ef859a8ae8b93
URL: http://source.winehq.org/git/wine.git/?a=commit;h=080169f1d2bf280b149943230d0ef859a8ae8b93
Author: Jacek Caban
Date: Thu Sep 6 11:57:00 2012 +0200
vbscript: Fixed uninitialized opcode param in forto statement bytecode.
---
dlls/vbscript/compile.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index 12db4e0..c3334fd 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -700,6 +700,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st
if(!instr)
return E_OUTOFMEMORY;
instr_ptr(ctx, instr)->arg1.bstr = identifier;
+ instr_ptr(ctx, instr)->arg2.uint = 0;
hres = compile_expression(ctx, stat->to_expr);
if(FAILED(hres))
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Jacek Caban : vbscript: Renamed vbscode_t' s variables to not suggest
that they are global code-only.
Message-ID:
Module: wine
Branch: master
Commit: 9e3f75cfb1b40cdaff0c68cbf79c43770ca44e61
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9e3f75cfb1b40cdaff0c68cbf79c43770ca44e61
Author: Jacek Caban
Date: Thu Sep 6 11:57:15 2012 +0200
vbscript: Renamed vbscode_t's variables to not suggest that they are global code-only.
---
dlls/vbscript/compile.c | 20 ++++++++++----------
dlls/vbscript/vbscript.c | 13 +++++++++----
dlls/vbscript/vbscript.h | 4 ++--
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index c3334fd..89e290d 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -973,7 +973,7 @@ static HRESULT compile_const_statement(compile_ctx_t *ctx, const_statement_t *st
static HRESULT compile_function_statement(compile_ctx_t *ctx, function_statement_t *stat)
{
- if(ctx->func != &ctx->code->global_code) {
+ if(ctx->func != &ctx->code->main_code) {
FIXME("Function is not in the global code\n");
return E_FAIL;
}
@@ -1615,15 +1615,15 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
ret->bstr_pool = NULL;
ret->bstr_pool_size = 0;
ret->bstr_cnt = 0;
- ret->global_executed = FALSE;
+ ret->pending_exec = FALSE;
- ret->global_code.type = FUNC_GLOBAL;
- ret->global_code.name = NULL;
- ret->global_code.code_ctx = ret;
- ret->global_code.vars = NULL;
- ret->global_code.var_cnt = 0;
- ret->global_code.arg_cnt = 0;
- ret->global_code.args = NULL;
+ ret->main_code.type = FUNC_GLOBAL;
+ ret->main_code.name = NULL;
+ ret->main_code.code_ctx = ret;
+ ret->main_code.vars = NULL;
+ ret->main_code.var_cnt = 0;
+ ret->main_code.arg_cnt = 0;
+ ret->main_code.args = NULL;
list_init(&ret->entry);
return ret;
@@ -1664,7 +1664,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, vbscode_t **ret)
ctx.stat_ctx = NULL;
ctx.labels_cnt = ctx.labels_size = 0;
- hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->global_code);
+ hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->main_code);
if(FAILED(hres)) {
release_compiler(&ctx);
return hres;
diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
index a5a9853..f250df3 100644
--- a/dlls/vbscript/vbscript.c
+++ b/dlls/vbscript/vbscript.c
@@ -77,10 +77,10 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code)
{
HRESULT hres;
- code->global_executed = TRUE;
+ code->pending_exec = FALSE;
IActiveScriptSite_OnEnterScript(ctx->site);
- hres = exec_script(ctx, &code->global_code, NULL, NULL, NULL);
+ hres = exec_script(ctx, &code->main_code, NULL, NULL, NULL);
IActiveScriptSite_OnLeaveScript(ctx->site);
return hres;
@@ -91,7 +91,7 @@ static void exec_queued_code(script_ctx_t *ctx)
vbscode_t *iter;
LIST_FOR_EACH_ENTRY(iter, &ctx->code_list, vbscode_t, entry) {
- if(!iter->global_executed)
+ if(iter->pending_exec)
exec_global_code(ctx, iter);
}
}
@@ -604,7 +604,12 @@ static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
if(FAILED(hres))
return hres;
- return is_started(This) ? exec_global_code(This->ctx, code) : S_OK;
+ if(!is_started(This)) {
+ code->pending_exec = TRUE;
+ return S_OK;
+ }
+
+ return exec_global_code(This->ctx, code);
}
static const IActiveScriptParseVtbl VBScriptParseVtbl = {
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 3f1e887..788d98d 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -298,8 +298,8 @@ struct _vbscode_t {
BOOL option_explicit;
- BOOL global_executed;
- function_t global_code;
+ BOOL pending_exec;
+ function_t main_code;
BSTR *bstr_pool;
unsigned bstr_pool_size;
From julliard at winehq.org Thu Sep 6 13:37:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:22 -0500
Subject: Jacek Caban : vbscript: Added IActiveScriptParseProcedure2::
ParseProcedureText implementation.
Message-ID:
Module: wine
Branch: master
Commit: cf0faf1d3cac6b1eeb49bd270187de4ce8594164
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cf0faf1d3cac6b1eeb49bd270187de4ce8594164
Author: Jacek Caban
Date: Thu Sep 6 11:57:33 2012 +0200
vbscript: Added IActiveScriptParseProcedure2::ParseProcedureText implementation.
---
dlls/vbscript/vbdisp.c | 49 +++++++++++++++++++++++++++++++++++++++++++++-
dlls/vbscript/vbscript.c | 15 ++++++++++++-
dlls/vbscript/vbscript.h | 3 ++
3 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index 022ac1d..f6e3f11 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -501,6 +501,8 @@ HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
vbdisp->ref = 1;
vbdisp->desc = desc;
+ list_add_tail(&desc->ctx->objects, &vbdisp->entry);
+
if(desc->class_initialize_id) {
DISPPARAMS dp = {0};
HRESULT hres;
@@ -513,11 +515,56 @@ HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
}
}
- list_add_tail(&desc->ctx->objects, &vbdisp->entry);
*ret = vbdisp;
return S_OK;
}
+static HRESULT Procedure_invoke(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res)
+{
+ script_ctx_t *ctx = This->desc->ctx;
+ HRESULT hres;
+
+ TRACE("\n");
+
+ IActiveScriptSite_OnEnterScript(ctx->site);
+ hres = exec_script(ctx, This->desc->value_func, NULL, NULL, NULL);
+ IActiveScriptSite_OnLeaveScript(ctx->site);
+
+ return hres;
+}
+
+static const builtin_prop_t procedure_props[] = {
+ {DISPID_VALUE, Procedure_invoke, 0}
+};
+
+HRESULT create_procedure_disp(script_ctx_t *ctx, vbscode_t *code, IDispatch **ret)
+{
+ class_desc_t *desc;
+ vbdisp_t *vbdisp;
+ HRESULT hres;
+
+ desc = heap_alloc_zero(sizeof(*desc));
+ if(!desc)
+ return E_OUTOFMEMORY;
+
+ desc->ctx = ctx;
+ desc->builtin_prop_cnt = sizeof(procedure_props)/sizeof(*procedure_props);
+ desc->builtin_props = procedure_props;
+ desc->value_func = &code->main_code;
+
+ hres = create_vbdisp(desc, &vbdisp);
+ if(FAILED(hres)) {
+ heap_free(desc);
+ return hres;
+ }
+
+ desc->next = ctx->procs;
+ ctx->procs = desc;
+
+ *ret = (IDispatch*)&vbdisp->IDispatchEx_iface;
+ return S_OK;
+}
+
void collect_objects(script_ctx_t *ctx)
{
vbdisp_t *iter, *iter2;
diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
index f250df3..f842bba 100644
--- a/dlls/vbscript/vbscript.c
+++ b/dlls/vbscript/vbscript.c
@@ -650,10 +650,21 @@ static HRESULT WINAPI VBScriptParseProcedure_ParseProcedureText(IActiveScriptPar
CTXARG_T dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, IDispatch **ppdisp)
{
VBScript *This = impl_from_IActiveScriptParseProcedure2(iface);
- FIXME("(%p)->(%s %s %s %s %p %s %s %u %x %p)\n", This, debugstr_w(pstrCode), debugstr_w(pstrFormalParams),
+ vbscode_t *code;
+ HRESULT hres;
+
+ TRACE("(%p)->(%s %s %s %s %p %s %s %u %x %p)\n", This, debugstr_w(pstrCode), debugstr_w(pstrFormalParams),
debugstr_w(pstrProcedureName), debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter),
wine_dbgstr_longlong(dwSourceContextCookie), ulStartingLineNumber, dwFlags, ppdisp);
- return E_NOTIMPL;
+
+ if(This->thread_id != GetCurrentThreadId() || This->state == SCRIPTSTATE_CLOSED)
+ return E_UNEXPECTED;
+
+ hres = compile_script(This->ctx, pstrCode, &code);
+ if(FAILED(hres))
+ return hres;
+
+ return create_procedure_disp(This->ctx, code, ppdisp);
}
static const IActiveScriptParseProcedure2Vtbl VBScriptParseProcedureVtbl = {
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 788d98d..8a316ab 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -100,6 +100,7 @@ typedef struct _class_desc_t {
unsigned builtin_prop_cnt;
const builtin_prop_t *builtin_props;
ITypeInfo *typeinfo;
+ function_t *value_func;
struct _class_desc_t *next;
} class_desc_t;
@@ -121,6 +122,7 @@ HRESULT vbdisp_get_id(vbdisp_t*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
void collect_objects(script_ctx_t*) DECLSPEC_HIDDEN;
+HRESULT create_procedure_disp(script_ctx_t*,vbscode_t*,IDispatch**) DECLSPEC_HIDDEN;
static inline unsigned arg_cnt(const DISPPARAMS *dp)
{
@@ -160,6 +162,7 @@ struct _script_ctx_t {
dynamic_var_t *global_vars;
function_t *global_funcs;
class_desc_t *classes;
+ class_desc_t *procs;
vbsheap_t heap;
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Jacek Caban : vbscript: Added IActiveScriptParseProcedure2::
ParseProcedureText tests.
Message-ID:
Module: wine
Branch: master
Commit: 76b1a7e016e93eaa9f06b9a018728353da5bfd7c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=76b1a7e016e93eaa9f06b9a018728353da5bfd7c
Author: Jacek Caban
Date: Thu Sep 6 11:57:46 2012 +0200
vbscript: Added IActiveScriptParseProcedure2::ParseProcedureText tests.
---
dlls/vbscript/tests/run.c | 162 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 141 insertions(+), 21 deletions(-)
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index d77c6cb..6a2b72a 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -33,6 +33,8 @@
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
+#define IActiveScriptParseProcedure2_Release IActiveScriptParseProcedure2_64_Release
+#define IActiveScriptParseProcedure2_ParseProcedureText IActiveScriptParseProcedure2_64_ParseProcedureText
#else
@@ -40,6 +42,8 @@
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
+#define IActiveScriptParseProcedure2_Release IActiveScriptParseProcedure2_32_Release
+#define IActiveScriptParseProcedure2_ParseProcedureText IActiveScriptParseProcedure2_32_ParseProcedureText
#endif
@@ -106,6 +110,7 @@ DEFINE_EXPECT(Next);
#define DISPID_COLLOBJ_RESET 3000
static const WCHAR testW[] = {'t','e','s','t',0};
+static const WCHAR emptyW[] = {0};
static BOOL strict_dispid_check, is_english;
static const char *test_name = "(null)";
@@ -130,6 +135,18 @@ static int strcmp_wa(LPCWSTR strw, const char *stra)
return lstrcmpA(buf, stra);
}
+static const char *debugstr_guid(REFIID riid)
+{
+ static char buf[50];
+
+ sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
+ riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
+ riid->Data4[5], riid->Data4[6], riid->Data4[7]);
+
+ return buf;
+}
+
static const char *vt2a(VARIANT *v)
{
if(V_VT(v) == (VT_BYREF|VT_VARIANT)) {
@@ -186,6 +203,38 @@ static BOOL is_lang_english(void)
return PRIMARYLANGID(GetUserDefaultLangID()) == LANG_ENGLISH;
}
+static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
+{
+ ok(0, "unexpected call\n");
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
+ REFIID riid, void **ppv)
+{
+ ok(0, "unexpected service %s\n", debugstr_guid(guidService));
+ return E_NOINTERFACE;
+}
+
+static const IServiceProviderVtbl ServiceProviderVtbl = {
+ ServiceProvider_QueryInterface,
+ ServiceProvider_AddRef,
+ ServiceProvider_Release,
+ ServiceProvider_QueryService
+};
+
+static IServiceProvider caller_sp = { &ServiceProviderVtbl };
+
static void test_disp(IDispatch *disp)
{
DISPID id, public_prop_id, public_prop2_id, public_func_id, public_sub_id, defvalget_id;
@@ -378,18 +427,6 @@ static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect)
ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
}
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
- riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
- riid->Data4[5], riid->Data4[6], riid->Data4[7]);
-
- return buf;
-}
-
static IDispatchEx enumDisp;
static HRESULT WINAPI EnumVARIANT_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
@@ -1240,29 +1277,24 @@ static IActiveScript *create_script(void)
return script;
}
-static HRESULT parse_script(DWORD flags, BSTR script_str)
+static IActiveScript *create_and_init_script(DWORD flags)
{
IActiveScriptParse *parser;
IActiveScript *engine;
- IDispatch *script_disp;
- LONG ref;
HRESULT hres;
engine = create_script();
if(!engine)
- return S_OK;
+ return NULL;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
- if (FAILED(hres))
- {
- IActiveScript_Release(engine);
- return hres;
- }
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
+ IActiveScriptParse_Release(parser);
+
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
@@ -1273,6 +1305,41 @@ static HRESULT parse_script(DWORD flags, BSTR script_str)
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
+ return engine;
+}
+
+static void close_script(IActiveScript *script)
+{
+ ULONG ref;
+ HRESULT hres;
+
+ hres = IActiveScript_Close(script);
+ ok(hres == S_OK, "Close failed: %08x\n", hres);
+
+ ref = IActiveScript_Release(script);
+ ok(!ref, "ref=%u\n", ref);
+}
+
+static HRESULT parse_script(DWORD flags, BSTR script_str)
+{
+ IActiveScriptParse *parser;
+ IActiveScript *engine;
+ IDispatch *script_disp;
+ LONG ref;
+ HRESULT hres;
+
+ engine = create_and_init_script(flags);
+ if(!engine)
+ return S_OK;
+
+ hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
+ ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
+ if (FAILED(hres))
+ {
+ IActiveScript_Release(engine);
+ return hres;
+ }
+
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
ok(script_disp != NULL, "script_disp == NULL\n");
@@ -1308,6 +1375,58 @@ static void parse_script_a(const char *src)
parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src);
}
+static IDispatchEx *parse_procedure(IActiveScriptParseProcedure2 *parse_proc, const char *src)
+{
+ IDispatchEx *dispex;
+ IDispatch *disp;
+ BSTR str;
+ HRESULT hres;
+
+ static const WCHAR delimiterW[] = {'\"',0};
+
+ str = a2bstr(src);
+ hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, str, NULL, emptyW, NULL, NULL, delimiterW, 0, 0,
+ SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
+ SysFreeString(str);
+ ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
+ ok(disp != NULL, "disp = NULL\n");
+
+ hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
+ IDispatch_Release(disp);
+ ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
+
+ return dispex;
+}
+
+
+static void test_procedures(void)
+{
+ IActiveScriptParseProcedure2 *parse_proc;
+ DISPPARAMS dp = {NULL};
+ IActiveScript *script;
+ IDispatchEx *proc;
+ EXCEPINFO ei = {0};
+ VARIANT v;
+ HRESULT hres;
+
+ script = create_and_init_script(0);
+
+ hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
+ ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2 iface: %08x\n", hres);
+
+ proc = parse_procedure(parse_proc, "dim x\nif true then x=false");
+
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp);
+ ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
+
+ IDispatchEx_Release(proc);
+
+ IActiveScriptParseProcedure2_Release(parse_proc);
+
+ close_script(script);
+}
+
static void test_gc(void)
{
IActiveScriptParse *parser;
@@ -1609,6 +1728,7 @@ static void run_tests(void)
run_from_res("lang.vbs");
run_from_res("api.vbs");
+ test_procedures();
test_gc();
}
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Jacek Caban : mshtml: Added VBScript as event attribute tests.
Message-ID:
Module: wine
Branch: master
Commit: 1cd527924f5814dc7fd1cb89de983b50ad570719
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1cd527924f5814dc7fd1cb89de983b50ad570719
Author: Jacek Caban
Date: Thu Sep 6 11:59:23 2012 +0200
mshtml: Added VBScript as event attribute tests.
---
dlls/mshtml/tests/vbtest.html | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/tests/vbtest.html b/dlls/mshtml/tests/vbtest.html
index 9addc93..7b8cebc 100644
--- a/dlls/mshtml/tests/vbtest.html
+++ b/dlls/mshtml/tests/vbtest.html
@@ -26,9 +26,6 @@ Sub runTest()
End Sub
-
-
+
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Hans Leidekker : wbemprox: Correctly report the number of logical
processors.
Message-ID:
Module: wine
Branch: master
Commit: b11cfb7b216a20bd9c3adf9640bb5e93fc5f2a5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b11cfb7b216a20bd9c3adf9640bb5e93fc5f2a5a
Author: Hans Leidekker
Date: Thu Sep 6 14:03:24 2012 +0200
wbemprox: Correctly report the number of logical processors.
---
dlls/wbemprox/builtin.c | 54 ++++++++++++++++++++++++++++++++++++----------
1 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index e3a5e6d..4c82425 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -23,6 +23,8 @@
#include "config.h"
#include
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wbemcli.h"
@@ -259,7 +261,7 @@ static const struct column col_processor[] =
{ prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC },
{ prop_maxclockspeedW, CIM_UINT32 },
{ prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC },
- { prop_numlogicalprocessorsW, CIM_UINT32 },
+ { prop_numlogicalprocessorsW, CIM_UINT32, VT_I4 },
{ prop_processoridW, CIM_STRING|COL_FLAG_DYNAMIC }
};
static const struct column col_service[] =
@@ -400,7 +402,7 @@ struct record_processor
const WCHAR *manufacturer;
UINT32 maxclockspeed;
const WCHAR *name;
- UINT32 numberoflogicalprocessors;
+ UINT32 num_logical_processors;
const WCHAR *processor_id;
};
struct record_service
@@ -475,6 +477,32 @@ static UINT get_processor_count(void)
return info.NumberOfProcessors;
}
+static UINT get_logical_processor_count(void)
+{
+ SYSTEM_LOGICAL_PROCESSOR_INFORMATION *info;
+ UINT i, j, count = 0;
+ NTSTATUS status;
+ ULONG len;
+
+ status = NtQuerySystemInformation( SystemLogicalProcessorInformation, NULL, 0, &len );
+ if (status != STATUS_INFO_LENGTH_MISMATCH) return get_processor_count();
+
+ if (!(info = heap_alloc( len ))) return get_processor_count();
+ status = NtQuerySystemInformation( SystemLogicalProcessorInformation, info, len, &len );
+ if (status != STATUS_SUCCESS)
+ {
+ heap_free( info );
+ return get_processor_count();
+ }
+ for (i = 0; i < len / sizeof(*info); i++)
+ {
+ if (info[i].Relationship != RelationProcessorCore) continue;
+ for (j = 0; j < sizeof(ULONG_PTR); j++) if (info[i].ProcessorMask & (1 << j)) count++;
+ }
+ heap_free( info );
+ return count;
+}
+
static UINT64 get_total_physical_memory(void)
{
MEMORYSTATUSEX status;
@@ -495,8 +523,8 @@ static void fill_compsys( struct table *table )
rec->domainrole = 0; /* standalone workstation */
rec->manufacturer = compsys_manufacturerW;
rec->model = compsys_modelW;
- rec->num_logical_processors = get_processor_count();
- rec->num_processors = rec->num_logical_processors;
+ rec->num_logical_processors = get_logical_processor_count();
+ rec->num_processors = get_processor_count();
rec->total_physical_memory = get_total_physical_memory();
TRACE("created 1 row\n");
@@ -758,7 +786,7 @@ static void fill_processor( struct table *table )
static const WCHAR fmtW[] = {'C','P','U','%','u',0};
WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0};
struct record_processor *rec;
- UINT i, offset = 0, count = get_processor_count(), cpuMhz;
+ UINT i, offset = 0, num_logical_processors, count = get_processor_count(), cpuMhz;
PROCESSOR_POWER_INFORMATION ppi;
if (!(table->data = heap_alloc( sizeof(*rec) * count ))) return;
@@ -772,17 +800,19 @@ static void fill_processor( struct table *table )
else
cpuMhz = 1000000;
+ num_logical_processors = get_logical_processor_count() / count;
+
for (i = 0; i < count; i++)
{
rec = (struct record_processor *)(table->data + offset);
- rec->cpu_status = 1; /* CPU Enabled */
+ rec->cpu_status = 1; /* CPU Enabled */
sprintfW( device_id, fmtW, i );
- rec->device_id = heap_strdupW( device_id );
- rec->manufacturer = heap_strdupW( manufacturer );
- rec->maxclockspeed = cpuMhz;
- rec->name = heap_strdupW( name );
- rec->numberoflogicalprocessors = count;
- rec->processor_id = heap_strdupW( processor_id );
+ rec->device_id = heap_strdupW( device_id );
+ rec->manufacturer = heap_strdupW( manufacturer );
+ rec->maxclockspeed = cpuMhz;
+ rec->name = heap_strdupW( name );
+ rec->num_logical_processors = num_logical_processors;
+ rec->processor_id = heap_strdupW( processor_id );
offset += sizeof(*rec);
}
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Hans Leidekker : wbemprox: Add a function to retrieve the maximum
processor clock speed.
Message-ID:
Module: wine
Branch: master
Commit: e2bd61b45d512229c200d91ce7afbefe790a37c5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e2bd61b45d512229c200d91ce7afbefe790a37c5
Author: Hans Leidekker
Date: Thu Sep 6 14:03:38 2012 +0200
wbemprox: Add a function to retrieve the maximum processor clock speed.
---
dlls/wbemprox/builtin.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 4c82425..c2271c0 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -780,14 +780,19 @@ static void get_processor_name( WCHAR *name )
regs_to_str( regs, 16, name + 32 );
}
}
+static UINT get_processor_maxclockspeed( void )
+{
+ PROCESSOR_POWER_INFORMATION info;
+ if (!NtPowerInformation( ProcessorInformation, NULL, 0, &info, sizeof(info) )) return info.MaxMhz;
+ return 1000000;
+}
static void fill_processor( struct table *table )
{
static const WCHAR fmtW[] = {'C','P','U','%','u',0};
WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0};
struct record_processor *rec;
- UINT i, offset = 0, num_logical_processors, count = get_processor_count(), cpuMhz;
- PROCESSOR_POWER_INFORMATION ppi;
+ UINT i, offset = 0, maxclockspeed, num_logical_processors, count = get_processor_count();
if (!(table->data = heap_alloc( sizeof(*rec) * count ))) return;
@@ -795,11 +800,7 @@ static void fill_processor( struct table *table )
get_processor_manufacturer( manufacturer );
get_processor_name( name );
- if(!NtPowerInformation(ProcessorInformation, NULL, 0, &ppi, sizeof(ppi)))
- cpuMhz = ppi.MaxMhz;
- else
- cpuMhz = 1000000;
-
+ maxclockspeed = get_processor_maxclockspeed();
num_logical_processors = get_logical_processor_count() / count;
for (i = 0; i < count; i++)
@@ -809,7 +810,7 @@ static void fill_processor( struct table *table )
sprintfW( device_id, fmtW, i );
rec->device_id = heap_strdupW( device_id );
rec->manufacturer = heap_strdupW( manufacturer );
- rec->maxclockspeed = cpuMhz;
+ rec->maxclockspeed = maxclockspeed;
rec->name = heap_strdupW( name );
rec->num_logical_processors = num_logical_processors;
rec->processor_id = heap_strdupW( processor_id );
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Hans Leidekker : wbemprox: Implement IWbemClassObject::SpawnInstance.
Message-ID:
Module: wine
Branch: master
Commit: d25450c80b0986a714480762cc1c3a427d14137f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d25450c80b0986a714480762cc1c3a427d14137f
Author: Hans Leidekker
Date: Thu Sep 6 14:03:50 2012 +0200
wbemprox: Implement IWbemClassObject::SpawnInstance.
---
dlls/wbemprox/class.c | 56 ++++++++++++++++++++++++++++++++++---
dlls/wbemprox/services.c | 2 +-
dlls/wbemprox/wbemprox_private.h | 18 +++++++++++-
3 files changed, 69 insertions(+), 7 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index c0a8cd9..cc37b57 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -125,7 +125,7 @@ static HRESULT WINAPI enum_class_object_Next(
*puReturned = 0;
if (ec->index + uCount > view->count) return WBEM_S_FALSE;
- hr = create_class_object( view->table->name, iface, ec->index, apObjects );
+ hr = create_class_object( view->table->name, iface, ec->index, NULL, apObjects );
if (hr != S_OK) return hr;
ec->index++;
@@ -212,6 +212,40 @@ HRESULT EnumWbemClassObject_create(
return S_OK;
}
+static struct record *create_record( const struct column *columns, UINT num_cols )
+{
+ UINT i;
+ struct record *record;
+
+ if (!(record = heap_alloc( sizeof(struct record) ))) return NULL;
+ if (!(record->fields = heap_alloc( num_cols * sizeof(struct field) )))
+ {
+ heap_free( record );
+ return NULL;
+ }
+ for (i = 0; i < num_cols; i++)
+ {
+ record->fields[i].type = columns[i].type;
+ record->fields[i].u.ival = 0;
+ }
+ record->count = num_cols;
+ return record;
+}
+
+static void destroy_record( struct record *record )
+{
+ UINT i;
+
+ if (!record) return;
+ for (i = 0; i < record->count; i++)
+ {
+ if (record->fields[i].type == CIM_STRING || record->fields[i].type == CIM_DATETIME)
+ heap_free( record->fields[i].u.sval );
+ }
+ heap_free( record->fields );
+ heap_free( record );
+}
+
struct class_object
{
IWbemClassObject IWbemClassObject_iface;
@@ -221,6 +255,7 @@ struct class_object
UINT index;
UINT index_method;
UINT index_property;
+ struct record *record; /* uncommitted instance */
};
static inline struct class_object *impl_from_IWbemClassObject(
@@ -245,6 +280,7 @@ static ULONG WINAPI class_object_Release(
{
TRACE("destroying %p\n", co);
if (co->iter) IEnumWbemClassObject_Release( co->iter );
+ destroy_record( co->record );
heap_free( co->name );
heap_free( co );
}
@@ -495,8 +531,17 @@ static HRESULT WINAPI class_object_SpawnInstance(
LONG lFlags,
IWbemClassObject **ppNewInstance )
{
- FIXME("%p, %08x, %p\n", iface, lFlags, ppNewInstance);
- return E_NOTIMPL;
+ struct class_object *co = impl_from_IWbemClassObject( iface );
+ struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter );
+ struct view *view = ec->query->view;
+ struct record *record;
+
+ TRACE("%p, %08x, %p\n", iface, lFlags, ppNewInstance);
+
+ if (!(record = create_record( view->table->columns, view->table->num_cols )))
+ return E_OUTOFMEMORY;
+
+ return create_class_object( co->name, NULL, 0, record, ppNewInstance );
}
static HRESULT WINAPI class_object_CompareTo(
@@ -833,8 +878,8 @@ static const IWbemClassObjectVtbl class_object_vtbl =
class_object_GetMethodOrigin
};
-HRESULT create_class_object(
- const WCHAR *name, IEnumWbemClassObject *iter, UINT index, IWbemClassObject **obj )
+HRESULT create_class_object( const WCHAR *name, IEnumWbemClassObject *iter, UINT index,
+ struct record *record, IWbemClassObject **obj )
{
struct class_object *co;
@@ -855,6 +900,7 @@ HRESULT create_class_object(
co->index = index;
co->index_method = 0;
co->index_property = 0;
+ co->record = record;
if (iter) IEnumWbemClassObject_AddRef( iter );
*obj = &co->IWbemClassObject_iface;
diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c
index abd31c5..bf367c7 100644
--- a/dlls/wbemprox/services.c
+++ b/dlls/wbemprox/services.c
@@ -334,7 +334,7 @@ HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
free_path( path );
return hr;
}
- hr = create_class_object( path->class, iter, 0, obj );
+ hr = create_class_object( path->class, iter, 0, NULL, obj );
IEnumWbemClassObject_Release( iter );
free_path( path );
return hr;
diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
index 69b04e7..e1f4d45 100644
--- a/dlls/wbemprox/wbemprox_private.h
+++ b/dlls/wbemprox/wbemprox_private.h
@@ -66,6 +66,22 @@ struct property
const struct property *next;
};
+struct field
+{
+ UINT type;
+ union
+ {
+ LONGLONG ival;
+ WCHAR *sval;
+ } u;
+};
+
+struct record
+{
+ UINT count;
+ struct field *fields;
+};
+
enum operator
{
OP_EQ = 1,
@@ -157,7 +173,7 @@ const WCHAR *get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemServices_create(IUnknown *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT create_class_object(const WCHAR *, IEnumWbemClassObject *, UINT,
- IWbemClassObject **) DECLSPEC_HIDDEN;
+ struct record *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT EnumWbemClassObject_create(IUnknown *, struct query *, LPVOID *) DECLSPEC_HIDDEN;
static void *heap_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Hans Leidekker : wbemprox: Add support for uncommitted instances in
IWbemClassObject::Put.
Message-ID:
Module: wine
Branch: master
Commit: 0d28920804e714a577a7b3a150066e58dc35bde7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0d28920804e714a577a7b3a150066e58dc35bde7
Author: Hans Leidekker
Date: Thu Sep 6 14:04:03 2012 +0200
wbemprox: Add support for uncommitted instances in IWbemClassObject::Put.
---
dlls/wbemprox/class.c | 40 ++++++++++++++++++++++++++++++++++++-
dlls/wbemprox/query.c | 2 +-
dlls/wbemprox/wbemprox_private.h | 1 +
3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index cc37b57..1ec1f51 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -335,6 +335,34 @@ static HRESULT WINAPI class_object_Get(
return get_propval( view, co->index, wszName, pVal, pType, plFlavor );
}
+static HRESULT record_set_value( struct record *record, UINT index, VARIANT *var )
+{
+ LONGLONG val;
+ CIMTYPE type;
+ HRESULT hr;
+
+ if ((hr = variant_to_longlong( var, &val, &type )) != S_OK) return hr;
+ if (type != record->fields[index].type) return WBEM_E_TYPE_MISMATCH;
+
+ switch (type)
+ {
+ case CIM_STRING:
+ case CIM_DATETIME:
+ record->fields[index].u.sval = (WCHAR *)(INT_PTR)val;
+ return S_OK;
+ case CIM_SINT16:
+ case CIM_UINT16:
+ case CIM_SINT32:
+ case CIM_UINT32:
+ record->fields[index].u.ival = val;
+ return S_OK;
+ default:
+ FIXME("unhandled type %u\n", type);
+ break;
+ }
+ return WBEM_E_INVALID_PARAMETER;
+}
+
static HRESULT WINAPI class_object_Put(
IWbemClassObject *iface,
LPCWSTR wszName,
@@ -344,11 +372,19 @@ static HRESULT WINAPI class_object_Put(
{
struct class_object *co = impl_from_IWbemClassObject( iface );
struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter );
- struct view *view = ec->query->view;
TRACE("%p, %s, %08x, %p, %u\n", iface, debugstr_w(wszName), lFlags, pVal, Type);
- return put_propval( view, co->index, wszName, pVal, Type );
+ if (co->record)
+ {
+ struct table *table = get_table( co->name );
+ UINT index;
+ HRESULT hr;
+
+ if ((hr = get_column_index( table, wszName, &index )) != S_OK) return hr;
+ return record_set_value( co->record, index, pVal );
+ }
+ return put_propval( ec->query->view, co->index, wszName, pVal, Type );
}
static HRESULT WINAPI class_object_Delete(
diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index d2b0e76..3525be9 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -648,7 +648,7 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
return S_OK;
}
-static HRESULT variant_to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
+HRESULT variant_to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
{
if (!var)
{
diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
index e1f4d45..2467a76 100644
--- a/dlls/wbemprox/wbemprox_private.h
+++ b/dlls/wbemprox/wbemprox_private.h
@@ -165,6 +165,7 @@ HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPE
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN;
+HRESULT variant_to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN;
HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN;
HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
const WCHAR *get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Hans Leidekker : wbemprox: Support IClientSecurity on class objects.
Message-ID:
Module: wine
Branch: master
Commit: 61a8a247cfc56daddd5fa868d5cabdd126053d38
URL: http://source.winehq.org/git/wine.git/?a=commit;h=61a8a247cfc56daddd5fa868d5cabdd126053d38
Author: Hans Leidekker
Date: Thu Sep 6 14:04:14 2012 +0200
wbemprox: Support IClientSecurity on class objects.
---
dlls/wbemprox/class.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/wbemprox/class.c b/dlls/wbemprox/class.c
index 1ec1f51..5a70e9d 100644
--- a/dlls/wbemprox/class.c
+++ b/dlls/wbemprox/class.c
@@ -301,6 +301,11 @@ static HRESULT WINAPI class_object_QueryInterface(
{
*ppvObject = co;
}
+ else if (IsEqualGUID( riid, &IID_IClientSecurity ))
+ {
+ *ppvObject = &client_security;
+ return S_OK;
+ }
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Marcus Meissner : msi: Move free after last usage (Coverity).
Message-ID:
Module: wine
Branch: master
Commit: b9550ad35239db39e2d4cf3411a381319cf652c5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9550ad35239db39e2d4cf3411a381319cf652c5
Author: Marcus Meissner
Date: Thu Sep 6 15:19:48 2012 +0200
msi: Move free after last usage (Coverity).
---
dlls/msi/table.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index dd25fbb..93b0268 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -2328,12 +2328,15 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
r = IStorage_OpenStream( stg, encname, NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm );
- msi_free( encname );
if ( r != ERROR_SUCCESS )
+ {
+ msi_free( encname );
return NULL;
+ }
MSI_RecordSetStream( rec, i+1, stm );
TRACE(" field %d [%s]\n", i+1, debugstr_w(encname));
+ msi_free( encname );
}
else if( columns[i].type & MSITYPE_STRING )
{
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Jason Edmeades : cmd: A successful set should reset the errorlevel.
Message-ID:
Module: wine
Branch: master
Commit: f9b4c78a8981df2b8aa81b0a2d32bc8e828c9ca3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f9b4c78a8981df2b8aa81b0a2d32bc8e828c9ca3
Author: Jason Edmeades
Date: Wed Sep 5 23:41:48 2012 +0100
cmd: A successful set should reset the errorlevel.
---
programs/cmd/builtins.c | 1 +
programs/cmd/tests/test_builtins.cmd.exp | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index b2f9aeb..a9e7473 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -2366,6 +2366,7 @@ void WCMD_setshow_env (WCHAR *s) {
if ((!status) & (gle == ERROR_ENVVAR_NOT_FOUND)) {
errorlevel = 1;
} else if ((!status)) WCMD_print_error();
+ else errorlevel = 0;
}
}
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index fe4c30c..6a19d2c 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -201,13 +201,13 @@ baz at space@
@todo_wine at 0
------------ Testing 'set' ------------
1
- at todo_wine@0
+0
FOOBAR not defined
@todo_wine@ baz
FOOBAR = baz
- at todo_wine@0
+0
@todo_wine@ baz2
- at todo_wine@0
+0
bar
@todo_wine at FOOBAR= bar
@todo_wine at FOOBAR = baz2
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Jason Edmeades : cmd: Space does not delimit environment variable
names.
Message-ID:
Module: wine
Branch: master
Commit: ebd18109189b78bb548637427b564905faa31454
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ebd18109189b78bb548637427b564905faa31454
Author: Jason Edmeades
Date: Thu Sep 6 00:09:23 2012 +0100
cmd: Space does not delimit environment variable names.
---
programs/cmd/builtins.c | 2 ++
programs/cmd/tests/test_builtins.cmd.exp | 4 ++--
programs/cmd/wcmdmain.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index a9e7473..94c7171 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -2361,6 +2361,8 @@ void WCMD_setshow_env (WCHAR *s) {
*p++ = '\0';
if (strlenW(p) == 0) p = NULL;
+ WINE_TRACE("set: Setting var '%s' to '%s'\n", wine_dbgstr_w(s),
+ wine_dbgstr_w(p));
status = SetEnvironmentVariableW(s, p);
gle = GetLastError();
if ((!status) & (gle == ERROR_ENVVAR_NOT_FOUND)) {
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 6a19d2c..d0a4e1f 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -203,10 +203,10 @@ baz at space@
1
0
FOOBAR not defined
- at todo_wine@ baz
+ baz
FOOBAR = baz
0
- at todo_wine@ baz2
+ baz2
0
bar
@todo_wine at FOOBAR= bar
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 93a2bb8..f762b70 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -557,7 +557,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
static const WCHAR Time[] = {'T','I','M','E','\0'};
static const WCHAR Cd[] = {'C','D','\0'};
static const WCHAR Random[] = {'R','A','N','D','O','M','\0'};
- static const WCHAR Delims[] = {'%',' ',':','\0'};
+ static const WCHAR Delims[] = {'%',':','\0'};
WINE_TRACE("Expanding: %s (%s,%s)\n", wine_dbgstr_w(start),
wine_dbgstr_w(forVal), wine_dbgstr_w(forVar));
From julliard at winehq.org Thu Sep 6 13:37:23 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Thu, 06 Sep 2012 13:37:23 -0500
Subject: Akihiro Sagawa : user32: Add support for legacy access keys.
Message-ID:
Module: wine
Branch: master
Commit: 70937bd8ddd7a4f40b844abf0dcb36c937d7ab45
URL: http://source.winehq.org/git/wine.git/?a=commit;h=70937bd8ddd7a4f40b844abf0dcb36c937d7ab45
Author: Akihiro Sagawa
Date: Wed Sep 5 20:31:17 2012 +0900
user32: Add support for legacy access keys.
---
dlls/user32/menu.c | 7 +++++--
dlls/user32/text.c | 27 ++++++++++++++++++++-------
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index f1beb94..b325372 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -773,15 +773,18 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
if( !forceMenuChar )
{
UINT i;
+ BOOL cjk = GetSystemMetrics( SM_DBCSENABLED );
for (i = 0; i < menu->nItems; i++, item++)
{
if( item->text)
{
- WCHAR *p = item->text - 2;
+ const WCHAR *p = item->text - 2;
do
{
- p = strchrW (p + 2, '&');
+ const WCHAR *q = p + 2;
+ p = strchrW (q, '&');
+ if (!p && cjk) p = strchrW (q, '\036'); /* Japanese Win16 */
}
while (p != NULL && p [1] == '&');
if (p && (toupperW(p[1]) == toupperW(key))) return i;
diff --git a/dlls/user32/text.c b/dlls/user32/text.c
index d7188c8..8539bdf 100644
--- a/dlls/user32/text.c
+++ b/dlls/user32/text.c
@@ -87,6 +87,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(text);
#define CR 13
#define SPACE 32
#define PREFIX 38
+#define ALPHA_PREFIX 30 /* Win16: Alphabet prefix */
+#define KANA_PREFIX 31 /* Win16: Katakana prefix */
#define FORWARD_SLASH '/'
#define BACK_SLASH '\\'
@@ -472,8 +474,9 @@ static void TEXT_SkipChars (int *new_count, const WCHAR **new_str,
max -= n;
while (n--)
{
- if (*start_str++ == PREFIX && max--)
+ if ((*start_str == PREFIX || *start_str == ALPHA_PREFIX) && max--)
start_str++;
+ start_str++;
}
start_count -= (start_str - str_on_entry);
}
@@ -507,10 +510,10 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns,
const ellipsis_data *pe)
{
int result = -1;
- unsigned int i = 0;
+ unsigned int i;
unsigned int n = pe->before + pe->under + pe->after;
assert (n <= ns);
- while (i < n)
+ for (i = 0; i < n; i++, str++)
{
if (i == pe->before)
{
@@ -523,16 +526,15 @@ static int TEXT_Reprefix (const WCHAR *str, unsigned int ns,
}
if (!ns) break;
ns--;
- if (*str++ == PREFIX)
+ if (*str == PREFIX || *str == ALPHA_PREFIX)
{
+ str++;
if (!ns) break;
if (*str != PREFIX)
result = (i < pe->before || pe->under == 0) ? i : i - pe->under + pe->len;
/* pe->len may be non-zero while pe_under is zero */
- str++;
ns--;
}
- i++;
}
return result;
}
@@ -631,8 +633,13 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
(str[i] != TAB || !(format & DT_EXPANDTABS)) &&
((str[i] != CR && str[i] != LF) || (format & DT_SINGLELINE)))
{
- if (str[i] == PREFIX && !(format & DT_NOPREFIX) && *count > 1)
+ if ((format & DT_NOPREFIX) || *count <= 1)
{
+ (*count)--; if (j < maxl) dest[j++] = str[i++]; else i++;
+ continue;
+ }
+
+ if (str[i] == PREFIX || str[i] == ALPHA_PREFIX) {
(*count)--, i++; /* Throw away the prefix itself */
if (str[i] == PREFIX)
{
@@ -648,6 +655,12 @@ static const WCHAR *TEXT_NextLineW( HDC hdc, const WCHAR *str, int *count,
* one.
*/
}
+ else if (str[i] == KANA_PREFIX)
+ {
+ /* Throw away katakana access keys */
+ (*count)--, i++; /* skip the prefix */
+ (*count)--, i++; /* skip the letter */
+ }
else
{
(*count)--; if (j < maxl) dest[j++] = str[i++]; else i++;
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Jacek Caban : mshtml: Avoid duplicated string release in
navigate_anchor.
Message-ID:
Module: wine
Branch: master
Commit: 34d671dc2551bb3f66a1173581acf42306bccb9f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=34d671dc2551bb3f66a1173581acf42306bccb9f
Author: Jacek Caban
Date: Fri Sep 7 10:28:58 2012 +0200
mshtml: Avoid duplicated string release in navigate_anchor.
---
dlls/mshtml/htmlanchor.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c
index a62a3a9..2243954 100644
--- a/dlls/mshtml/htmlanchor.c
+++ b/dlls/mshtml/htmlanchor.c
@@ -86,6 +86,8 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *target;
+ TRACE("target %s\n", debugstr_w(target));
+
nsAString_GetData(&target_str, &target);
if(*target && strcmpiW(target, _selfW)) {
if(!strcmpiW(target, _topW)) {
@@ -106,8 +108,6 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
nsAString_Finish(&target_str);
return hres;
}
-
- nsAString_Finish(&target_str);
}
}
}
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcp60: Fixed RTTI structure on 64-bit systems.
Message-ID:
Module: wine
Branch: master
Commit: 0ebd8990dfc9988f933adc5c6ccc43c02f5e8725
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0ebd8990dfc9988f933adc5c6ccc43c02f5e8725
Author: Piotr Caban
Date: Fri Sep 7 11:00:37 2012 +0200
msvcp60: Fixed RTTI structure on 64-bit systems.
---
dlls/msvcp60/cxx.h | 113 ++++++++++++++++++++++++++++++++++++++++++++-
dlls/msvcp60/exception.c | 14 ++++++
dlls/msvcp60/main.c | 1 +
dlls/msvcp60/msvcp.h | 2 +
4 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcp60/cxx.h b/dlls/msvcp60/cxx.h
index f709d12..956675c 100644
--- a/dlls/msvcp60/cxx.h
+++ b/dlls/msvcp60/cxx.h
@@ -64,7 +64,9 @@
#endif /* _WIN64 */
-#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
+#ifndef __x86_64__
+
+#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
static const type_info name ## _type_info = { \
&MSVCP_type_info_vtable, \
NULL, \
@@ -73,7 +75,7 @@
\
static const rtti_base_descriptor name ## _rtti_base_descriptor = { \
&name ##_type_info, \
- base_classes, \
+ base_classes_no, \
{ 0, -1, 0}, \
64 \
}; \
@@ -96,7 +98,7 @@ static const rtti_base_array name ## _rtti_base_array = { \
static const rtti_object_hierarchy name ## _hierarchy = { \
0, \
0, \
- base_classes+1, \
+ base_classes_no+1, \
&name ## _rtti_base_array \
}; \
\
@@ -108,6 +110,74 @@ const rtti_object_locator name ## _rtti = { \
&name ## _hierarchy \
}
+#else
+
+#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
+ static const type_info name ## _type_info = { \
+ &MSVCP_type_info_vtable, \
+ NULL, \
+ mangled_name \
+ }; \
+\
+static rtti_base_descriptor name ## _rtti_base_descriptor = { \
+ 0xdeadbeef, \
+ base_classes_no, \
+ { 0, -1, 0}, \
+ 64 \
+}; \
+\
+static rtti_base_array name ## _rtti_base_array = { \
+ { \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ } \
+}; \
+\
+static rtti_object_hierarchy name ## _hierarchy = { \
+ 0, \
+ 0, \
+ base_classes_no+1, \
+ 0xdeadbeef \
+}; \
+\
+rtti_object_locator name ## _rtti = { \
+ 1, \
+ off, \
+ 0, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef \
+};\
+\
+static void init_ ## name ## _rtti(char *base) \
+{ \
+ name ## _rtti_base_descriptor.type_descriptor = (char*)&name ## _type_info - base; \
+ name ## _rtti_base_array.bases[0] = (char*)&name ## _rtti_base_descriptor - base; \
+ name ## _rtti_base_array.bases[1] = (char*)cl1 - base; \
+ name ## _rtti_base_array.bases[2] = (char*)cl2 - base; \
+ name ## _rtti_base_array.bases[3] = (char*)cl3 - base; \
+ name ## _rtti_base_array.bases[4] = (char*)cl4 - base; \
+ name ## _rtti_base_array.bases[5] = (char*)cl5 - base; \
+ name ## _rtti_base_array.bases[6] = (char*)cl6 - base; \
+ name ## _rtti_base_array.bases[7] = (char*)cl7 - base; \
+ name ## _rtti_base_array.bases[8] = (char*)cl8 - base; \
+ name ## _rtti_base_array.bases[9] = (char*)cl9 - base; \
+ name ## _hierarchy.base_classes = (char*)&name ## _rtti_base_array - base; \
+ name ## _rtti.type_descriptor = (char*)&name ## _type_info - base; \
+ name ## _rtti.type_hierarchy = (char*)&name ## _hierarchy - base; \
+ name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
+}
+
+#endif
+
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
#define DEFINE_RTTI_DATA1(name, off, cl1, mangled_name) \
@@ -191,6 +261,8 @@ typedef struct
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
+#ifndef __x86_64__
+
typedef struct _rtti_base_descriptor
{
const type_info *type_descriptor;
@@ -220,3 +292,38 @@ typedef struct _rtti_object_locator
const type_info *type_descriptor;
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
+
+#else
+
+typedef struct
+{
+ unsigned int type_descriptor;
+ int num_base_classes;
+ this_ptr_offsets offsets; /* offsets for computing the this pointer */
+ unsigned int attributes;
+} rtti_base_descriptor;
+
+typedef struct
+{
+ unsigned int bases[10]; /* First element is the class itself */
+} rtti_base_array;
+
+typedef struct
+{
+ unsigned int signature;
+ unsigned int attributes;
+ int array_len; /* Size of the array pointed to by 'base_classes' */
+ unsigned int base_classes;
+} rtti_object_hierarchy;
+
+typedef struct
+{
+ unsigned int signature;
+ int base_class_offset;
+ unsigned int flags;
+ unsigned int type_descriptor;
+ unsigned int type_hierarchy;
+ unsigned int object_locator;
+} rtti_object_locator;
+
+#endif
diff --git a/dlls/msvcp60/exception.c b/dlls/msvcp60/exception.c
index 6d72e47..dde066c 100644
--- a/dlls/msvcp60/exception.c
+++ b/dlls/msvcp60/exception.c
@@ -784,3 +784,17 @@ void throw_exception(exception_type et, const char *str)
ERR("exception type not handled: %d\n", et);
}
}
+
+void init_exception(void *base)
+{
+#ifdef __x86_64__
+ init_type_info_rtti(base);
+ init_exception_rtti(base);
+ init_bad_alloc_rtti(base);
+ init_logic_error_rtti(base);
+ init_length_error_rtti(base);
+ init_out_of_range_rtti(base);
+ init_invalid_argument_rtti(base);
+ init_runtime_error_rtti(base);
+#endif
+}
diff --git a/dlls/msvcp60/main.c b/dlls/msvcp60/main.c
index a979528..dbaf5ee 100644
--- a/dlls/msvcp60/main.c
+++ b/dlls/msvcp60/main.c
@@ -90,6 +90,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_ATTACH:
init_cxx_funcs();
init_lockit();
+ init_exception(hinstDLL);
break;
case DLL_PROCESS_DETACH:
free_lockit();
diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h
index 7e1c47a..b1035b2 100644
--- a/dlls/msvcp60/msvcp.h
+++ b/dlls/msvcp60/msvcp.h
@@ -94,3 +94,5 @@ mutex* __thiscall mutex_ctor(mutex*);
void __thiscall mutex_dtor(mutex*);
void __thiscall mutex_lock(mutex*);
void __thiscall mutex_unlock(mutex*);
+
+void init_exception(void*);
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcp100: Fixed RTTI structure on 64-bit systems.
Message-ID:
Module: wine
Branch: master
Commit: c41fd08ddca012b3eb5b841bf8746ea80dec5d1d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c41fd08ddca012b3eb5b841bf8746ea80dec5d1d
Author: Piotr Caban
Date: Fri Sep 7 11:00:56 2012 +0200
msvcp100: Fixed RTTI structure on 64-bit systems.
---
dlls/msvcp100/cxx.h | 113 +++++++++++++++++++++++++++++++++++++++++++-
dlls/msvcp100/exception.c | 15 ++++++
dlls/msvcp100/ios.c | 49 +++++++++++++++++++-
dlls/msvcp100/locale.c | 27 +++++++++++
dlls/msvcp100/msvcp.h | 4 +-
dlls/msvcp100/msvcp100.c | 4 +-
6 files changed, 205 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcp100/cxx.h b/dlls/msvcp100/cxx.h
index f709d12..956675c 100644
--- a/dlls/msvcp100/cxx.h
+++ b/dlls/msvcp100/cxx.h
@@ -64,7 +64,9 @@
#endif /* _WIN64 */
-#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
+#ifndef __x86_64__
+
+#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
static const type_info name ## _type_info = { \
&MSVCP_type_info_vtable, \
NULL, \
@@ -73,7 +75,7 @@
\
static const rtti_base_descriptor name ## _rtti_base_descriptor = { \
&name ##_type_info, \
- base_classes, \
+ base_classes_no, \
{ 0, -1, 0}, \
64 \
}; \
@@ -96,7 +98,7 @@ static const rtti_base_array name ## _rtti_base_array = { \
static const rtti_object_hierarchy name ## _hierarchy = { \
0, \
0, \
- base_classes+1, \
+ base_classes_no+1, \
&name ## _rtti_base_array \
}; \
\
@@ -108,6 +110,74 @@ const rtti_object_locator name ## _rtti = { \
&name ## _hierarchy \
}
+#else
+
+#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
+ static const type_info name ## _type_info = { \
+ &MSVCP_type_info_vtable, \
+ NULL, \
+ mangled_name \
+ }; \
+\
+static rtti_base_descriptor name ## _rtti_base_descriptor = { \
+ 0xdeadbeef, \
+ base_classes_no, \
+ { 0, -1, 0}, \
+ 64 \
+}; \
+\
+static rtti_base_array name ## _rtti_base_array = { \
+ { \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ } \
+}; \
+\
+static rtti_object_hierarchy name ## _hierarchy = { \
+ 0, \
+ 0, \
+ base_classes_no+1, \
+ 0xdeadbeef \
+}; \
+\
+rtti_object_locator name ## _rtti = { \
+ 1, \
+ off, \
+ 0, \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef \
+};\
+\
+static void init_ ## name ## _rtti(char *base) \
+{ \
+ name ## _rtti_base_descriptor.type_descriptor = (char*)&name ## _type_info - base; \
+ name ## _rtti_base_array.bases[0] = (char*)&name ## _rtti_base_descriptor - base; \
+ name ## _rtti_base_array.bases[1] = (char*)cl1 - base; \
+ name ## _rtti_base_array.bases[2] = (char*)cl2 - base; \
+ name ## _rtti_base_array.bases[3] = (char*)cl3 - base; \
+ name ## _rtti_base_array.bases[4] = (char*)cl4 - base; \
+ name ## _rtti_base_array.bases[5] = (char*)cl5 - base; \
+ name ## _rtti_base_array.bases[6] = (char*)cl6 - base; \
+ name ## _rtti_base_array.bases[7] = (char*)cl7 - base; \
+ name ## _rtti_base_array.bases[8] = (char*)cl8 - base; \
+ name ## _rtti_base_array.bases[9] = (char*)cl9 - base; \
+ name ## _hierarchy.base_classes = (char*)&name ## _rtti_base_array - base; \
+ name ## _rtti.type_descriptor = (char*)&name ## _type_info - base; \
+ name ## _rtti.type_hierarchy = (char*)&name ## _hierarchy - base; \
+ name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
+}
+
+#endif
+
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, mangled_name)
#define DEFINE_RTTI_DATA1(name, off, cl1, mangled_name) \
@@ -191,6 +261,8 @@ typedef struct
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
+#ifndef __x86_64__
+
typedef struct _rtti_base_descriptor
{
const type_info *type_descriptor;
@@ -220,3 +292,38 @@ typedef struct _rtti_object_locator
const type_info *type_descriptor;
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
+
+#else
+
+typedef struct
+{
+ unsigned int type_descriptor;
+ int num_base_classes;
+ this_ptr_offsets offsets; /* offsets for computing the this pointer */
+ unsigned int attributes;
+} rtti_base_descriptor;
+
+typedef struct
+{
+ unsigned int bases[10]; /* First element is the class itself */
+} rtti_base_array;
+
+typedef struct
+{
+ unsigned int signature;
+ unsigned int attributes;
+ int array_len; /* Size of the array pointed to by 'base_classes' */
+ unsigned int base_classes;
+} rtti_object_hierarchy;
+
+typedef struct
+{
+ unsigned int signature;
+ int base_class_offset;
+ unsigned int flags;
+ unsigned int type_descriptor;
+ unsigned int type_hierarchy;
+ unsigned int object_locator;
+} rtti_object_locator;
+
+#endif
diff --git a/dlls/msvcp100/exception.c b/dlls/msvcp100/exception.c
index a81fb54..55b7cd2 100644
--- a/dlls/msvcp100/exception.c
+++ b/dlls/msvcp100/exception.c
@@ -750,3 +750,18 @@ void throw_exception(exception_type et, const char *str)
}
}
}
+
+void init_exception(void *base)
+{
+#ifdef __x86_64__
+ init_type_info_rtti(base);
+ init_exception_rtti(base);
+ init_bad_alloc_rtti(base);
+ init_logic_error_rtti(base);
+ init_length_error_rtti(base);
+ init_out_of_range_rtti(base);
+ init_invalid_argument_rtti(base);
+ init_runtime_error_rtti(base);
+ init_failure_rtti(base);
+#endif
+}
diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c
index 5889d57..b41bc19 100644
--- a/dlls/msvcp100/ios.c
+++ b/dlls/msvcp100/ios.c
@@ -12343,8 +12343,53 @@ struct {
/* ?_Ptr_wclog at std@@3PEAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at EA */
basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
-void init_io(void)
-{
+void init_io(void *base)
+{
+#ifdef __x86_64__
+ init_iosb_rtti(base);
+ init_ios_base_rtti(base);
+ init_basic_ios_char_rtti(base);
+ init_basic_ios_wchar_rtti(base);
+ init_basic_ios_short_rtti(base);
+ init_basic_streambuf_char_rtti(base);
+ init_basic_streambuf_wchar_rtti(base);
+ init_basic_streambuf_short_rtti(base);
+ init_basic_filebuf_char_rtti(base);
+ init_basic_filebuf_wchar_rtti(base);
+ init_basic_filebuf_short_rtti(base);
+ init_basic_stringbuf_char_rtti(base);
+ init_basic_stringbuf_wchar_rtti(base);
+ init_basic_stringbuf_short_rtti(base);
+ init_basic_ostream_char_rtti(base);
+ init_basic_ostream_wchar_rtti(base);
+ init_basic_ostream_short_rtti(base);
+ init_basic_istream_char_rtti(base);
+ init_basic_istream_wchar_rtti(base);
+ init_basic_istream_short_rtti(base);
+ init_basic_iostream_char_rtti(base);
+ init_basic_iostream_wchar_rtti(base);
+ init_basic_iostream_short_rtti(base);
+ init_basic_ofstream_char_rtti(base);
+ init_basic_ofstream_wchar_rtti(base);
+ init_basic_ofstream_short_rtti(base);
+ init_basic_ifstream_char_rtti(base);
+ init_basic_ifstream_wchar_rtti(base);
+ init_basic_ifstream_short_rtti(base);
+ init_basic_fstream_char_rtti(base);
+ init_basic_fstream_wchar_rtti(base);
+ init_basic_fstream_short_rtti(base);
+ init_basic_ostringstream_char_rtti(base);
+ init_basic_ostringstream_wchar_rtti(base);
+ init_basic_ostringstream_short_rtti(base);
+ init_basic_istringstream_char_rtti(base);
+ init_basic_istringstream_wchar_rtti(base);
+ init_basic_istringstream_short_rtti(base);
+ init_basic_stringstream_char_rtti(base);
+ init_basic_stringstream_wchar_rtti(base);
+ init_basic_stringstream_short_rtti(base);
+ init_strstreambuf_rtti(base);
+#endif
+
basic_filebuf_char_ctor_file(&filebuf_char_stdin, stdin);
basic_istream_char_ctor(&cin.obj, &filebuf_char_stdin.base, FALSE/*FIXME*/, TRUE);
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c
index 55b3134..e1abed8 100644
--- a/dlls/msvcp100/locale.c
+++ b/dlls/msvcp100/locale.c
@@ -8582,6 +8582,33 @@ void __asm_dummy_vtables(void) {
}
#endif
+void init_locale(void *base)
+{
+#ifdef __x86_64__
+ init_locale_facet_rtti(base);
+ init_collate_char_rtti(base);
+ init_collate_wchar_rtti(base);
+ init_collate_short_rtti(base);
+ init_ctype_base_rtti(base);
+ init_ctype_char_rtti(base);
+ init_ctype_wchar_rtti(base);
+ init_ctype_short_rtti(base);
+ init_codecvt_base_rtti(base);
+ init_codecvt_char_rtti(base);
+ init_codecvt_wchar_rtti(base);
+ init_codecvt_short_rtti(base);
+ init_numpunct_char_rtti(base);
+ init_numpunct_wchar_rtti(base);
+ init_numpunct_short_rtti(base);
+ init_num_get_char_rtti(base);
+ init_num_get_wchar_rtti(base);
+ init_num_get_short_rtti(base);
+ init_num_put_char_rtti(base);
+ init_num_put_wchar_rtti(base);
+ init_num_put_short_rtti(base);
+#endif
+}
+
void free_locale(void)
{
facets_elem *iter, *safe;
diff --git a/dlls/msvcp100/msvcp.h b/dlls/msvcp100/msvcp.h
index f43982f..733b653 100644
--- a/dlls/msvcp100/msvcp.h
+++ b/dlls/msvcp100/msvcp.h
@@ -464,5 +464,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_uint64(const num_put*, o
ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_bool(const num_put*, ostreambuf_iterator_wchar*,
ostreambuf_iterator_wchar, ios_base*, wchar_t, MSVCP_bool);
-void init_io(void);
+void init_exception(void*);
+void init_locale(void*);
+void init_io(void*);
void free_io(void);
diff --git a/dlls/msvcp100/msvcp100.c b/dlls/msvcp100/msvcp100.c
index 60c2c8d..4238a24 100644
--- a/dlls/msvcp100/msvcp100.c
+++ b/dlls/msvcp100/msvcp100.c
@@ -113,7 +113,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_ATTACH:
init_cxx_funcs();
init_lockit();
- init_io();
+ init_exception(hinstDLL);
+ init_locale(hinstDLL);
+ init_io(hinstDLL);
break;
case DLL_PROCESS_DETACH:
free_io();
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcrt: Fixed RTTI structure on 64-bit systems.
Message-ID:
Module: wine
Branch: master
Commit: 8060752c09fd8794986f9fe3114513d78a36f903
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8060752c09fd8794986f9fe3114513d78a36f903
Author: Piotr Caban
Date: Fri Sep 7 11:01:17 2012 +0200
msvcrt: Fixed RTTI structure on 64-bit systems.
---
dlls/msvcrt/cpp.c | 128 +++++++++++++++++---------------------------------
dlls/msvcrt/cxx.h | 114 +++++++++++++++++++++++++++++++++++++++++++--
dlls/msvcrt/main.c | 1 +
dlls/msvcrt/msvcrt.h | 1 +
4 files changed, 156 insertions(+), 88 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=8060752c09fd8794986f9fe3114513d78a36f903
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcp90: Pass RTTI base pointer from DllMain.
Message-ID:
Module: wine
Branch: master
Commit: d161abb9b37111088b8ab5d342f814af221e5934
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d161abb9b37111088b8ab5d342f814af221e5934
Author: Piotr Caban
Date: Fri Sep 7 11:01:35 2012 +0200
msvcp90: Pass RTTI base pointer from DllMain.
---
dlls/msvcp90/exception.c | 3 +--
dlls/msvcp90/ios.c | 3 +--
dlls/msvcp90/locale.c | 3 +--
dlls/msvcp90/msvcp90.h | 6 +++---
dlls/msvcp90/msvcp90_main.c | 6 +++---
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c
index 7202a25..6aa3c0d 100644
--- a/dlls/msvcp90/exception.c
+++ b/dlls/msvcp90/exception.c
@@ -751,10 +751,9 @@ void throw_exception(exception_type et, const char *str)
}
}
-void init_exception(void)
+void init_exception(void *base)
{
#ifdef __x86_64__
- void *base = GetModuleHandleA("msvcp90.dll");
init_type_info_rtti(base);
init_exception_rtti(base);
init_bad_alloc_rtti(base);
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index e5d7233..164efcd 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -12921,10 +12921,9 @@ struct {
/* ?_Ptr_wclog at std@@3PEAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at EA */
basic_ostream_wchar *_Ptr_wclog = &wclog.obj;
-void init_io(void)
+void init_io(void *base)
{
#ifdef __x86_64__
- void *base = GetModuleHandleA("msvcp90.dll");
init_iosb_rtti(base);
init_ios_base_rtti(base);
init_basic_ios_char_rtti(base);
diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index f5a4534..ddf1424 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -8739,10 +8739,9 @@ void __asm_dummy_vtables(void) {
}
#endif
-void init_locale(void)
+void init_locale(void *base)
{
#ifdef __x86_64__
- void *base = GetModuleHandleA("msvcp90.dll");
init_locale_facet_rtti(base);
init_collate_char_rtti(base);
init_collate_wchar_rtti(base);
diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h
index 84e39c5..1108591 100644
--- a/dlls/msvcp90/msvcp90.h
+++ b/dlls/msvcp90/msvcp90.h
@@ -463,7 +463,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_uint64(const num_put*, o
ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_bool(const num_put*, ostreambuf_iterator_wchar*,
ostreambuf_iterator_wchar, ios_base*, wchar_t, MSVCP_bool);
-void init_exception(void);
-void init_locale(void);
-void init_io(void);
+void init_exception(void*);
+void init_locale(void*);
+void init_io(void*);
void free_io(void);
diff --git a/dlls/msvcp90/msvcp90_main.c b/dlls/msvcp90/msvcp90_main.c
index 8d97c9d..31a2d82 100644
--- a/dlls/msvcp90/msvcp90_main.c
+++ b/dlls/msvcp90/msvcp90_main.c
@@ -90,9 +90,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_ATTACH:
init_cxx_funcs();
init_lockit();
- init_exception();
- init_locale();
- init_io();
+ init_exception(hinstDLL);
+ init_locale(hinstDLL);
+ init_io(hinstDLL);
break;
case DLL_PROCESS_DETACH:
free_io();
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcp90: Added std::flush(basic_ostream) implementation.
Message-ID:
Module: wine
Branch: master
Commit: f2a26313e1fe24bfac66349f3832c2ef5854d16f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f2a26313e1fe24bfac66349f3832c2ef5854d16f
Author: Piotr Caban
Date: Fri Sep 7 11:01:55 2012 +0200
msvcp90: Added std::flush(basic_ostream) implementation.
---
dlls/msvcp90/ios.c | 16 ++++++++++++++++
dlls/msvcp90/msvcp90.spec | 12 ++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 164efcd..7cf646b 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -5501,6 +5501,13 @@ basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this
return this;
}
+/* ?flush at std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AAV21@@Z */
+/* ?flush at std@@YAAEAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AEAV21@@Z */
+basic_ostream_char* __cdecl flush_ostream_char(basic_ostream_char *ostream)
+{
+ return basic_ostream_char_flush(ostream);
+}
+
/* ?_Osfx@?$basic_ostream at DU?$char_traits at D@std@@@std@@QAEXXZ */
/* ?_Osfx@?$basic_ostream at DU?$char_traits at D@std@@@std@@QEAAXXZ */
DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
@@ -6291,6 +6298,15 @@ basic_ostream_wchar* __thiscall basic_ostream_wchar_flush(basic_ostream_wchar *t
return this;
}
+/* ?flush at std@@YAAAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AAV21@@Z */
+/* ?flush at std@@YAAEAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AEAV21@@Z */
+/* ?flush at std@@YAAAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AAV21@@Z */
+/* ?flush at std@@YAAEAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AEAV21@@Z */
+basic_ostream_wchar* __cdecl flush_ostream_wchar(basic_ostream_wchar *ostream)
+{
+ return basic_ostream_wchar_flush(ostream);
+}
+
/* ?_Osfx@?$basic_ostream at _WU?$char_traits at _W@std@@@std@@QAEXXZ */
/* ?_Osfx@?$basic_ostream at _WU?$char_traits at _W@std@@@std@@QEAAXXZ */
/* ?_Osfx@?$basic_ostream at GU?$char_traits at G@std@@@std@@QAEXXZ */
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 680830f..a14225a 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -3953,12 +3953,12 @@
@ cdecl -arch=win64 ?flush@?$basic_ostream at GU?$char_traits at G@std@@@std@@QEAAAEAV12 at XZ(ptr) basic_ostream_wchar_flush
@ thiscall -arch=win32 ?flush@?$basic_ostream at _WU?$char_traits at _W@std@@@std@@QAEAAV12 at XZ(ptr) basic_ostream_wchar_flush
@ cdecl -arch=win64 ?flush@?$basic_ostream at _WU?$char_traits at _W@std@@@std@@QEAAAEAV12 at XZ(ptr) basic_ostream_wchar_flush
-@ stub -arch=win32 ?flush at std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AAV21@@Z
-@ stub -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AEAV21@@Z
-@ stub -arch=win32 ?flush at std@@YAAAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AAV21@@Z
-@ stub -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AEAV21@@Z
-@ stub -arch=win32 ?flush at std@@YAAAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AAV21@@Z
-@ stub -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AEAV21@@Z
+@ cdecl -arch=win32 ?flush at std@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AAV21@@Z(ptr) flush_ostream_char
+@ cdecl -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at DU?$char_traits at D@std@@@1 at AEAV21@@Z(ptr) flush_ostream_char
+@ cdecl -arch=win32 ?flush at std@@YAAAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AAV21@@Z(ptr) flush_ostream_wchar
+@ cdecl -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at GU?$char_traits at G@std@@@1 at AEAV21@@Z(ptr) flush_ostream_wchar
+@ cdecl -arch=win32 ?flush at std@@YAAAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AAV21@@Z(ptr) flush_ostream_wchar
+@ cdecl -arch=win64 ?flush at std@@YAAEAV?$basic_ostream at _WU?$char_traits at _W@std@@@1 at AEAV21@@Z(ptr) flush_ostream_wchar
@ stub -arch=win32 ?frac_digits@?$_Mpunct at D@std@@QBEHXZ
@ stub -arch=win64 ?frac_digits@?$_Mpunct at D@std@@QEBAHXZ
@ stub -arch=win32 ?frac_digits@?$_Mpunct at G@std@@QBEHXZ
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Piotr Caban : msvcp: Sync spec files and implementations.
Message-ID:
Module: wine
Branch: master
Commit: 789565362d7a7888ba39a76e200c801c7953ed93
URL: http://source.winehq.org/git/wine.git/?a=commit;h=789565362d7a7888ba39a76e200c801c7953ed93
Author: Piotr Caban
Date: Fri Sep 7 11:02:17 2012 +0200
msvcp: Sync spec files and implementations.
---
dlls/msvcp100/ios.c | 16 ++++++++++++++++
dlls/msvcp100/msvcp100.spec | 12 ++++++------
dlls/msvcp70/msvcp70.spec | 12 ++++++------
dlls/msvcp71/msvcp71.spec | 12 ++++++------
dlls/msvcp80/msvcp80.spec | 12 ++++++------
5 files changed, 40 insertions(+), 24 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=789565362d7a7888ba39a76e200c801c7953ed93
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: James Eder : include/winternl.h: Fix CPU_FEATURE_3DNOW bit mask.
Message-ID:
Module: wine
Branch: master
Commit: b97a07bc0721f3c6c7308e365e12c15c0f25237a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b97a07bc0721f3c6c7308e365e12c15c0f25237a
Author: James Eder
Date: Thu Sep 6 09:23:13 2012 -0600
include/winternl.h: Fix CPU_FEATURE_3DNOW bit mask.
---
include/winternl.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/include/winternl.h b/include/winternl.h
index bcf18f5..79078f0 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1146,8 +1146,7 @@ typedef struct _SYSTEM_CPU_INFORMATION {
#define CPU_FEATURE_FXSR 0x00000800 /* FXSAVE and FXSTORE instructions */
#define CPU_FEATURE_SEP 0x00001000 /* SYSENTER and SYSEXIT instructions */
#define CPU_FEATURE_SSE 0x00002000 /* SSE extensions (ext. MMX) */
-#define CPU_FEATURE_3DNOW 0x00008000 /* 3DNOW instructions available
- (FIXME: needs to be confirmed) */
+#define CPU_FEATURE_3DNOW 0x00004000 /* 3DNOW instructions available */
#define CPU_FEATURE_SSE2 0x00010000 /* SSE2 extensions (XMMI64) */
#define CPU_FEATURE_DS 0x00020000 /* Debug Store */
#define CPU_FEATURE_HTT 0x00040000 /* Hyper Threading Technology */
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: James Eder : kernel32: Use PROCESSOR_FEATURE_MAX in
IsProcessorFeaturePresent.
Message-ID:
Module: wine
Branch: master
Commit: 7e8a5490bd0da9dc0586e8438671380dfc3fc359
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7e8a5490bd0da9dc0586e8438671380dfc3fc359
Author: James Eder
Date: Thu Sep 6 09:23:14 2012 -0600
kernel32: Use PROCESSOR_FEATURE_MAX in IsProcessorFeaturePresent.
---
dlls/kernel32/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index 996d776..0860362 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -212,7 +212,7 @@ VOID WINAPI GetNativeSystemInfo(
BOOL WINAPI IsProcessorFeaturePresent (
DWORD feature /* [in] Feature number, (PF_ constants from "winnt.h") */)
{
- if (feature < 64)
+ if (feature < PROCESSOR_FEATURE_MAX)
return SHARED_DATA->ProcessorFeatures[feature];
else
return FALSE;
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: James Eder : kernel32: Remove outdated comment.
Message-ID:
Module: wine
Branch: master
Commit: 10ff9b4f13a42e292e3f775ef58aa356c41382ca
URL: http://source.winehq.org/git/wine.git/?a=commit;h=10ff9b4f13a42e292e3f775ef58aa356c41382ca
Author: James Eder
Date: Thu Sep 6 09:23:15 2012 -0600
kernel32: Remove outdated comment.
---
dlls/kernel32/cpu.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index 0860362..333e402 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -99,12 +99,6 @@ BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
*
* RETURNS
* Nothing.
- *
- * NOTES
- * On the first call it creates cached values, so it doesn't have to determine
- * them repeatedly. On Linux, the "/proc/cpuinfo" special file is used.
- *
- * It also creates a cached flag array for IsProcessorFeaturePresent().
*/
VOID WINAPI GetSystemInfo(
LPSYSTEM_INFO si /* [out] Destination for system information, may not be NULL */)
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Jiang Yike : wined3d: Add AMD Radeon HD 7700 series and HD 7800
series graphics cards.
Message-ID:
Module: wine
Branch: master
Commit: a308bde74aadaba2a6b742faf2a34b6bbbb3bf1e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a308bde74aadaba2a6b742faf2a34b6bbbb3bf1e
Author: Jiang Yike
Date: Fri Sep 7 06:48:00 2012 +0800
wined3d: Add AMD Radeon HD 7700 series and HD 7800 series graphics cards.
---
dlls/wined3d/directx.c | 6 ++++++
dlls/wined3d/wined3d_private.h | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 58397e9..39083eb 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1141,6 +1141,8 @@ static const struct gpu_description gpu_description_table[] =
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6700, "AMD Radeon HD 6700 Series", DRIVER_AMD_R600, 1024},
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6800, "AMD Radeon HD 6800 Series", DRIVER_AMD_R600, 1024},
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD6900, "AMD Radeon HD 6900 Series", DRIVER_AMD_R600, 2048},
+ {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7700, "AMD Radeon HD 7700 Series", DRIVER_AMD_R600, 1024},
+ {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7800, "AMD Radeon HD 7800 Series", DRIVER_AMD_R600, 2048},
{HW_VENDOR_AMD, CARD_AMD_RADEON_HD7900, "AMD Radeon HD 7900 Series", DRIVER_AMD_R600, 2048},
/* Intel cards */
{HW_VENDOR_INTEL, CARD_INTEL_830M, "Intel(R) 82830M Graphics Controller", DRIVER_INTEL_GMA800, 32 },
@@ -1699,6 +1701,8 @@ static enum wined3d_pci_device select_card_amd_binary(const struct wined3d_gl_in
{
/* Southern Islands */
{"HD 7900", CARD_AMD_RADEON_HD7900},
+ {"HD 7800", CARD_AMD_RADEON_HD7800},
+ {"HD 7700", CARD_AMD_RADEON_HD7700},
/* Northern Islands */
{"HD 6900", CARD_AMD_RADEON_HD6900},
{"HD 6800", CARD_AMD_RADEON_HD6800},
@@ -1908,6 +1912,8 @@ static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info
{
/* Southern Islands */
{"TAHITI", CARD_AMD_RADEON_HD7900},
+ {"PITCAIRN", CARD_AMD_RADEON_HD7800},
+ {"CAPE VERDE", CARD_AMD_RADEON_HD7700},
/* Northern Islands */
{"CAYMAN", CARD_AMD_RADEON_HD6900},
{"BARTS", CARD_AMD_RADEON_HD6800},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ead1a49..bd5c5e2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1333,6 +1333,8 @@ enum wined3d_pci_device
CARD_AMD_RADEON_HD6700 = 0x68ba,
CARD_AMD_RADEON_HD6800 = 0x6739,
CARD_AMD_RADEON_HD6900 = 0x6719,
+ CARD_AMD_RADEON_HD7700 = 0x683d,
+ CARD_AMD_RADEON_HD7800 = 0x6819,
CARD_AMD_RADEON_HD7900 = 0x679a,
CARD_NVIDIA_RIVA_128 = 0x0018,
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Qian Hong : gdi32/tests: Added font name tests on English locale.
Message-ID:
Module: wine
Branch: master
Commit: 180185d890b6df54ab38f539fd4eedef35624029
URL: http://source.winehq.org/git/wine.git/?a=commit;h=180185d890b6df54ab38f539fd4eedef35624029
Author: Qian Hong
Date: Fri Sep 7 18:39:51 2012 +0800
gdi32/tests: Added font name tests on English locale.
---
dlls/gdi32/tests/font.c | 157 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 151 insertions(+), 6 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index d14160b..d5126a0 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2056,6 +2056,12 @@ struct enum_font_data
LOGFONT lf[MAX_ENUM_FONTS];
};
+struct enum_fullname_data
+{
+ int total;
+ ENUMLOGFONT elf[MAX_ENUM_FONTS];
+};
+
struct enum_font_dataW
{
int total;
@@ -2386,6 +2392,20 @@ static INT CALLBACK enum_font_data_proc(const LOGFONT *lf, const TEXTMETRIC *ntm
return 1;
}
+static INT CALLBACK enum_fullname_data_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam)
+{
+ struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam;
+
+ if (type != TRUETYPE_FONTTYPE) return 1;
+
+ if (efnd->total < MAX_ENUM_FONTS)
+ efnd->elf[efnd->total++] = *(ENUMLOGFONT*)lf;
+ else
+ trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS);
+
+ return 1;
+}
+
static void test_EnumFontFamiliesEx_default_charset(void)
{
struct enum_font_data efd;
@@ -2759,9 +2779,12 @@ end:
#define TT_PLATFORM_MICROSOFT 3
#define TT_MS_ID_UNICODE_CS 1
#define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409
+#define TT_NAME_ID_FONT_FAMILY 1
+#define TT_NAME_ID_FONT_SUBFAMILY 2
+#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
-static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, char *out_buf, SIZE_T out_size)
+static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size)
{
struct sfnt_name_header
{
@@ -3977,11 +4000,13 @@ static BOOL is_font_installed_fullname(const char *family, const char *fullname)
static void test_fullname(void)
{
static const char *TestName[] = {"Lucida Sans Demibold Roman", "Lucida Sans Italic", "Lucida Sans Regular"};
- char buf[LF_FULLFACESIZE];
+ WCHAR bufW[LF_FULLFACESIZE];
+ char bufA[LF_FULLFACESIZE];
HFONT hfont, of;
LOGFONTA lf;
HDC hdc;
int i;
+ DWORD ret;
hdc = CreateCompatibleDC(0);
ok(hdc != NULL, "CreateCompatibleDC failed\n");
@@ -4008,16 +4033,135 @@ static void test_fullname(void)
ok(hfont != 0, "CreateFontIndirectA failed\n");
of = SelectObject(hdc, hfont);
- buf[0] = 0;
- ok(get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, buf, sizeof(buf)),
- "face full name could not be read\n");
- ok(!lstrcmpA(buf, TestName[i]), "font full names don't match: %s != %s\n", TestName[i], buf);
+ bufW[0] = 0;
+ bufA[0] = 0;
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, sizeof(bufW));
+ ok(ret, "face full name could not be read\n");
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, sizeof(bufW), NULL, FALSE);
+ ok(!lstrcmpA(bufA, TestName[i]), "font full names don't match: %s != %s\n", TestName[i], bufA);
+ SelectObject(hdc, of);
+ DeleteObject(hfont);
+ }
+ DeleteDC(hdc);
+}
+
+static void test_fullname2_helper(const char *Family)
+{
+ char *FamilyName, *FaceName, *StyleName, *otmStr;
+ struct enum_fullname_data efnd;
+ WCHAR *bufW;
+ char *bufA;
+ HFONT hfont, of;
+ LOGFONTA lf;
+ HDC hdc;
+ int i;
+ DWORD otm_size, ret, buf_size;
+ OUTLINETEXTMETRICA *otm;
+ LCID lcid = GetSystemDefaultLangID();
+
+ if (lcid != TT_MS_LANGID_ENGLISH_UNITED_STATES)
+ {
+ skip("Skip test: LCID = %d\n", lcid);
+ return;
+ }
+
+ hdc = CreateCompatibleDC(0);
+ ok(hdc != NULL, "CreateCompatibleDC failed\n");
+
+ memset(&lf, 0, sizeof(lf));
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lf.lfHeight = 16;
+ lf.lfWidth = 16;
+ lf.lfQuality = DEFAULT_QUALITY;
+ lf.lfItalic = FALSE;
+ lf.lfWeight = FW_DONTCARE;
+ lstrcpy(lf.lfFaceName, Family);
+ efnd.total = 0;
+ EnumFontFamiliesExA(hdc, &lf, enum_fullname_data_proc, (LPARAM)&efnd, 0);
+ if (efnd.total == 0)
+ skip("%s is not installed\n", lf.lfFaceName);
+
+ for (i = 0; i < efnd.total; i++)
+ {
+ FamilyName = (char *)efnd.elf[i].elfLogFont.lfFaceName;
+ FaceName = (char *)efnd.elf[i].elfFullName;
+ StyleName = (char *)efnd.elf[i].elfStyle;
+
+ trace("Checking font %s:\nFamilyName: %s; FaceName: %s; StyleName: %s\n", Family, FamilyName, FaceName, StyleName);
+
+ lstrcpyA(lf.lfFaceName, FaceName);
+ hfont = CreateFontIndirectA(&lf);
+ ok(hfont != 0, "CreateFontIndirectA failed\n");
+
+ of = SelectObject(hdc, hfont);
+ buf_size = GetFontData(hdc, MS_NAME_TAG, 0, NULL, 0);
+ ok(buf_size != GDI_ERROR, "no name table found\n");
+ if (buf_size == GDI_ERROR) continue;
+
+ bufW = HeapAlloc(GetProcessHeap(), 0, buf_size);
+ bufA = HeapAlloc(GetProcessHeap(), 0, buf_size);
+
+ otm_size = GetOutlineTextMetricsA(hdc, 0, NULL);
+ otm = HeapAlloc(GetProcessHeap(), 0, otm_size);
+ memset(otm, 0, otm_size);
+ ret = GetOutlineTextMetrics(hdc, otm_size, otm);
+ ok(ret != 0, "GetOutlineTextMetrics fails!\n");
+ if (ret == 0) continue;
+
+ bufW[0] = 0;
+ bufA[0] = 0;
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_FAMILY, bufW, buf_size);
+ ok(ret, "FAMILY (family name) could not be read\n");
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
+ ok(!lstrcmpA(FamilyName, bufA), "font family names don't match: returned %s, expect %s\n", FamilyName, bufA);
+ otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFamilyName;
+ ok(!lstrcmpA(FamilyName, otmStr), "FamilyName %s doesn't match otmpFamilyName %s\n", FamilyName, otmStr);
+
+ bufW[0] = 0;
+ bufA[0] = 0;
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, buf_size);
+ ok(ret, "FULL_NAME (face name) could not be read\n");
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
+ ok(!lstrcmpA(FaceName, bufA), "font face names don't match: returned %s, expect %s\n", FaceName, bufA);
+ otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFaceName;
+ if(!lstrcmpA(FaceName, "Lucida Sans Regular"))
+ todo_wine ok(!lstrcmpA(FaceName, otmStr), "FaceName %s doesn't match otmpFaceName %s\n", FaceName, otmStr);
+ else
+ ok(!lstrcmpA(FaceName, otmStr), "FaceName %s doesn't match otmpFaceName %s\n", FaceName, otmStr);
+
+ bufW[0] = 0;
+ bufA[0] = 0;
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_SUBFAMILY, bufW, buf_size);
+ ok(ret, "SUBFAMILY (style name) could not be read\n");
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
+ ok(!lstrcmpA(StyleName, bufA), "style names don't match: returned %s, expect %s\n", FaceName, bufA);
+ otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpStyleName;
+ ok(!lstrcmpA(StyleName, otmStr), "StyleName %s doesn't match otmpStyleName %s\n", StyleName, otmStr);
+
+ bufW[0] = 0;
+ bufA[0] = 0;
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_UNIQUE_ID, bufW, buf_size);
+ ok(ret, "UNIQUE_ID (full name) could not be read\n");
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
+ otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFullName;
+ todo_wine ok(!lstrcmpA(otmStr, bufA), "UNIQUE ID (full name) doesn't match: returned %s, expect %s\n", otmStr, bufA);
+
SelectObject(hdc, of);
DeleteObject(hfont);
+
+ HeapFree(GetProcessHeap(), 0, otm);
+ HeapFree(GetProcessHeap(), 0, bufW);
+ HeapFree(GetProcessHeap(), 0, bufA);
}
DeleteDC(hdc);
}
+static void test_fullname2(void)
+{
+ test_fullname2_helper("Lucida Sans");
+}
+
static BOOL write_ttf_file(const char *fontname, char *tmp_name)
{
char tmp_path[MAX_PATH];
@@ -4531,6 +4675,7 @@ START_TEST(font)
test_CreateFontIndirectEx();
test_oemcharset();
test_fullname();
+ test_fullname2();
test_east_asian_font_selection();
/* These tests should be last test until RemoveFontResource
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Qian Hong : gdi32: Read otmpFaceName from TT_NAME_ID_FULL_NAME.
Message-ID:
Module: wine
Branch: master
Commit: abc8f2c6c270a8f6bce8c5c1f0fc5b5773dad4a9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=abc8f2c6c270a8f6bce8c5c1f0fc5b5773dad4a9
Author: Qian Hong
Date: Fri Sep 7 18:40:12 2012 +0800
gdi32: Read otmpFaceName from TT_NAME_ID_FULL_NAME.
---
dlls/gdi32/freetype.c | 89 ++++++++++++++++------------------------------
dlls/gdi32/tests/font.c | 5 +--
2 files changed, 32 insertions(+), 62 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 8222a18..9d3d4c4 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -2624,13 +2624,12 @@ static void update_reg_entries(void)
{
HKEY winnt_key = 0, win9x_key = 0, external_key = 0;
LPWSTR valueW;
- DWORD len, len_fam;
+ DWORD len;
Family *family;
Face *face;
struct list *family_elem_ptr, *face_elem_ptr;
WCHAR *file;
static const WCHAR TrueType[] = {' ','(','T','r','u','e','T','y','p','e',')','\0'};
- static const WCHAR spaceW[] = {' ', '\0'};
char *path;
if(RegCreateKeyExW(HKEY_LOCAL_MACHINE, winnt_font_reg_key,
@@ -2655,20 +2654,22 @@ static void update_reg_entries(void)
LIST_FOR_EACH(family_elem_ptr, &font_list) {
family = LIST_ENTRY(family_elem_ptr, Family, entry);
- len_fam = strlenW(family->FamilyName) + sizeof(TrueType) / sizeof(WCHAR) + 1;
LIST_FOR_EACH(face_elem_ptr, &family->faces) {
face = LIST_ENTRY(face_elem_ptr, Face, entry);
if(!face->external) continue;
- len = len_fam;
- if (!(face->ntmFlags & NTM_REGULAR))
- len = len_fam + strlenW(face->StyleName) + 1;
- valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
- strcpyW(valueW, family->FamilyName);
- if(len != len_fam) {
- strcatW(valueW, spaceW);
- strcatW(valueW, face->StyleName);
+
+ if(face->FullName)
+ {
+ len = strlenW(face->FullName) + sizeof(TrueType) / sizeof(WCHAR) + 1;
+ valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ strcpyW(valueW, face->FullName);
+ }
+ else
+ {
+ len = strlenW(family->FamilyName) + sizeof(TrueType) / sizeof(WCHAR) + 1;
+ valueW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ strcpyW(valueW, family->FamilyName);
}
- strcatW(valueW, TrueType);
file = wine_get_dos_file_name(face->file);
if(file)
@@ -5078,7 +5079,7 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
(WCHAR*)((char*)font->potm + (ULONG_PTR)font->potm->otmpFamilyName),
LF_FACESIZE);
lstrcpynW(pelf->elfFullName,
- (WCHAR*)((char*)font->potm + (ULONG_PTR)font->potm->otmpFullName),
+ (WCHAR*)((char*)font->potm + (ULONG_PTR)font->potm->otmpFaceName),
LF_FULLFACESIZE);
lstrcpynW(pelf->elfStyle,
(WCHAR*)((char*)font->potm + (ULONG_PTR)font->potm->otmpStyleName),
@@ -5138,15 +5139,6 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
free_font(font);
}
-static void create_full_name(WCHAR *full_name, const WCHAR *family_name, const WCHAR *style_name)
-{
- static const WCHAR spaceW[] = { ' ', 0 };
-
- strcpyW(full_name, family_name);
- strcatW(full_name, spaceW);
- strcatW(full_name, style_name);
-}
-
static BOOL family_matches(Family *family, const LOGFONTW *lf)
{
const struct list *face_list, *face_elem_ptr;
@@ -5156,18 +5148,9 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
face_list = get_face_list_from_family(family);
LIST_FOR_EACH(face_elem_ptr, face_list)
{
- WCHAR full_family_name[LF_FULLFACESIZE];
Face *face = LIST_ENTRY(face_elem_ptr, Face, entry);
- if (strlenW(family->FamilyName) + strlenW(face->StyleName) + 2 > LF_FULLFACESIZE)
- {
- FIXME("Length of %s + %s + 2 is longer than LF_FULLFACESIZE\n",
- debugstr_w(family->FamilyName), debugstr_w(face->StyleName));
- continue;
- }
-
- create_full_name(full_family_name, family->FamilyName, face->StyleName);
- if (!strcmpiW(lf->lfFaceName, full_family_name)) return TRUE;
+ if (face->FullName && !strcmpiW(lf->lfFaceName, face->FullName)) return TRUE;
}
return FALSE;
@@ -5175,19 +5158,9 @@ static BOOL family_matches(Family *family, const LOGFONTW *lf)
static BOOL face_matches(const WCHAR *family_name, Face *face, const LOGFONTW *lf)
{
- WCHAR full_family_name[LF_FULLFACESIZE];
-
if (!strcmpiW(lf->lfFaceName, family_name)) return TRUE;
- if (strlenW(family_name) + strlenW(face->StyleName) + 2 > LF_FULLFACESIZE)
- {
- FIXME("Length of %s + %s + 2 is longer than LF_FULLFACESIZE\n",
- debugstr_w(family_name), debugstr_w(face->StyleName));
- return FALSE;
- }
-
- create_full_name(full_family_name, family_name, face->StyleName);
- return !strcmpiW(lf->lfFaceName, full_family_name);
+ return (face->FullName && !strcmpiW(lf->lfFaceName, face->FullName));
}
static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_charset_list *list,
@@ -5216,7 +5189,10 @@ static BOOL enum_face_charsets(const Family *family, Face *face, struct enum_cha
if (family != face->family)
{
strcpyW(elf.elfLogFont.lfFaceName, family->FamilyName);
- create_full_name(elf.elfFullName, family->FamilyName, face->StyleName);
+ if (face->FullName)
+ strcpyW(elf.elfFullName, face->FullName);
+ else
+ strcpyW(elf.elfFullName, family->FamilyName);
}
TRACE("enuming face %s full %s style %s charset = %d type %d script %s it %d weight %d ntmflags %08x\n",
debugstr_w(elf.elfLogFont.lfFaceName),
@@ -6552,12 +6528,12 @@ static BOOL get_outline_text_metrics(GdiFont *font)
{
BOOL ret = FALSE;
FT_Face ft_face = font->ft_face;
- UINT needed, lenfam, lensty;
+ UINT needed, lenfam, lensty, lenface;
TT_OS2 *pOS2;
TT_HoriHeader *pHori;
TT_Postscript *pPost;
FT_Fixed x_scale, y_scale;
- WCHAR *family_nameW, *style_nameW;
+ WCHAR *family_nameW, *style_nameW, *face_nameW;
static const WCHAR spaceW[] = {' ', '\0'};
char *cp;
INT ascent, descent;
@@ -6578,17 +6554,18 @@ static BOOL get_outline_text_metrics(GdiFont *font)
MultiByteToWideChar(CP_ACP, 0, ft_face->style_name, -1,
style_nameW, lensty/sizeof(WCHAR));
+ face_nameW = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
+ if (!face_nameW)
+ face_nameW = strdupW(font->name);
+ lenface = (strlenW(face_nameW) + 1) * sizeof(WCHAR);
+
/* These names should be read from the TT name table */
/* length of otmpFamilyName */
needed += lenfam;
/* length of otmpFaceName */
- if ((ft_face->style_flags & (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD)) == 0) {
- needed += lenfam; /* just the family name */
- } else {
- needed += lenfam + lensty; /* family + " " + style */
- }
+ needed += lenface;
/* length of otmpStyleName */
needed += lensty;
@@ -6837,13 +6814,8 @@ static BOOL get_outline_text_metrics(GdiFont *font)
strcpyW((WCHAR*)cp, style_nameW);
cp += lensty;
font->potm->otmpFaceName = (LPSTR)(cp - (char*)font->potm);
- strcpyW((WCHAR*)cp, family_nameW);
- if (ft_face->style_flags & (FT_STYLE_FLAG_ITALIC | FT_STYLE_FLAG_BOLD)) {
- strcatW((WCHAR*)cp, spaceW);
- strcatW((WCHAR*)cp, style_nameW);
- cp += lenfam + lensty;
- } else
- cp += lenfam;
+ strcpyW((WCHAR*)cp, face_nameW);
+ cp += lenface;
font->potm->otmpFullName = (LPSTR)(cp - (char*)font->potm);
strcpyW((WCHAR*)cp, family_nameW);
strcatW((WCHAR*)cp, spaceW);
@@ -6853,6 +6825,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
end:
HeapFree(GetProcessHeap(), 0, style_nameW);
HeapFree(GetProcessHeap(), 0, family_nameW);
+ HeapFree(GetProcessHeap(), 0, face_nameW);
return ret;
}
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index d5126a0..4a1532a 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4125,10 +4125,7 @@ static void test_fullname2_helper(const char *Family)
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
ok(!lstrcmpA(FaceName, bufA), "font face names don't match: returned %s, expect %s\n", FaceName, bufA);
otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFaceName;
- if(!lstrcmpA(FaceName, "Lucida Sans Regular"))
- todo_wine ok(!lstrcmpA(FaceName, otmStr), "FaceName %s doesn't match otmpFaceName %s\n", FaceName, otmStr);
- else
- ok(!lstrcmpA(FaceName, otmStr), "FaceName %s doesn't match otmpFaceName %s\n", FaceName, otmStr);
+ ok(!lstrcmpA(FaceName, otmStr), "FaceName %s doesn't match otmpFaceName %s\n", FaceName, otmStr);
bufW[0] = 0;
bufA[0] = 0;
From julliard at winehq.org Fri Sep 7 13:26:20 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:20 -0500
Subject: Qian Hong : gdi32: Read otmpFullName from TT_NAME_ID_UNIQUE_ID.
Message-ID:
Module: wine
Branch: master
Commit: 733aca30f4976a858d4e7a36628922f1eb898197
URL: http://source.winehq.org/git/wine.git/?a=commit;h=733aca30f4976a858d4e7a36628922f1eb898197
Author: Qian Hong
Date: Fri Sep 7 18:40:34 2012 +0800
gdi32: Read otmpFullName from TT_NAME_ID_UNIQUE_ID.
---
dlls/gdi32/freetype.c | 24 +++++++++++++++++-------
dlls/gdi32/tests/font.c | 2 +-
dlls/wineps.drv/download.c | 4 ++--
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 9d3d4c4..feca48a 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6528,13 +6528,12 @@ static BOOL get_outline_text_metrics(GdiFont *font)
{
BOOL ret = FALSE;
FT_Face ft_face = font->ft_face;
- UINT needed, lenfam, lensty, lenface;
+ UINT needed, lenfam, lensty, lenface, lenfull;
TT_OS2 *pOS2;
TT_HoriHeader *pHori;
TT_Postscript *pPost;
FT_Fixed x_scale, y_scale;
- WCHAR *family_nameW, *style_nameW, *face_nameW;
- static const WCHAR spaceW[] = {' ', '\0'};
+ WCHAR *family_nameW, *style_nameW, *face_nameW, *full_nameW;
char *cp;
INT ascent, descent;
@@ -6556,9 +6555,21 @@ static BOOL get_outline_text_metrics(GdiFont *font)
face_nameW = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
if (!face_nameW)
+ {
+ FIXME("failed to read face_nameW for font %s!\n", wine_dbgstr_w(font->name));
face_nameW = strdupW(font->name);
+ }
lenface = (strlenW(face_nameW) + 1) * sizeof(WCHAR);
+ full_nameW = get_face_name( ft_face, TT_NAME_ID_UNIQUE_ID, TT_MS_LANGID_ENGLISH_UNITED_STATES );
+ if (!full_nameW)
+ {
+ WCHAR fake_nameW[] = {'f','a','k','e',' ','n','a','m','e', 0};
+ FIXME("failed to read full_nameW for font %s!\n", wine_dbgstr_w(font->name));
+ full_nameW = strdupW(fake_nameW);
+ }
+ lenfull = (strlenW(full_nameW) + 1) * sizeof(WCHAR);
+
/* These names should be read from the TT name table */
/* length of otmpFamilyName */
@@ -6571,7 +6582,7 @@ static BOOL get_outline_text_metrics(GdiFont *font)
needed += lensty;
/* length of otmpFullName */
- needed += lenfam + lensty;
+ needed += lenfull;
x_scale = ft_face->size->metrics.x_scale;
@@ -6817,15 +6828,14 @@ static BOOL get_outline_text_metrics(GdiFont *font)
strcpyW((WCHAR*)cp, face_nameW);
cp += lenface;
font->potm->otmpFullName = (LPSTR)(cp - (char*)font->potm);
- strcpyW((WCHAR*)cp, family_nameW);
- strcatW((WCHAR*)cp, spaceW);
- strcatW((WCHAR*)cp, style_nameW);
+ strcpyW((WCHAR*)cp, full_nameW);
ret = TRUE;
end:
HeapFree(GetProcessHeap(), 0, style_nameW);
HeapFree(GetProcessHeap(), 0, family_nameW);
HeapFree(GetProcessHeap(), 0, face_nameW);
+ HeapFree(GetProcessHeap(), 0, full_nameW);
return ret;
}
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 4a1532a..10e015e 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4142,7 +4142,7 @@ static void test_fullname2_helper(const char *Family)
ok(ret, "UNIQUE_ID (full name) could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFullName;
- todo_wine ok(!lstrcmpA(otmStr, bufA), "UNIQUE ID (full name) doesn't match: returned %s, expect %s\n", otmStr, bufA);
+ ok(!lstrcmpA(otmStr, bufA), "UNIQUE ID (full name) doesn't match: returned %s, expect %s\n", otmStr, bufA);
SelectObject(hdc, of);
DeleteObject(hfont);
diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c
index 6b87172..fbd868c 100644
--- a/dlls/wineps.drv/download.c
+++ b/dlls/wineps.drv/download.c
@@ -118,9 +118,9 @@ static void get_download_name(PHYSDEV dev, LPOUTLINETEXTMETRICA potm, char **str
}
}
- len = strlen((char*)potm + (ptrdiff_t)potm->otmpFullName) + 1;
+ len = strlen((char*)potm + (ptrdiff_t)potm->otmpFaceName) + 1;
*str = HeapAlloc(GetProcessHeap(),0,len);
- strcpy(*str, (char*)potm + (ptrdiff_t)potm->otmpFullName);
+ strcpy(*str, (char*)potm + (ptrdiff_t)potm->otmpFaceName);
p = *str;
while((p = strchr(p, ' ')))
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Qian Hong : gdi32: Fixed family and face name on non English locale.
Message-ID:
Module: wine
Branch: master
Commit: 245308597ffbe1243169211ced5e6ffbcc55c1d5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=245308597ffbe1243169211ced5e6ffbcc55c1d5
Author: Qian Hong
Date: Fri Sep 7 18:41:02 2012 +0800
gdi32: Fixed family and face name on non English locale.
---
dlls/gdi32/freetype.c | 10 +++++++---
dlls/gdi32/tests/font.c | 31 +++++++++++++++++--------------
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index feca48a..20d6f9e 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1552,7 +1552,7 @@ static void get_family_names( FT_Face ft_face, WCHAR **name, WCHAR **english, BO
*english = get_face_name( ft_face, TT_NAME_ID_FONT_FAMILY, TT_MS_LANGID_ENGLISH_UNITED_STATES );
if (!*english) *english = towstr( CP_ACP, ft_face->family_name );
- *name = get_face_name( ft_face, TT_NAME_ID_FONT_FAMILY, GetUserDefaultLCID() );
+ *name = get_face_name( ft_face, TT_NAME_ID_FONT_FAMILY, GetSystemDefaultLCID() );
if (!*name)
{
*name = *english;
@@ -1715,7 +1715,9 @@ static Face *create_face( FT_Face ft_face, FT_Long face_index, const char *file,
My_FT_Bitmap_Size *size = (My_FT_Bitmap_Size *)ft_face->available_sizes;
face->StyleName = towstr( CP_ACP, ft_face->style_name );
- face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
+ face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, GetSystemDefaultLangID() );
+ if (!face->FullName)
+ face->FullName = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
if (file)
{
face->file = strdupA( file );
@@ -6553,7 +6555,9 @@ static BOOL get_outline_text_metrics(GdiFont *font)
MultiByteToWideChar(CP_ACP, 0, ft_face->style_name, -1,
style_nameW, lensty/sizeof(WCHAR));
- face_nameW = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
+ face_nameW = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, GetSystemDefaultLangID() );
+ if (!face_nameW)
+ face_nameW = get_face_name( ft_face, TT_NAME_ID_FULL_NAME, TT_MS_LANGID_ENGLISH_UNITED_STATES );
if (!face_nameW)
{
FIXME("failed to read face_nameW for font %s!\n", wine_dbgstr_w(font->name));
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 10e015e..26d88ae 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -2784,7 +2784,7 @@ end:
#define TT_NAME_ID_UNIQUE_ID 3
#define TT_NAME_ID_FULL_NAME 4
-static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size)
+static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size, LCID language_id)
{
struct sfnt_name_header
{
@@ -2841,7 +2841,7 @@ static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_
{
if (GET_BE_WORD(entry[i].platform_id) != TT_PLATFORM_MICROSOFT ||
GET_BE_WORD(entry[i].encoding_id) != TT_MS_ID_UNICODE_CS ||
- GET_BE_WORD(entry[i].language_id) != TT_MS_LANGID_ENGLISH_UNITED_STATES ||
+ GET_BE_WORD(entry[i].language_id) != language_id ||
GET_BE_WORD(entry[i].name_id) != name_id)
{
continue;
@@ -4035,7 +4035,7 @@ static void test_fullname(void)
of = SelectObject(hdc, hfont);
bufW[0] = 0;
bufA[0] = 0;
- ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, sizeof(bufW));
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, sizeof(bufW), TT_MS_LANGID_ENGLISH_UNITED_STATES);
ok(ret, "face full name could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, sizeof(bufW), NULL, FALSE);
ok(!lstrcmpA(bufA, TestName[i]), "font full names don't match: %s != %s\n", TestName[i], bufA);
@@ -4057,13 +4057,6 @@ static void test_fullname2_helper(const char *Family)
int i;
DWORD otm_size, ret, buf_size;
OUTLINETEXTMETRICA *otm;
- LCID lcid = GetSystemDefaultLangID();
-
- if (lcid != TT_MS_LANGID_ENGLISH_UNITED_STATES)
- {
- skip("Skip test: LCID = %d\n", lcid);
- return;
- }
hdc = CreateCompatibleDC(0);
ok(hdc != NULL, "CreateCompatibleDC failed\n");
@@ -4111,7 +4104,12 @@ static void test_fullname2_helper(const char *Family)
bufW[0] = 0;
bufA[0] = 0;
- ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_FAMILY, bufW, buf_size);
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_FAMILY, bufW, buf_size, GetSystemDefaultLangID());
+ if (!ret)
+ {
+ trace("no localized name found.\n");
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_FAMILY, bufW, buf_size, TT_MS_LANGID_ENGLISH_UNITED_STATES);
+ }
ok(ret, "FAMILY (family name) could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
ok(!lstrcmpA(FamilyName, bufA), "font family names don't match: returned %s, expect %s\n", FamilyName, bufA);
@@ -4120,7 +4118,12 @@ static void test_fullname2_helper(const char *Family)
bufW[0] = 0;
bufA[0] = 0;
- ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, buf_size);
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, buf_size, GetSystemDefaultLangID());
+ if (!ret)
+ {
+ trace("no localized name found.\n");
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, buf_size, TT_MS_LANGID_ENGLISH_UNITED_STATES);
+ }
ok(ret, "FULL_NAME (face name) could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
ok(!lstrcmpA(FaceName, bufA), "font face names don't match: returned %s, expect %s\n", FaceName, bufA);
@@ -4129,7 +4132,7 @@ static void test_fullname2_helper(const char *Family)
bufW[0] = 0;
bufA[0] = 0;
- ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_SUBFAMILY, bufW, buf_size);
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FONT_SUBFAMILY, bufW, buf_size, TT_MS_LANGID_ENGLISH_UNITED_STATES);
ok(ret, "SUBFAMILY (style name) could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
ok(!lstrcmpA(StyleName, bufA), "style names don't match: returned %s, expect %s\n", FaceName, bufA);
@@ -4138,7 +4141,7 @@ static void test_fullname2_helper(const char *Family)
bufW[0] = 0;
bufA[0] = 0;
- ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_UNIQUE_ID, bufW, buf_size);
+ ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_UNIQUE_ID, bufW, buf_size, TT_MS_LANGID_ENGLISH_UNITED_STATES);
ok(ret, "UNIQUE_ID (full name) could not be read\n");
WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, buf_size, NULL, FALSE);
otmStr = (LPSTR)otm + (UINT_PTR)otm->otmpFullName;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure for wglSetPixelFormat .
Message-ID:
Module: wine
Branch: master
Commit: ecc8559fe800df985b37afd6b1f2347c246e4039
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ecc8559fe800df985b37afd6b1f2347c246e4039
Author: Alexandre Julliard
Date: Fri Sep 7 15:06:19 2012 +0200
winex11: Get the current pixel format from the drawable structure for wglSetPixelFormat.
---
dlls/winex11.drv/opengl.c | 46 +++++++++++++++++++-------------------------
1 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 84651c0..00642ce 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1533,25 +1533,16 @@ static int glxdrv_wglGetPixelFormat( HDC hdc )
*/
static BOOL glxdrv_wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd )
{
- struct x11drv_escape_get_drawable escape;
const struct wgl_pixel_format *fmt;
- int value;
- HWND hwnd;
+ int value, prev = 0;
+ struct gl_drawable *gl;
+ HWND hwnd = WindowFromDC( hdc );
TRACE("(%p,%d,%p)\n", hdc, iPixelFormat, ppfd);
- escape.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code,
- sizeof(escape), (LPSTR)&escape ))
- return 0;
-
- if (escape.pixel_format) /* cannot change it if already set */
- return (escape.pixel_format == iPixelFormat);
-
- /* SetPixelFormat is not allowed on the X root_window e.g. GetDC(0) */
- if (escape.drawable == root_window)
+ if (!hwnd || hwnd == GetDesktopWindow())
{
- ERR("Invalid operation on root_window\n");
+ WARN( "not a proper window DC %p/%p\n", hdc, hwnd );
return FALSE;
}
@@ -1563,21 +1554,24 @@ static BOOL glxdrv_wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORM
}
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_DRAWABLE_TYPE, &value);
+ if (!(value & GLX_WINDOW_BIT))
+ {
+ WARN("Pixel format %d is not compatible for window rendering\n", iPixelFormat);
+ return FALSE;
+ }
- hwnd = WindowFromDC( hdc );
- if(hwnd) {
- if(!(value&GLX_WINDOW_BIT)) {
- WARN("Pixel format %d is not compatible for window rendering\n", iPixelFormat);
- return FALSE;
- }
+ EnterCriticalSection( &context_section );
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_drawable_context, (char **)&gl ))
+ prev = gl->pixel_format;
+ LeaveCriticalSection( &context_section );
- if(!SendMessageW(hwnd, WM_X11DRV_SET_WIN_FORMAT, fmt->fmt_id, 0)) {
- ERR("Couldn't set format of the window, returning failure\n");
- return FALSE;
- }
- /* physDev->current_pf will be set by the DCE update */
+ if (prev) return prev == iPixelFormat; /* cannot change it if already set */
+
+ if(!SendMessageW(hwnd, WM_X11DRV_SET_WIN_FORMAT, fmt->fmt_id, 0)) {
+ ERR("Couldn't set format of the window, returning failure\n");
+ return FALSE;
}
- else FIXME("called on a non-window object?\n");
+ /* physDev->current_pf will be set by the DCE update */
if (TRACE_ON(wgl)) {
int gl_test = 0;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Store a drawable structure also for
pbuffer contexts.
Message-ID:
Module: wine
Branch: master
Commit: 4df8f15ff9cefccf030fa5b92c4c53b0267fa29e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4df8f15ff9cefccf030fa5b92c4c53b0267fa29e
Author: Alexandre Julliard
Date: Fri Sep 7 15:23:15 2012 +0200
winex11: Store a drawable structure also for pbuffer contexts.
---
dlls/winex11.drv/opengl.c | 81 ++++++++++++++++++++++++++++----------------
1 files changed, 51 insertions(+), 30 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 00642ce..d5d3ca9 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -204,7 +204,9 @@ struct gl_drawable
};
/* X context to associate a struct gl_drawable to an hwnd */
-static XContext gl_drawable_context;
+static XContext gl_hwnd_context;
+/* X context to associate a struct gl_drawable to a pbuffer hdc */
+static XContext gl_pbuffer_context;
static const struct gdi_dc_funcs glxdrv_funcs;
@@ -592,7 +594,8 @@ static BOOL has_opengl(void)
ERR( "GLX extension is missing, disabling OpenGL.\n" );
goto failed;
}
- gl_drawable_context = XUniqueContext();
+ gl_hwnd_context = XUniqueContext();
+ gl_pbuffer_context = XUniqueContext();
/* In case of GLX you have direct and indirect rendering. Most of the time direct rendering is used
* as in general only that is hardware accelerated. In some cases like in case of remote X indirect
@@ -1160,7 +1163,7 @@ static void free_gl_drawable( struct gl_drawable *gl )
default:
break;
}
- XFree( gl->visual );
+ if (gl->visual) XFree( gl->visual );
HeapFree( GetProcessHeap(), 0, gl );
}
@@ -1275,9 +1278,9 @@ BOOL set_win_format( HWND hwnd, XID fbconfig_id )
XFlush( gdi_display );
EnterCriticalSection( &context_section );
- if (!XFindContext( gdi_display, (XID)hwnd, gl_drawable_context, (char **)&prev ))
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&prev ))
free_gl_drawable( prev );
- XSaveContext( gdi_display, (XID)hwnd, gl_drawable_context, (char *)gl );
+ XSaveContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char *)gl );
LeaveCriticalSection( &context_section );
/* force DCE invalidation */
@@ -1305,7 +1308,7 @@ void sync_gl_drawable( HWND hwnd, const RECT *visible_rect, const RECT *client_r
EnterCriticalSection( &context_section );
- if (XFindContext( gdi_display, (XID)hwnd, gl_drawable_context, (char **)&gl )) goto done;
+ if (XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl )) goto done;
if (changes.width != gl->rect.right - gl->rect.left) mask |= CWWidth;
if (changes.height != gl->rect.bottom - gl->rect.top) mask |= CWHeight;
@@ -1358,9 +1361,9 @@ void destroy_gl_drawable( HWND hwnd )
struct gl_drawable *gl;
EnterCriticalSection( &context_section );
- if (!XFindContext( gdi_display, (XID)hwnd, gl_drawable_context, (char **)&gl ))
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ))
{
- XDeleteContext( gdi_display, (XID)hwnd, gl_drawable_context );
+ XDeleteContext( gdi_display, (XID)hwnd, gl_hwnd_context );
free_gl_drawable( gl );
}
LeaveCriticalSection( &context_section );
@@ -1561,7 +1564,7 @@ static BOOL glxdrv_wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORM
}
EnterCriticalSection( &context_section );
- if (!XFindContext( gdi_display, (XID)hwnd, gl_drawable_context, (char **)&gl ))
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ))
prev = gl->pixel_format;
LeaveCriticalSection( &context_section );
@@ -2200,11 +2203,27 @@ static BOOL X11DRV_wglDestroyPbufferARB( struct wgl_pbuffer *object )
static HDC X11DRV_wglGetPbufferDCARB( struct wgl_pbuffer *object )
{
struct x11drv_escape_set_drawable escape;
+ struct gl_drawable *gl, *prev;
HDC hdc;
hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
if (!hdc) return 0;
+ if (!(gl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*gl) )))
+ {
+ DeleteDC( hdc );
+ return 0;
+ }
+ gl->type = DC_GL_PBUFFER;
+ gl->drawable = object->drawable;
+ gl->pixel_format = object->fmt - pixel_formats + 1;
+
+ EnterCriticalSection( &context_section );
+ if (!XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&prev ))
+ free_gl_drawable( prev );
+ XSaveContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char *)gl );
+ LeaveCriticalSection( &context_section );
+
escape.code = X11DRV_SET_DRAWABLE;
escape.hwnd = 0;
escape.drawable = object->drawable;
@@ -2313,7 +2332,18 @@ static BOOL X11DRV_wglQueryPbufferARB( struct wgl_pbuffer *object, int iAttribut
*/
static int X11DRV_wglReleasePbufferDCARB( struct wgl_pbuffer *object, HDC hdc )
{
+ struct gl_drawable *gl;
+
TRACE("(%p, %p)\n", object, hdc);
+
+ EnterCriticalSection( &context_section );
+ if (!XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
+ {
+ XDeleteContext( gdi_display, (XID)hdc, gl_pbuffer_context );
+ free_gl_drawable( gl );
+ }
+ LeaveCriticalSection( &context_section );
+
return DeleteDC(hdc);
}
@@ -3176,32 +3206,23 @@ static INT glxdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
struct gl_drawable *gl;
const struct x11drv_escape_set_drawable *data = in_data;
- if (!data->hwnd) /* pbuffer */
+ EnterCriticalSection( &context_section );
+ if (!XFindContext( gdi_display, (XID)data->hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)dev->hdc, gl_pbuffer_context, (char **)&gl ))
{
- physdev->pixel_format = pixelformat_from_fbconfig_id( data->fbconfig_id );
- physdev->type = DC_GL_PBUFFER;
- physdev->drawable = data->drawable;
- physdev->pixmap = 0;
+ physdev->pixel_format = gl->pixel_format;
+ physdev->type = gl->type;
+ physdev->drawable = gl->drawable;
+ physdev->pixmap = gl->pixmap;
}
else
{
- EnterCriticalSection( &context_section );
- if (!XFindContext( gdi_display, (XID)data->hwnd, gl_drawable_context, (char **)&gl ))
- {
- physdev->pixel_format = gl->pixel_format;
- physdev->type = gl->type;
- physdev->drawable = gl->drawable;
- physdev->pixmap = gl->pixmap;
- }
- else
- {
- physdev->pixel_format = 0;
- physdev->type = DC_GL_NONE;
- physdev->drawable = 0;
- physdev->pixmap = 0;
- }
- LeaveCriticalSection( &context_section );
+ physdev->pixel_format = 0;
+ physdev->type = DC_GL_NONE;
+ physdev->drawable = 0;
+ physdev->pixmap = 0;
}
+ LeaveCriticalSection( &context_section );
TRACE( "SET_DRAWABLE hdc %p drawable %lx pf %u type %u\n",
dev->hdc, physdev->drawable, physdev->pixel_format, physdev->type );
}
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure in wglGetPixelFormat .
Message-ID:
Module: wine
Branch: master
Commit: bf5e1b6a05e631846b9ba7fff2edc36213884bf2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bf5e1b6a05e631846b9ba7fff2edc36213884bf2
Author: Alexandre Julliard
Date: Fri Sep 7 15:31:05 2012 +0200
winex11: Get the current pixel format from the drawable structure in wglGetPixelFormat.
---
dlls/winex11.drv/opengl.c | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index d5d3ca9..a31c5ef 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1509,26 +1509,22 @@ static int glxdrv_wglDescribePixelFormat( HDC hdc, int iPixelFormat,
*/
static int glxdrv_wglGetPixelFormat( HDC hdc )
{
- struct x11drv_escape_get_drawable escape;
-
- TRACE( "(%p)\n", hdc );
+ HWND hwnd = WindowFromDC( hdc );
+ struct gl_drawable *gl;
+ int ret = 0;
- escape.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code,
- sizeof(escape), (LPSTR)&escape ))
- return 0;
+ EnterCriticalSection( &context_section );
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
+ ret = gl->pixel_format;
+ LeaveCriticalSection( &context_section );
- if (!is_valid_pixel_format( escape.pixel_format )) return 0; /* not set yet */
+ /* Offscreen formats can't be used with traditional WGL calls.
+ * As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
+ if (ret && !is_onscreen_pixel_format( ret )) ret = 1;
- if (!is_onscreen_pixel_format( escape.pixel_format ))
- {
- /* Offscreen formats can't be used with traditional WGL calls.
- * As has been verified on Windows GetPixelFormat doesn't fail but returns iPixelFormat=1. */
- TRACE("Returning iPixelFormat=1 for offscreen format: %d\n", escape.pixel_format);
- return 1;
- }
- TRACE("(%p): returns %d\n", hdc, escape.pixel_format);
- return escape.pixel_format;
+ TRACE( "%p -> %d\n", hdc, ret );
+ return ret;
}
/***********************************************************************
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Store a format pointer instead of an
index in the drawable structures.
Message-ID:
Module: wine
Branch: master
Commit: 356f9897cd890b29b5a373e06bc075c0b86a15ed
URL: http://source.winehq.org/git/wine.git/?a=commit;h=356f9897cd890b29b5a373e06bc075c0b86a15ed
Author: Alexandre Julliard
Date: Fri Sep 7 15:36:57 2012 +0200
winex11: Store a format pointer instead of an index in the drawable structures.
---
dlls/winex11.drv/opengl.c | 46 ++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index a31c5ef..3c557db 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -184,23 +184,23 @@ enum dc_gl_type
struct glx_physdev
{
- struct gdi_physdev dev;
- X11DRV_PDEVICE *x11dev;
- enum dc_gl_type type; /* type of GL device context */
- int pixel_format;
- Drawable drawable;
- Pixmap pixmap; /* pixmap for a DL_GL_PIXMAP_WIN drawable */
+ struct gdi_physdev dev;
+ X11DRV_PDEVICE *x11dev;
+ enum dc_gl_type type; /* type of GL device context */
+ const struct wgl_pixel_format *format;
+ Drawable drawable;
+ Pixmap pixmap; /* pixmap for a DL_GL_PIXMAP_WIN drawable */
};
struct gl_drawable
{
- enum dc_gl_type type; /* type of GL surface */
- Drawable drawable; /* drawable for rendering to the client area */
- Pixmap pixmap; /* base pixmap if drawable is a GLXPixmap */
- Colormap colormap; /* colormap used for the drawable */
- int pixel_format; /* pixel format for the drawable */
- XVisualInfo *visual; /* information about the GL visual */
- RECT rect; /* drawable rect, relative to whole window drawable */
+ enum dc_gl_type type; /* type of GL surface */
+ Drawable drawable; /* drawable for rendering to the client area */
+ Pixmap pixmap; /* base pixmap if drawable is a GLXPixmap */
+ Colormap colormap; /* colormap used for the drawable */
+ const struct wgl_pixel_format *format; /* pixel format for the drawable */
+ XVisualInfo *visual; /* information about the GL visual */
+ RECT rect; /* drawable rect, relative to whole window drawable */
};
/* X context to associate a struct gl_drawable to an hwnd */
@@ -1180,8 +1180,8 @@ BOOL set_win_format( HWND hwnd, XID fbconfig_id )
if (!(format = pixelformat_from_fbconfig_id( fbconfig_id ))) return FALSE;
gl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*gl) );
- gl->pixel_format = format;
- gl->visual = pglXGetVisualFromFBConfig( gdi_display, pixel_formats[format - 1].fbconfig );
+ gl->format = &pixel_formats[format - 1];
+ gl->visual = pglXGetVisualFromFBConfig( gdi_display, gl->format->fbconfig );
if (!gl->visual)
{
HeapFree( GetProcessHeap(), 0, gl );
@@ -1516,7 +1516,7 @@ static int glxdrv_wglGetPixelFormat( HDC hdc )
EnterCriticalSection( &context_section );
if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
!XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
- ret = gl->pixel_format;
+ ret = gl->format - pixel_formats + 1;
LeaveCriticalSection( &context_section );
/* Offscreen formats can't be used with traditional WGL calls.
@@ -1561,7 +1561,7 @@ static BOOL glxdrv_wglSetPixelFormat( HDC hdc, int iPixelFormat, const PIXELFORM
EnterCriticalSection( &context_section );
if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ))
- prev = gl->pixel_format;
+ prev = gl->format - pixel_formats + 1;
LeaveCriticalSection( &context_section );
if (prev) return prev == iPixelFormat; /* cannot change it if already set */
@@ -2212,7 +2212,7 @@ static HDC X11DRV_wglGetPbufferDCARB( struct wgl_pbuffer *object )
}
gl->type = DC_GL_PBUFFER;
gl->drawable = object->drawable;
- gl->pixel_format = object->fmt - pixel_formats + 1;
+ gl->format = object->fmt;
EnterCriticalSection( &context_section );
if (!XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&prev ))
@@ -3206,28 +3206,28 @@ static INT glxdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
if (!XFindContext( gdi_display, (XID)data->hwnd, gl_hwnd_context, (char **)&gl ) ||
!XFindContext( gdi_display, (XID)dev->hdc, gl_pbuffer_context, (char **)&gl ))
{
- physdev->pixel_format = gl->pixel_format;
+ physdev->format = gl->format;
physdev->type = gl->type;
physdev->drawable = gl->drawable;
physdev->pixmap = gl->pixmap;
}
else
{
- physdev->pixel_format = 0;
+ physdev->format = NULL;
physdev->type = DC_GL_NONE;
physdev->drawable = 0;
physdev->pixmap = 0;
}
LeaveCriticalSection( &context_section );
- TRACE( "SET_DRAWABLE hdc %p drawable %lx pf %u type %u\n",
- dev->hdc, physdev->drawable, physdev->pixel_format, physdev->type );
+ TRACE( "SET_DRAWABLE hdc %p drawable %lx pf %p type %u\n",
+ dev->hdc, physdev->drawable, physdev->format, physdev->type );
}
break;
case X11DRV_GET_DRAWABLE:
if (out_count >= sizeof(struct x11drv_escape_get_drawable))
{
struct x11drv_escape_get_drawable *data = out_data;
- data->pixel_format = physdev->pixel_format;
+ data->pixel_format = physdev->format ? physdev->format - pixel_formats + 1 : 0;
data->gl_drawable = physdev->drawable;
}
break;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure in wglCreateContext .
Message-ID:
Module: wine
Branch: master
Commit: c01d723a4fd91fbde6d9dc201329be3c2cccdea2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c01d723a4fd91fbde6d9dc201329be3c2cccdea2
Author: Alexandre Julliard
Date: Fri Sep 7 15:43:01 2012 +0200
winex11: Get the current pixel format from the drawable structure in wglCreateContext.
---
dlls/winex11.drv/opengl.c | 48 +++++++++++++++------------------------------
1 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 3c557db..dccee22 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1608,43 +1608,27 @@ static BOOL glxdrv_wglCopyContext(struct wgl_context *src, struct wgl_context *d
*/
static struct wgl_context *glxdrv_wglCreateContext( HDC hdc )
{
- struct x11drv_escape_get_drawable escape;
- struct wgl_context *ret;
- const struct wgl_pixel_format *fmt;
-
- TRACE( "(%p)\n", hdc );
+ struct wgl_context *ret = NULL;
+ struct gl_drawable *gl;
+ HWND hwnd = WindowFromDC( hdc );
- escape.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code,
- sizeof(escape), (LPSTR)&escape ))
- return 0;
+ EnterCriticalSection( &context_section );
- fmt = get_pixel_format(gdi_display, escape.pixel_format, TRUE /* Offscreen */);
- /* We can render using the iPixelFormat (1) of Wine's Main visual AND using some offscreen formats.
- * Note that standard WGL-calls don't recognize offscreen-only formats. For that reason pbuffers
- * use a sort of 'proxy' HDC (wglGetPbufferDCARB).
- * If this fails something is very wrong on the system. */
- if(!fmt) {
- ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", escape.pixel_format);
- SetLastError(ERROR_INVALID_PIXEL_FORMAT);
- return NULL;
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
+ {
+ if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) goto done;
+ ret->hdc = hdc;
+ ret->fmt = gl->format;
+ ret->vis = pglXGetVisualFromFBConfig(gdi_display, gl->format->fbconfig);
+ ret->ctx = create_glxcontext(gdi_display, ret, NULL);
+ list_add_head( &context_list, &ret->entry );
}
+ else SetLastError( ERROR_INVALID_PIXEL_FORMAT );
- if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) return 0;
-
- ret->hdc = hdc;
- ret->fmt = fmt;
- ret->has_been_current = FALSE;
- ret->sharing = FALSE;
-
- ret->vis = pglXGetVisualFromFBConfig(gdi_display, fmt->fbconfig);
- ret->ctx = create_glxcontext(gdi_display, ret, NULL);
-
- EnterCriticalSection( &context_section );
- list_add_head( &context_list, &ret->entry );
+done:
LeaveCriticalSection( &context_section );
-
- TRACE(" creating context %p (GL context creation delayed)\n", ret);
+ TRACE( "%p -> %p\n", hdc, ret );
return ret;
}
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure in wglCreateContextAttribsARB .
Message-ID:
Module: wine
Branch: master
Commit: d52c2de7dad0a5f0f9cbcc5115360028f390d4a7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d52c2de7dad0a5f0f9cbcc5115360028f390d4a7
Author: Alexandre Julliard
Date: Fri Sep 7 16:19:06 2012 +0200
winex11: Get the current pixel format from the drawable structure in wglCreateContextAttribsARB.
---
dlls/winex11.drv/opengl.c | 93 +++++++++++++++++++-------------------------
1 files changed, 40 insertions(+), 53 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index dccee22..97055ae 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1880,90 +1880,77 @@ static void wglFlush(void)
static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wgl_context *hShareContext,
const int* attribList )
{
- struct x11drv_escape_get_drawable escape;
- struct wgl_context *ret;
- const struct wgl_pixel_format *fmt;
+ struct wgl_context *ret = NULL;
+ struct gl_drawable *gl;
+ HWND hwnd = WindowFromDC( hdc );
TRACE("(%p %p %p)\n", hdc, hShareContext, attribList);
- escape.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code,
- sizeof(escape), (LPSTR)&escape ))
- return 0;
-
- fmt = get_pixel_format(gdi_display, escape.pixel_format, TRUE /* Offscreen */);
- /* wglCreateContextAttribsARB supports ALL pixel formats, so also offscreen ones.
- * If this fails something is very wrong on the system. */
- if(!fmt)
- {
- ERR("Cannot get FB Config for iPixelFormat %d, expect problems!\n", escape.pixel_format);
- SetLastError(ERROR_INVALID_PIXEL_FORMAT);
- return NULL;
- }
-
- if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) return 0;
-
- ret->hdc = hdc;
- ret->fmt = fmt;
- ret->vis = NULL; /* glXCreateContextAttribsARB requires a fbconfig instead of a visual */
- ret->gl3_context = TRUE;
+ EnterCriticalSection( &context_section );
- ret->numAttribs = 0;
- if(attribList)
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
{
- int *pAttribList = (int*)attribList;
- int *pContextAttribList = &ret->attribList[0];
- /* attribList consists of pairs {token, value] terminated with 0 */
- while(pAttribList[0] != 0)
+ if (!(ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)))) goto done;
+ ret->hdc = hdc;
+ ret->fmt = gl->format;
+ ret->vis = NULL; /* glXCreateContextAttribsARB requires a fbconfig instead of a visual */
+ ret->gl3_context = TRUE;
+ ret->numAttribs = 0;
+ if (attribList)
{
- TRACE("%#x %#x\n", pAttribList[0], pAttribList[1]);
- switch(pAttribList[0])
+ int *pContextAttribList = &ret->attribList[0];
+ /* attribList consists of pairs {token, value] terminated with 0 */
+ while(attribList[0] != 0)
{
+ TRACE("%#x %#x\n", attribList[0], attribList[1]);
+ switch(attribList[0])
+ {
case WGL_CONTEXT_MAJOR_VERSION_ARB:
pContextAttribList[0] = GLX_CONTEXT_MAJOR_VERSION_ARB;
- pContextAttribList[1] = pAttribList[1];
+ pContextAttribList[1] = attribList[1];
break;
case WGL_CONTEXT_MINOR_VERSION_ARB:
pContextAttribList[0] = GLX_CONTEXT_MINOR_VERSION_ARB;
- pContextAttribList[1] = pAttribList[1];
+ pContextAttribList[1] = attribList[1];
break;
case WGL_CONTEXT_LAYER_PLANE_ARB:
break;
case WGL_CONTEXT_FLAGS_ARB:
pContextAttribList[0] = GLX_CONTEXT_FLAGS_ARB;
- pContextAttribList[1] = pAttribList[1];
+ pContextAttribList[1] = attribList[1];
break;
case WGL_CONTEXT_PROFILE_MASK_ARB:
pContextAttribList[0] = GLX_CONTEXT_PROFILE_MASK_ARB;
- pContextAttribList[1] = pAttribList[1];
+ pContextAttribList[1] = attribList[1];
break;
default:
- ERR("Unhandled attribList pair: %#x %#x\n", pAttribList[0], pAttribList[1]);
+ ERR("Unhandled attribList pair: %#x %#x\n", attribList[0], attribList[1]);
+ }
+ ret->numAttribs++;
+ attribList += 2;
+ pContextAttribList += 2;
}
-
- ret->numAttribs++;
- pAttribList += 2;
- pContextAttribList += 2;
}
- }
-
- X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL);
- ret->ctx = create_glxcontext(gdi_display, ret, NULL);
- XSync(gdi_display, False);
- if(X11DRV_check_error() || !ret->ctx)
- {
+ X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL);
+ ret->ctx = create_glxcontext(gdi_display, ret, NULL);
+ XSync(gdi_display, False);
+ if (!X11DRV_check_error() && ret->ctx)
+ {
+ list_add_head( &context_list, &ret->entry );
+ goto done;
+ }
/* In the future we should convert the GLX error to a win32 one here if needed */
ERR("Context creation failed\n");
HeapFree( GetProcessHeap(), 0, ret );
- return NULL;
+ ret = NULL;
}
+ else SetLastError( ERROR_INVALID_PIXEL_FORMAT );
- EnterCriticalSection( &context_section );
- list_add_head( &context_list, &ret->entry );
+done:
LeaveCriticalSection( &context_section );
-
- TRACE(" creating context %p\n", ret);
+ TRACE( "%p -> %p\n", hdc, ret );
return ret;
}
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure in wglMakeCurrent .
Message-ID:
Module: wine
Branch: master
Commit: 11013af0a1a7f9c7d4854c376f8a3b46f955f1e2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=11013af0a1a7f9c7d4854c376f8a3b46f955f1e2
Author: Alexandre Julliard
Date: Fri Sep 7 15:53:00 2012 +0200
winex11: Get the current pixel format from the drawable structure in wglMakeCurrent.
---
dlls/winex11.drv/opengl.c | 57 +++++++++++++++++++--------------------------
1 files changed, 24 insertions(+), 33 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 97055ae..a6fb974 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1662,8 +1662,9 @@ static PROC glxdrv_wglGetProcAddress(LPCSTR lpszProc)
*/
static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
{
- BOOL ret;
- struct x11drv_escape_get_drawable escape;
+ BOOL ret = FALSE;
+ HWND hwnd;
+ struct gl_drawable *gl;
TRACE("(%p,%p)\n", hdc, ctx);
@@ -1674,51 +1675,41 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
return TRUE;
}
- escape.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape.code), (LPCSTR)&escape.code,
- sizeof(escape), (LPSTR)&escape ))
- return FALSE;
+ hwnd = WindowFromDC( hdc );
+ EnterCriticalSection( &context_section );
- if (!escape.pixel_format)
- {
- WARN("Trying to use an invalid drawable\n");
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- if (ctx->fmt - pixel_formats != escape.pixel_format - 1)
- {
- WARN( "mismatched pixel format hdc %p %u ctx %p\n", hdc, escape.pixel_format, ctx );
- SetLastError( ERROR_INVALID_PIXEL_FORMAT );
- return FALSE;
- }
- else
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)hdc, gl_pbuffer_context, (char **)&gl ))
{
+ if (ctx->fmt != gl->format)
+ {
+ WARN( "mismatched pixel format hdc %p %p ctx %p %p\n", hdc, gl->format, ctx, ctx->fmt );
+ SetLastError( ERROR_INVALID_PIXEL_FORMAT );
+ goto done;
+ }
+
if (TRACE_ON(wgl)) {
- int vis_id;
- pglXGetFBConfigAttrib(gdi_display, ctx->fmt->fbconfig, GLX_VISUAL_ID, &vis_id);
describeContext(ctx);
- TRACE("hdc %p drawable %lx fmt %u vis %x ctx %p\n", hdc,
- escape.gl_drawable, escape.pixel_format, vis_id, ctx->ctx);
+ TRACE("hdc %p drawable %lx fmt %p ctx %p\n", hdc, gl->drawable, gl->format, ctx->ctx );
}
- ret = pglXMakeCurrent(gdi_display, escape.gl_drawable, ctx->ctx);
-
+ ret = pglXMakeCurrent(gdi_display, gl->drawable, ctx->ctx);
if (ret)
{
NtCurrentTeb()->glContext = ctx;
-
- EnterCriticalSection( &context_section );
ctx->has_been_current = TRUE;
ctx->hdc = hdc;
- ctx->drawables[0] = escape.gl_drawable;
- ctx->drawables[1] = escape.gl_drawable;
+ ctx->drawables[0] = gl->drawable;
+ ctx->drawables[1] = gl->drawable;
ctx->refresh_drawables = FALSE;
- LeaveCriticalSection( &context_section );
+ goto done;
}
- else
- SetLastError(ERROR_INVALID_HANDLE);
}
- TRACE(" returning %s\n", (ret ? "True" : "False"));
+ SetLastError( ERROR_INVALID_HANDLE );
+
+done:
+ LeaveCriticalSection( &context_section );
+ TRACE( "%p,%p returning %d\n", hdc, ctx, ret );
return ret;
}
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Alexandre Julliard : winex11: Get the current pixel format from the
drawable structure in wglMakeContextCurrentARB .
Message-ID:
Module: wine
Branch: master
Commit: bde5156876bc9c2255f3f98bdef81840c057ffb7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bde5156876bc9c2255f3f98bdef81840c057ffb7
Author: Alexandre Julliard
Date: Fri Sep 7 16:09:22 2012 +0200
winex11: Get the current pixel format from the drawable structure in wglMakeContextCurrentARB.
---
dlls/winex11.drv/opengl.c | 48 +++++++++++++++++++-------------------------
1 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index a6fb974..6e0c0b7 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1718,8 +1718,9 @@ done:
*/
static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct wgl_context *ctx )
{
- struct x11drv_escape_get_drawable escape_draw, escape_read;
- BOOL ret;
+ BOOL ret = FALSE;
+ HWND draw_hwnd, read_hwnd;
+ struct gl_drawable *draw_gl, *read_gl;
TRACE("(%p,%p,%p)\n", draw_hdc, read_hdc, ctx);
@@ -1730,43 +1731,36 @@ static BOOL X11DRV_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, struct
return TRUE;
}
- escape_draw.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( draw_hdc, X11DRV_ESCAPE, sizeof(escape_draw.code), (LPCSTR)&escape_draw.code,
- sizeof(escape_draw), (LPSTR)&escape_draw ))
- return FALSE;
+ if (!pglXMakeContextCurrent) return FALSE;
- escape_read.code = X11DRV_GET_DRAWABLE;
- if (!ExtEscape( read_hdc, X11DRV_ESCAPE, sizeof(escape_read.code), (LPCSTR)&escape_read.code,
- sizeof(escape_read), (LPSTR)&escape_read ))
- return FALSE;
+ draw_hwnd = WindowFromDC( draw_hdc );
+ read_hwnd = WindowFromDC( read_hdc );
+ EnterCriticalSection( &context_section );
- if (!escape_draw.pixel_format)
+ if (!XFindContext( gdi_display, (XID)draw_hwnd, gl_hwnd_context, (char **)&draw_gl ) ||
+ !XFindContext( gdi_display, (XID)draw_hdc, gl_pbuffer_context, (char **)&draw_gl ))
{
- WARN("Trying to use an invalid drawable\n");
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- else
- {
- if (!pglXMakeContextCurrent) return FALSE;
+ if (XFindContext( gdi_display, (XID)read_hwnd, gl_hwnd_context, (char **)&read_gl ) &&
+ XFindContext( gdi_display, (XID)read_hdc, gl_pbuffer_context, (char **)&read_gl ))
+ read_gl = NULL;
- ret = pglXMakeContextCurrent(gdi_display, escape_draw.gl_drawable, escape_read.gl_drawable, ctx->ctx);
+ ret = pglXMakeContextCurrent(gdi_display, draw_gl->drawable,
+ read_gl ? read_gl->drawable : 0, ctx->ctx);
if (ret)
{
- EnterCriticalSection( &context_section );
ctx->has_been_current = TRUE;
ctx->hdc = draw_hdc;
- ctx->drawables[0] = escape_draw.gl_drawable;
- ctx->drawables[1] = escape_read.gl_drawable;
+ ctx->drawables[0] = draw_gl->drawable;
+ ctx->drawables[1] = read_gl ? read_gl->drawable : 0;
ctx->refresh_drawables = FALSE;
- LeaveCriticalSection( &context_section );
NtCurrentTeb()->glContext = ctx;
+ goto done;
}
- else
- SetLastError(ERROR_INVALID_HANDLE);
}
-
- TRACE(" returning %s\n", (ret ? "True" : "False"));
+ SetLastError( ERROR_INVALID_HANDLE );
+done:
+ LeaveCriticalSection( &context_section );
+ TRACE( "%p,%p,%p returning %d\n", draw_hdc, read_hdc, ctx, ret );
return ret;
}
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Hans Leidekker : iphlpapi: Implement GetExtendedUdpTable.
Message-ID:
Module: wine
Branch: master
Commit: 18ba68ea629f98c6afdc73c4baec0003f1c11ec6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=18ba68ea629f98c6afdc73c4baec0003f1c11ec6
Author: Hans Leidekker
Date: Fri Sep 7 13:35:36 2012 +0200
iphlpapi: Implement GetExtendedUdpTable.
---
dlls/iphlpapi/iphlpapi.spec | 2 +-
dlls/iphlpapi/iphlpapi_main.c | 49 +++--
dlls/iphlpapi/ipstats.c | 438 ++++++++++++++++++++++------------------
dlls/iphlpapi/ipstats.h | 1 +
dlls/iphlpapi/tests/iphlpapi.c | 36 ++++
include/iphlpapi.h | 3 +
include/iprtrmib.h | 7 +
include/udpmib.h | 2 +-
8 files changed, 322 insertions(+), 216 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=18ba68ea629f98c6afdc73c4baec0003f1c11ec6
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Hans Leidekker : iphlpapi: Add partial support for
UDP_TABLE_OWNER_MODULE in GetExtendedUdpTable.
Message-ID:
Module: wine
Branch: master
Commit: bc8876f9ce24beda5dba4a4413543f163fa154bb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bc8876f9ce24beda5dba4a4413543f163fa154bb
Author: Hans Leidekker
Date: Fri Sep 7 13:35:48 2012 +0200
iphlpapi: Add partial support for UDP_TABLE_OWNER_MODULE in GetExtendedUdpTable.
---
dlls/iphlpapi/iphlpapi_main.c | 6 +++++-
dlls/iphlpapi/ipstats.c | 15 +++++++++++----
include/udpmib.h | 23 +++++++++++++++++++++++
3 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index a9ab1e0..f3568b8 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1935,11 +1935,15 @@ DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize, BOOL bOrder,
if (!pdwSize) return ERROR_INVALID_PARAMETER;
if (ulAf != AF_INET ||
- (TableClass != UDP_TABLE_BASIC && TableClass != UDP_TABLE_OWNER_PID))
+ (TableClass != UDP_TABLE_BASIC && TableClass != UDP_TABLE_OWNER_PID &&
+ TableClass != UDP_TABLE_OWNER_MODULE))
{
FIXME("ulAf = %u, TableClass = %u not supported\n", ulAf, TableClass);
return ERROR_NOT_SUPPORTED;
}
+ if (TableClass == UDP_TABLE_OWNER_MODULE)
+ FIXME("UDP_TABLE_OWNER_MODULE not fully supported\n");
+
if ((ret = build_udp_table(TableClass, &table, bOrder, GetProcessHeap(), 0, &size)))
return ret;
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 18307d5..7c64b41 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1837,6 +1837,12 @@ static DWORD get_udp_table_sizes( UDP_TABLE_CLASS class, DWORD row_count, DWORD
if (row_size) *row_size = sizeof(MIB_UDPROW_OWNER_PID);
break;
}
+ case UDP_TABLE_OWNER_MODULE:
+ {
+ table_size = FIELD_OFFSET(MIB_UDPTABLE_OWNER_MODULE, table[row_count]);
+ if (row_size) *row_size = sizeof(MIB_UDPROW_OWNER_MODULE);
+ break;
+ }
default:
ERR("unhandled class %u\n", class);
return 0;
@@ -1846,7 +1852,7 @@ static DWORD get_udp_table_sizes( UDP_TABLE_CLASS class, DWORD row_count, DWORD
static MIB_UDPTABLE *append_udp_row( UDP_TABLE_CLASS class, HANDLE heap, DWORD flags,
MIB_UDPTABLE *table, DWORD *count,
- const MIB_UDPROW_OWNER_PID *row, DWORD row_size )
+ const MIB_UDPROW_OWNER_MODULE *row, DWORD row_size )
{
if (table->dwNumEntries >= *count)
{
@@ -1881,7 +1887,7 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE
DWORD *size )
{
MIB_UDPTABLE *table;
- MIB_UDPROW_OWNER_PID row;
+ MIB_UDPROW_OWNER_MODULE row;
DWORD ret = NO_ERROR, count = 16, table_size, row_size;
if (!(table_size = get_udp_table_sizes( class, count, &row_size )))
@@ -1904,7 +1910,8 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE
unsigned int dummy, num_entries = 0;
int inode;
- if (class == UDP_TABLE_OWNER_PID) map = get_pid_map( &num_entries );
+ if (class == UDP_TABLE_OWNER_PID || class == UDP_TABLE_OWNER_MODULE)
+ map = get_pid_map( &num_entries );
/* skip header line */
ptr = fgets( buf, sizeof(buf), fp );
@@ -1914,7 +1921,7 @@ DWORD build_udp_table( UDP_TABLE_CLASS class, void **tablep, BOOL order, HANDLE
&row.dwLocalAddr, &row.dwLocalPort, &inode ) != 4)
continue;
row.dwLocalPort = htons( row.dwLocalPort );
- if (class == UDP_TABLE_OWNER_PID)
+ if (class == UDP_TABLE_OWNER_PID || class == UDP_TABLE_OWNER_MODULE)
row.dwOwningPid = find_owning_pid( map, num_entries, inode );
if (!(table = append_udp_row( class, heap, flags, table, &count, &row, row_size )))
break;
diff --git a/include/udpmib.h b/include/udpmib.h
index c2d507f..6b3f51c 100644
--- a/include/udpmib.h
+++ b/include/udpmib.h
@@ -48,6 +48,29 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
MIB_UDPROW_OWNER_PID table[1];
} MIB_UDPTABLE_OWNER_PID, *PMIB_UDPTABLE_OWNER_PID;
+typedef struct _MIB_UDPROW_OWNER_MODULE
+{
+ DWORD dwLocalAddr;
+ DWORD dwLocalPort;
+ DWORD dwOwningPid;
+ LARGE_INTEGER liCreateTimestamp;
+ __C89_NAMELESS union
+ {
+ __C89_NAMELESS struct
+ {
+ int SpecificPortBind:1;
+ } __C89_NAMELESSSTRUCTNAME;
+ int dwFlags;
+ } __C89_NAMELESSUNIONNAME;
+ ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE];
+} MIB_UDPROW_OWNER_MODULE, *PMIB_UDPROW_OWNER_MODULE;
+
+typedef struct _MIB_UDPTABLE_OWNER_MODULE
+{
+ DWORD dwNumEntries;
+ MIB_UDPROW_OWNER_MODULE table[1];
+} MIB_UDPTABLE_OWNER_MODULE, *PMIB_UDPTABLE_OWNER_MODULE;
+
/* UDP statistics */
typedef struct _MIB_UDPSTATS
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Jacek Caban : vbscript: Fixed class_desc_t leak.
Message-ID:
Module: wine
Branch: master
Commit: bac5fdc85f231abda5b9ac49d4d0d1617fce44a0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bac5fdc85f231abda5b9ac49d4d0d1617fce44a0
Author: Jacek Caban
Date: Fri Sep 7 15:08:59 2012 +0200
vbscript: Fixed class_desc_t leak.
---
dlls/vbscript/vbscript.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
index f842bba..095e3ae 100644
--- a/dlls/vbscript/vbscript.c
+++ b/dlls/vbscript/vbscript.c
@@ -115,6 +115,8 @@ static HRESULT set_ctx_site(VBScript *This)
static void release_script(script_ctx_t *ctx)
{
+ class_desc_t *class_desc;
+
collect_objects(ctx);
release_dynamic_vars(ctx->global_vars);
@@ -130,6 +132,13 @@ static void release_script(script_ctx_t *ctx)
heap_free(iter);
}
+ while(ctx->procs) {
+ class_desc = ctx->procs;
+ ctx->procs = class_desc->next;
+
+ heap_free(class_desc);
+ }
+
if(ctx->host_global) {
IDispatch_Release(ctx->host_global);
ctx->host_global = NULL;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Jacek Caban : vbscript: Use separated IDispatchEx implementation for
script dispatch.
Message-ID:
Module: wine
Branch: master
Commit: 8121f73273d475a9b5961763a66d398fa6640aa1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8121f73273d475a9b5961763a66d398fa6640aa1
Author: Jacek Caban
Date: Fri Sep 7 15:09:34 2012 +0200
vbscript: Use separated IDispatchEx implementation for script dispatch.
---
dlls/vbscript/global.c | 3 +-
dlls/vbscript/vbdisp.c | 182 ++++++++++++++++++++++++++++++++++++++++++++++
dlls/vbscript/vbscript.c | 5 +-
dlls/vbscript/vbscript.h | 10 ++-
4 files changed, 195 insertions(+), 5 deletions(-)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
index 55c1acc..3c28e96 100644
--- a/dlls/vbscript/global.c
+++ b/dlls/vbscript/global.c
@@ -1825,8 +1825,7 @@ HRESULT init_global(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- ctx->script_desc.ctx = ctx;
- hres = create_vbdisp(&ctx->script_desc, &ctx->script_obj);
+ hres = create_script_disp(ctx, &ctx->script_obj);
if(FAILED(hres))
return hres;
diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index f6e3f11..b7945d8 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -565,6 +565,188 @@ HRESULT create_procedure_disp(script_ctx_t *ctx, vbscode_t *code, IDispatch **re
return S_OK;
}
+static inline ScriptDisp *ScriptDisp_from_IDispatchEx(IDispatchEx *iface)
+{
+ return CONTAINING_RECORD(iface, ScriptDisp, IDispatchEx_iface);
+}
+
+static HRESULT WINAPI ScriptDisp_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+
+ if(IsEqualGUID(&IID_IUnknown, riid)) {
+ TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
+ *ppv = &This->IDispatchEx_iface;
+ }else if(IsEqualGUID(&IID_IDispatch, riid)) {
+ TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
+ *ppv = &This->IDispatchEx_iface;
+ }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
+ TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
+ *ppv = &This->IDispatchEx_iface;
+ }else {
+ WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
+ *ppv = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown*)*ppv);
+ return S_OK;
+}
+
+static ULONG WINAPI ScriptDisp_AddRef(IDispatchEx *iface)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ LONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI ScriptDisp_Release(IDispatchEx *iface)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ LONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ if(!ref) {
+ assert(!This->ctx);
+ heap_free(This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI ScriptDisp_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+
+ TRACE("(%p)->(%p)\n", This, pctinfo);
+
+ *pctinfo = 1;
+ return S_OK;
+}
+
+static HRESULT WINAPI ScriptDisp_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid,
+ ITypeInfo **ppTInfo)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
+ LPOLESTR *rgszNames, UINT cNames, LCID lcid,
+ DISPID *rgDispId)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
+ lcid, rgDispId);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_Invoke(IDispatchEx *iface, DISPID dispIdMember,
+ REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+ VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
+ lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
+ return DISP_E_UNKNOWNNAME;
+}
+
+static HRESULT WINAPI ScriptDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
+ VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
+ return DISP_E_MEMBERNOTFOUND;
+}
+
+static HRESULT WINAPI ScriptDisp_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%x)\n", This, id);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%x %p)\n", This, id, pbstrName);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ScriptDisp_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
+{
+ ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ FIXME("(%p)->(%p)\n", This, ppunk);
+ return E_NOTIMPL;
+}
+
+static IDispatchExVtbl ScriptDispVtbl = {
+ ScriptDisp_QueryInterface,
+ ScriptDisp_AddRef,
+ ScriptDisp_Release,
+ ScriptDisp_GetTypeInfoCount,
+ ScriptDisp_GetTypeInfo,
+ ScriptDisp_GetIDsOfNames,
+ ScriptDisp_Invoke,
+ ScriptDisp_GetDispID,
+ ScriptDisp_InvokeEx,
+ ScriptDisp_DeleteMemberByName,
+ ScriptDisp_DeleteMemberByDispID,
+ ScriptDisp_GetMemberProperties,
+ ScriptDisp_GetMemberName,
+ ScriptDisp_GetNextDispID,
+ ScriptDisp_GetNameSpaceParent
+};
+
+HRESULT create_script_disp(script_ctx_t *ctx, ScriptDisp **ret)
+{
+ ScriptDisp *script_disp;
+
+ script_disp = heap_alloc(sizeof(*script_disp));
+ if(!script_disp)
+ return E_OUTOFMEMORY;
+
+ script_disp->IDispatchEx_iface.lpVtbl = &ScriptDispVtbl;
+ script_disp->ref = 1;
+ script_disp->ctx = ctx;
+
+ *ret = script_disp;
+ return S_OK;
+}
+
void collect_objects(script_ctx_t *ctx)
{
vbdisp_t *iter, *iter2;
diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
index 095e3ae..05132a6 100644
--- a/dlls/vbscript/vbscript.c
+++ b/dlls/vbscript/vbscript.c
@@ -165,8 +165,11 @@ static void release_script(script_ctx_t *ctx)
}
if(ctx->script_obj) {
- IDispatchEx_Release(&ctx->script_obj->IDispatchEx_iface);
+ ScriptDisp *script_obj = ctx->script_obj;
+
ctx->script_obj = NULL;
+ script_obj->ctx = NULL;
+ IDispatchEx_Release(&script_obj->IDispatchEx_iface);
}
vbsheap_free(&ctx->heap);
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 8a316ab..306cfed 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -116,6 +116,12 @@ struct _vbdisp_t {
VARIANT props[1];
};
+typedef struct {
+ IDispatchEx IDispatchEx_iface;
+ LONG ref;
+ script_ctx_t *ctx;
+} ScriptDisp;
+
HRESULT create_vbdisp(const class_desc_t*,vbdisp_t**) DECLSPEC_HIDDEN;
HRESULT disp_get_id(IDispatch*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN;
HRESULT vbdisp_get_id(vbdisp_t*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN;
@@ -123,6 +129,7 @@ HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*) DECLSPEC
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
void collect_objects(script_ctx_t*) DECLSPEC_HIDDEN;
HRESULT create_procedure_disp(script_ctx_t*,vbscode_t*,IDispatch**) DECLSPEC_HIDDEN;
+HRESULT create_script_disp(script_ctx_t*,ScriptDisp**) DECLSPEC_HIDDEN;
static inline unsigned arg_cnt(const DISPPARAMS *dp)
{
@@ -150,8 +157,7 @@ struct _script_ctx_t {
IDispatch *host_global;
- class_desc_t script_desc;
- vbdisp_t *script_obj;
+ ScriptDisp *script_obj;
class_desc_t global_desc;
vbdisp_t *global_obj;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Jacek Caban : vbscript: Added ScriptDisp::GetDispID implementation.
Message-ID:
Module: wine
Branch: master
Commit: 40001df45db90b70710b9fec7fad419322301ad3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=40001df45db90b70710b9fec7fad419322301ad3
Author: Jacek Caban
Date: Fri Sep 7 15:09:59 2012 +0200
vbscript: Added ScriptDisp::GetDispID implementation.
---
dlls/vbscript/vbdisp.c | 85 ++++++++++++++++++++++++++++++++++++++++++++-
dlls/vbscript/vbscript.h | 7 ++++
2 files changed, 90 insertions(+), 2 deletions(-)
diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index b7945d8..4f473e2 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -565,6 +565,44 @@ HRESULT create_procedure_disp(script_ctx_t *ctx, vbscode_t *code, IDispatch **re
return S_OK;
}
+struct _ident_map_t {
+ const WCHAR *name;
+ BOOL is_var;
+ union {
+ dynamic_var_t *var;
+ function_t *func;
+ } u;
+};
+
+static inline DISPID ident_to_id(ScriptDisp *This, ident_map_t *ident)
+{
+ return (ident-This->ident_map)+1;
+}
+
+static ident_map_t *add_ident(ScriptDisp *This, const WCHAR *name)
+{
+ ident_map_t *ret;
+
+ if(!This->ident_map_size) {
+ This->ident_map = heap_alloc(4 * sizeof(*This->ident_map));
+ if(!This->ident_map)
+ return NULL;
+ This->ident_map_size = 4;
+ }else if(This->ident_map_cnt == This->ident_map_size) {
+ ident_map_t *new_map;
+
+ new_map = heap_realloc(This->ident_map, 2*This->ident_map_size*sizeof(*new_map));
+ if(!new_map)
+ return NULL;
+ This->ident_map = new_map;
+ This->ident_map_size *= 2;
+ }
+
+ ret = This->ident_map + This->ident_map_cnt++;
+ ret->name = name;
+ return ret;
+}
+
static inline ScriptDisp *ScriptDisp_from_IDispatchEx(IDispatchEx *iface)
{
return CONTAINING_RECORD(iface, ScriptDisp, IDispatchEx_iface);
@@ -612,6 +650,7 @@ static ULONG WINAPI ScriptDisp_Release(IDispatchEx *iface)
if(!ref) {
assert(!This->ctx);
+ heap_free(This->ident_map);
heap_free(This);
}
@@ -659,7 +698,49 @@ static HRESULT WINAPI ScriptDisp_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI ScriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
- FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
+ dynamic_var_t *var;
+ ident_map_t *ident;
+ function_t *func;
+
+ TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
+
+ if(!This->ctx)
+ return E_UNEXPECTED;
+
+ for(ident = This->ident_map; ident < This->ident_map+This->ident_map_cnt; ident++) {
+ if(!strcmpiW(ident->name, bstrName)) {
+ *pid = ident_to_id(This, ident);
+ return S_OK;
+ }
+ }
+
+ for(var = This->ctx->global_vars; var; var = var->next) {
+ if(!strcmpiW(var->name, bstrName)) {
+ ident = add_ident(This, var->name);
+ if(!ident)
+ return E_OUTOFMEMORY;
+
+ ident->is_var = TRUE;
+ ident->u.var = var;
+ *pid = ident_to_id(This, ident);
+ return S_OK;
+ }
+ }
+
+ for(func = This->ctx->global_funcs; func; func = func->next) {
+ if(!strcmpiW(func->name, bstrName)) {
+ ident = add_ident(This, func->name);
+ if(!ident)
+ return E_OUTOFMEMORY;
+
+ ident->is_var = FALSE;
+ ident->u.func = func;
+ *pid = ident_to_id(This, ident);
+ return S_OK;
+ }
+ }
+
+ *pid = -1;
return DISP_E_UNKNOWNNAME;
}
@@ -735,7 +816,7 @@ HRESULT create_script_disp(script_ctx_t *ctx, ScriptDisp **ret)
{
ScriptDisp *script_disp;
- script_disp = heap_alloc(sizeof(*script_disp));
+ script_disp = heap_alloc_zero(sizeof(*script_disp));
if(!script_disp)
return E_OUTOFMEMORY;
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index 306cfed..77cf0e7 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -116,9 +116,16 @@ struct _vbdisp_t {
VARIANT props[1];
};
+typedef struct _ident_map_t ident_map_t;
+
typedef struct {
IDispatchEx IDispatchEx_iface;
LONG ref;
+
+ ident_map_t *ident_map;
+ unsigned ident_map_cnt;
+ unsigned ident_map_size;
+
script_ctx_t *ctx;
} ScriptDisp;
From julliard at winehq.org Fri Sep 7 13:26:21 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:21 -0500
Subject: Jacek Caban : vbscript: Added ScriptDisp::InvokeEx implementation.
Message-ID:
Module: wine
Branch: master
Commit: 11d2dfaea9eb99c3bebfbb47658742de892e28f3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=11d2dfaea9eb99c3bebfbb47658742de892e28f3
Author: Jacek Caban
Date: Fri Sep 7 15:10:17 2012 +0200
vbscript: Added ScriptDisp::InvokeEx implementation.
---
dlls/vbscript/vbdisp.c | 33 ++++++++++++++++++++++++++++++---
1 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index 4f473e2..a76660e 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -97,7 +97,7 @@ static VARIANT *get_propput_arg(const DISPPARAMS *dp)
return NULL;
}
-static HRESULT invoke_variant_prop(vbdisp_t *This, VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res)
+static HRESULT invoke_variant_prop(VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res)
{
HRESULT hres;
@@ -403,7 +403,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
}
if(id < This->desc->prop_cnt + This->desc->func_cnt)
- return invoke_variant_prop(This, This->props+(id-This->desc->func_cnt), wFlags, pdp, pvarRes);
+ return invoke_variant_prop(This->props+(id-This->desc->func_cnt), wFlags, pdp, pvarRes);
if(This->desc->builtin_prop_cnt) {
unsigned min = 0, max = This->desc->builtin_prop_cnt-1, i;
@@ -579,6 +579,11 @@ static inline DISPID ident_to_id(ScriptDisp *This, ident_map_t *ident)
return (ident-This->ident_map)+1;
}
+static inline ident_map_t *id_to_ident(ScriptDisp *This, DISPID id)
+{
+ return 0 < id && id <= This->ident_map_cnt ? This->ident_map+id-1 : NULL;
+}
+
static ident_map_t *add_ident(ScriptDisp *This, const WCHAR *name)
{
ident_map_t *ret;
@@ -748,8 +753,30 @@ static HRESULT WINAPI ScriptDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
ScriptDisp *This = ScriptDisp_from_IDispatchEx(iface);
+ ident_map_t *ident;
+ HRESULT hres;
+
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
- return DISP_E_MEMBERNOTFOUND;
+
+ ident = id_to_ident(This, id);
+ if(!ident)
+ return DISP_E_MEMBERNOTFOUND;
+
+ if(ident->is_var) {
+ if(ident->u.var->is_const) {
+ FIXME("const not supported\n");
+ return E_NOTIMPL;
+ }
+
+ return invoke_variant_prop(&ident->u.var->v, wFlags, pdp, pvarRes);
+ }
+
+
+ IActiveScriptSite_OnEnterScript(This->ctx->site);
+ hres = exec_script(This->ctx, ident->u.func, NULL, pdp, pvarRes);
+ IActiveScriptSite_OnLeaveScript(This->ctx->site);
+
+ return hres;
}
static HRESULT WINAPI ScriptDisp_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
From julliard at winehq.org Fri Sep 7 13:26:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:22 -0500
Subject: Jacek Caban : vbscript: Added ScriptDisp tests.
Message-ID:
Module: wine
Branch: master
Commit: c2dbc6bfaabefea0c6382001cae88da9a5219a7a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c2dbc6bfaabefea0c6382001cae88da9a5219a7a
Author: Jacek Caban
Date: Fri Sep 7 15:10:38 2012 +0200
vbscript: Added ScriptDisp tests.
---
dlls/vbscript/tests/vbscript.c | 152 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 152 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c
index fe53854..ec53712 100644
--- a/dlls/vbscript/tests/vbscript.c
+++ b/dlls/vbscript/tests/vbscript.c
@@ -85,6 +85,18 @@ DEFINE_EXPECT(OnLeaveScript);
DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4,0xb0, 0x00,0xaa,0x00,0x4a,0x55,0xe8);
+static BSTR a2bstr(const char *str)
+{
+ BSTR ret;
+ int len;
+
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
+ ret = SysAllocStringLen(NULL, len-1);
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
+
+ return ret;
+}
+
#define test_state(s,ss) _test_state(__LINE__,s,ss)
static void _test_state(unsigned line, IActiveScript *script, SCRIPTSTATE exstate)
{
@@ -318,6 +330,35 @@ static IDispatchEx *get_script_dispatch(IActiveScript *script)
return dispex;
}
+static void parse_script(IActiveScriptParse *parse, const char *src)
+{
+ BSTR str;
+ HRESULT hres;
+
+ SET_EXPECT(OnEnterScript);
+ SET_EXPECT(OnLeaveScript);
+
+ str = a2bstr(src);
+ hres = IActiveScriptParse_ParseScriptText(parse, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
+ SysFreeString(str);
+ ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
+
+ CHECK_CALLED(OnEnterScript);
+ CHECK_CALLED(OnLeaveScript);
+}
+
+#define get_disp_id(a,b,c,d) _get_disp_id(__LINE__,a,b,c,d)
+static void _get_disp_id(unsigned line, IDispatchEx *dispex, const char *name, HRESULT exhres, DISPID *id)
+{
+ BSTR str;
+ HRESULT hres;
+
+ str = a2bstr(name);
+ hres = IDispatchEx_GetDispID(dispex, str, 0, id);
+ SysFreeString(str);
+ ok_(__FILE__,line)(hres == exhres, "GetDispID(%s) returned %08x, expected %08x\n", name, hres, exhres);
+}
+
static void test_no_script_dispatch(IActiveScript *script)
{
IDispatch *disp;
@@ -341,6 +382,116 @@ static IActiveScript *create_vbscript(void)
return ret;
}
+static void test_scriptdisp(void)
+{
+ IActiveScriptParse *parser;
+ IDispatchEx *script_disp;
+ IActiveScript *vbscript;
+ DISPID id, id2;
+ DISPPARAMS dp;
+ EXCEPINFO ei;
+ VARIANT v;
+ ULONG ref;
+ HRESULT hres;
+
+ vbscript = create_vbscript();
+
+ hres = IActiveScript_QueryInterface(vbscript, &IID_IActiveScriptParse, (void**)&parser);
+ ok(hres == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hres);
+
+ test_state(vbscript, SCRIPTSTATE_UNINITIALIZED);
+ test_safety(vbscript);
+
+ SET_EXPECT(GetLCID);
+ hres = IActiveScript_SetScriptSite(vbscript, &ActiveScriptSite);
+ ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
+ CHECK_CALLED(GetLCID);
+
+ test_state(vbscript, SCRIPTSTATE_UNINITIALIZED);
+
+ SET_EXPECT(OnStateChange_INITIALIZED);
+ hres = IActiveScriptParse_InitNew(parser);
+ ok(hres == S_OK, "InitNew failed: %08x\n", hres);
+ CHECK_CALLED(OnStateChange_INITIALIZED);
+
+ test_state(vbscript, SCRIPTSTATE_INITIALIZED);
+
+ SET_EXPECT(OnStateChange_CONNECTED);
+ hres = IActiveScript_SetScriptState(vbscript, SCRIPTSTATE_CONNECTED);
+ ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
+ CHECK_CALLED(OnStateChange_CONNECTED);
+
+ test_state(vbscript, SCRIPTSTATE_CONNECTED);
+
+ script_disp = get_script_dispatch(vbscript);
+
+ id = 100;
+ get_disp_id(script_disp, "LCase", DISP_E_UNKNOWNNAME, &id);
+ ok(id == -1, "id = %d, expected -1\n", id);
+
+ get_disp_id(script_disp, "globalVariable", DISP_E_UNKNOWNNAME, &id);
+ parse_script(parser, "dim globalVariable\nglobalVariable = 3");
+ get_disp_id(script_disp, "globalVariable", S_OK, &id);
+
+ memset(&dp, 0, sizeof(dp));
+ memset(&ei, 0, sizeof(ei));
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatchEx_InvokeEx(script_disp, id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_I2(&v) == 3, "V_I2(v) = %d\n", V_I2(&v));
+
+ get_disp_id(script_disp, "globalVariable2", DISP_E_UNKNOWNNAME, &id);
+ parse_script(parser, "globalVariable2 = 4");
+ get_disp_id(script_disp, "globalVariable2", S_OK, &id);
+
+ get_disp_id(script_disp, "globalFunction", DISP_E_UNKNOWNNAME, &id);
+ parse_script(parser, "function globalFunction()\nglobalFunction=5\nend function");
+ get_disp_id(script_disp, "globalFunction", S_OK, &id);
+
+ SET_EXPECT(OnEnterScript);
+ SET_EXPECT(OnLeaveScript);
+
+ memset(&dp, 0, sizeof(dp));
+ memset(&ei, 0, sizeof(ei));
+ V_VT(&v) = VT_EMPTY;
+ hres = IDispatchEx_InvokeEx(script_disp, id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_I2(&v) == 5, "V_I2(v) = %d\n", V_I2(&v));
+
+ CHECK_CALLED(OnEnterScript);
+ CHECK_CALLED(OnLeaveScript);
+
+ get_disp_id(script_disp, "globalSub", DISP_E_UNKNOWNNAME, &id);
+ parse_script(parser, "sub globalSub()\nend sub");
+ get_disp_id(script_disp, "globalSub", S_OK, &id);
+ get_disp_id(script_disp, "globalSub", S_OK, &id2);
+ ok(id == id2, "id != id2\n");
+
+ get_disp_id(script_disp, "constVariable", DISP_E_UNKNOWNNAME, &id);
+ parse_script(parser, "const constVariable = 6");
+ get_disp_id(script_disp, "ConstVariable", S_OK, &id);
+ get_disp_id(script_disp, "Constvariable", S_OK, &id2);
+ ok(id == id2, "id != id2\n");
+
+ IDispatchEx_Release(script_disp);
+
+ IActiveScriptParse_Release(parser);
+
+ SET_EXPECT(OnStateChange_DISCONNECTED);
+ SET_EXPECT(OnStateChange_INITIALIZED);
+ SET_EXPECT(OnStateChange_CLOSED);
+ hres = IActiveScript_Close(vbscript);
+ ok(hres == S_OK, "Close failed: %08x\n", hres);
+ CHECK_CALLED(OnStateChange_DISCONNECTED);
+ CHECK_CALLED(OnStateChange_INITIALIZED);
+ CHECK_CALLED(OnStateChange_CLOSED);
+
+ ref = IActiveScript_Release(vbscript);
+ ok(!ref, "ref = %d\n", ref);
+}
+
static void test_vbscript(void)
{
IActiveScriptParseProcedure2 *parse_proc;
@@ -644,6 +795,7 @@ START_TEST(vbscript)
test_vbscript_release();
test_vbscript_simplecreate();
test_vbscript_initializing();
+ test_scriptdisp();
}else {
win_skip("VBScript engine not available\n");
}
From julliard at winehq.org Fri Sep 7 13:26:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:22 -0500
Subject: Jacek Caban : jscript: Be more verbose about parser failure.
Message-ID:
Module: wine
Branch: master
Commit: 42d75be69d9fef4f59153337e8af2f85d7b30d34
URL: http://source.winehq.org/git/wine.git/?a=commit;h=42d75be69d9fef4f59153337e8af2f85d7b30d34
Author: Jacek Caban
Date: Fri Sep 7 17:14:13 2012 +0200
jscript: Be more verbose about parser failure.
---
dlls/jscript/parser.y | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y
index d108ab0..4c69ed9 100644
--- a/dlls/jscript/parser.y
+++ b/dlls/jscript/parser.y
@@ -21,6 +21,10 @@
#include "jscript.h"
#include "engine.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
#define YYLEX_PARAM ctx
#define YYPARSE_PARAM ctx
@@ -1516,6 +1520,8 @@ HRESULT script_parse(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite
jsheap_clear(mark);
hres = parser_ctx->hres;
if(FAILED(hres)) {
+ WARN("parser failed around %s\n",
+ debugstr_w(parser_ctx->begin+20 > parser_ctx->ptr ? parser_ctx->begin : parser_ctx->ptr-20));
parser_release(parser_ctx);
return hres;
}
From julliard at winehq.org Fri Sep 7 13:26:22 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Fri, 07 Sep 2012 13:26:22 -0500
Subject: Piotr Caban : msvcrt: Fixed strncpy_s behavior when count equals 0.
Message-ID:
Module: wine
Branch: master
Commit: bdf9a9f9bd56354f70a7431a9682183b84353211
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bdf9a9f9bd56354f70a7431a9682183b84353211
Author: Piotr Caban
Date: Fri Sep 7 16:58:23 2012 +0200
msvcrt: Fixed strncpy_s behavior when count equals 0.
---
dlls/msvcrt/heap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/heap.c b/dlls/msvcrt/heap.c
index 5eaf4a1..0a0d819 100644
--- a/dlls/msvcrt/heap.c
+++ b/dlls/msvcrt/heap.c
@@ -598,8 +598,11 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
TRACE("(%s %lu %s %lu)\n", dest, numberOfElements, src, count);
- if(!count)
+ if(!count) {
+ if(dest && numberOfElements)
+ *dest = 0;
return 0;
+ }
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
From jnewman at winehq.org Mon Sep 10 13:37:59 2012
From: jnewman at winehq.org (Jeremy Newman)
Date: Mon, 10 Sep 2012 13:37:59 -0500
Subject: Kyle Auble : Redirect all status links to wiki
Message-ID:
Module: website
Branch: master
Commit: 983621fe65f3e4f8dca24a86bc722ea558654034
URL: http://source.winehq.org/git/website.git/?a=commit;h=983621fe65f3e4f8dca24a86bc722ea558654034
Author: Kyle Auble
Date: Sat Sep 8 20:02:39 2012 -0700
Redirect all status links to wiki
---
templates/en/status.template | 15 ++++++++++-----
templates/he/status.template | 15 ++++++++++-----
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/templates/en/status.template b/templates/en/status.template
index d740b16..1528a85 100644
--- a/templates/en/status.template
+++ b/templates/en/status.template
@@ -40,27 +40,32 @@
Status of APIs Implemented.
- Core Status
+ Core Status
Status of core Wine components, tools, and misc.
- DLLs Status
+ DLLs Status
Status of Windows DLL clones.
- DirectX Status
+ DirectX Status
Status of DirectX DLL clones.
- Multimedia Status
+ Multimedia Status
Status of multimedia elements.
- UI Status
+ Tool Status
+
+ Status of ancillary tool programs and scripts.
+
+
+ UI Status
Status of user interface elements.
diff --git a/templates/he/status.template b/templates/he/status.template
index 42af425..463018a 100644
--- a/templates/he/status.template
+++ b/templates/he/status.template
@@ -39,27 +39,32 @@
??? ???????? ?? API???????.
- ??? ?????
+ ??? ?????
??? ????? ?????, ????? ???? ?? Wine.
- ??? ??DLL??
+ ??? ??DLL??
??? ????? ??DLL ?? Windows.
- ??? DirectX
+ ??? DirectX
??? ????? ??DLL ?? DirectX.
- ??? ??????????
+ ??? ??????????
??? ????? ??????????.
- ??? ???? ??????
+ ??? ??? ?????
+
+ ??? ??? ????? ???????? ?????.
+
+
+ ??? ???? ??????
??? ????? ???? ??????.
From jnewman at winehq.org Mon Sep 10 13:37:59 2012
From: jnewman at winehq.org (Jeremy Newman)
Date: Mon, 10 Sep 2012 13:37:59 -0500
Subject: Kyle Auble : Delete obsolete static status pages
Message-ID:
Module: website
Branch: master
Commit: c78badaabcceb22e9511c5a4711a6433e058d979
URL: http://source.winehq.org/git/website.git/?a=commit;h=c78badaabcceb22e9511c5a4711a6433e058d979
Author: Kyle Auble
Date: Sat Sep 8 20:02:57 2012 -0700
Delete obsolete static status pages
The main entry page with links is still in place.
It may still come in handy, especially if the
wiki status pages are only temporary.
---
templates/en/status/directx.template | 317 -----------
templates/en/status/dlls.template | 918 -------------------------------
templates/en/status/multimedia.template | 257 ---------
templates/en/status/ui.template | 493 -----------------
templates/en/status/wine.template | 624 ---------------------
5 files changed, 0 insertions(+), 2609 deletions(-)
Diff: http://source.winehq.org/git/website.git/?a=commitdiff;h=c78badaabcceb22e9511c5a4711a6433e058d979
From jnewman at winehq.org Mon Sep 10 13:37:59 2012
From: jnewman at winehq.org (Jeremy Newman)
Date: Mon, 10 Sep 2012 13:37:59 -0500
Subject: Kyle Auble : Add IRC details to static page
Message-ID:
Module: website
Branch: master
Commit: 2d8660d190814bca018c1873c62f64eae4f843ec
URL: http://source.winehq.org/git/website.git/?a=commit;h=2d8660d190814bca018c1873c62f64eae4f843ec
Author: Kyle Auble
Date: Sat Sep 8 20:03:12 2012 -0700
Add IRC details to static page
Since IRC channels and policies should be quite
stable, a static page seems more fitting than
a wiki one.
---
templates/en/irc.template | 117 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 105 insertions(+), 12 deletions(-)
diff --git a/templates/en/irc.template b/templates/en/irc.template
index 02c373a..a1a005e 100644
--- a/templates/en/irc.template
+++ b/templates/en/irc.template
@@ -1,19 +1,112 @@
-
-
+
+
-Live Support Chat
+Live Community Chat
-Freenode.net hosts an IRC channel for
-Wine. You can access the chat room using an IRC program such as
-X-Chat. Use the settings listed below.
+Freenode.net hosts multiple IRC
+channels for Wine. You can access the chat rooms using an IRC program such as
+X-Chat with these settings:
- Server: irc.freenode.net
- Port: 6667
- Channel: #winehq
+ Server: irc.freenode.net
+ Port: 6667
-If you use Firefox or any other browser that supports IRC URLs, you can
-join the chat by clicking on irc://irc.freenode.net/winehq.
+Which channel you should pick depends on the issue you want to discuss:
+
+
+ #winehq: User support and help with running Wine
+ #crossover: User support and help with running Crossover
+ #winehackers: Development and other ways of contributing to
+ Wine
+ #winehq-social: Casual, off-topic chats with other community
+ members
+
+
+Those using Firefox, or any other browser that supports IRC URLs, can join
+a chat by clicking on:
+
+
+In order to keep discussions focused and as helpful as possible, also try
+to research your question some before asking about it on the IRC. The
+Wine FAQ,
+AppDB, and
+download page are all good
+resources to check first.
+
+IRC Rules and Penalties
+
+Besides not being offensive or blatantly inconsiderate, there are a few
+simple rules that everyone is expected to follow on the IRC channels. In most
+cases, breaking a rule will be seen as an accident at first and will result in
+warnings. After you have used up your warnings though, you will be kicked from
+the channel.
+
+If you continue to break a rule after using up your kicks, you will be
+banned from the channel for up to 2 hours. Any problems after this will
+result in an indefinite ban, which can only be overturned by appeal. If you
+want to contest a ban, go to #winehq-social (or the
+wine-devel mailing list if you've
+been banned from #winehq-social), and explain why you believe you were
+banned in the first place and why the ban should be lifted.
-
+
+
+ | Rule |
+ Clarification |
+ Warnings |
+ Kicks |
+
+
+ | Do not spam. |
+ |
+ 1 |
+ 2 |
+
+
+ | Use a pastebin for pasting more than 1 or 2 lines. |
+ winehq.pastebin.com and
+ pastebin.ca both work well. |
+ 0 |
+ 5 |
+
+
+ | Talk in the appropriate channel. |
+ If unsure, ask in #winehq which channel to join. |
+ 2 |
+ 3 |
+
+
+ | Only Wine and Crossover are supported in their respective
+ channels. |
+ Sidenet, WineDoors, Cedega, IEs4Linux, etc. are not
+ supported. |
+ 2 |
+ 1 |
+
+
+ | Before asking for help in #winehq, be sure you're running
+ the latest version of Wine. |
+ If unsure, run wine --version in the command line to
+ determine your version |
+ 3 |
+ 1 |
+
+
+ | Please wait your turn for help. |
+ |
+ 3 |
+ 1 |
+
+
+ | Do not discuss pirated software. |
+ |
+ 1 |
+ 1 |
+
+
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : user32: Fix DrawFocusRect to always invert the
destination regardless of the text color .
Message-ID:
Module: wine
Branch: master
Commit: 57f869d5573f6c8165d280cbd7b0cf0f238c6d52
URL: http://source.winehq.org/git/wine.git/?a=commit;h=57f869d5573f6c8165d280cbd7b0cf0f238c6d52
Author: Alexandre Julliard
Date: Sun Sep 9 11:48:06 2012 +0200
user32: Fix DrawFocusRect to always invert the destination regardless of the text color.
---
dlls/user32/uitools.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/uitools.c b/dlls/user32/uitools.c
index 2a3b9e4..f1ce0d6 100644
--- a/dlls/user32/uitools.c
+++ b/dlls/user32/uitools.c
@@ -1507,10 +1507,10 @@ BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc )
hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
lb.lbStyle = BS_SOLID;
- lb.lbColor = GetSysColor(COLOR_WINDOWTEXT);
+ lb.lbColor = 0;
hNewPen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, NULL);
hOldPen = SelectObject(hdc, hNewPen);
- oldDrawMode = SetROP2(hdc, R2_XORPEN);
+ oldDrawMode = SetROP2(hdc, R2_NOT);
oldBkMode = SetBkMode(hdc, TRANSPARENT);
Rectangle(hdc, rc->left, rc->top, rc->right, rc->bottom);
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : comctl32: XOR'ing with a black pen is not useful.
Message-ID:
Module: wine
Branch: master
Commit: 0e9c9772efdbaa3a6240a6eba8450580c48e2ab6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0e9c9772efdbaa3a6240a6eba8450580c48e2ab6
Author: Alexandre Julliard
Date: Sun Sep 9 11:59:51 2012 +0200
comctl32: XOR'ing with a black pen is not useful.
---
dlls/comctl32/header.c | 10 +---------
dlls/comctl32/listview.c | 10 ++--------
2 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 0a40423..d1386e3 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -727,17 +727,9 @@ static void
HEADER_DrawTrackLine (const HEADER_INFO *infoPtr, HDC hdc, INT x)
{
RECT rect;
- HPEN hOldPen;
- INT oldRop;
GetClientRect (infoPtr->hwndSelf, &rect);
-
- hOldPen = SelectObject (hdc, GetStockObject (BLACK_PEN));
- oldRop = SetROP2 (hdc, R2_XORPEN);
- MoveToEx (hdc, x, rect.top, NULL);
- LineTo (hdc, x, rect.bottom);
- SetROP2 (hdc, oldRop);
- SelectObject (hdc, hOldPen);
+ PatBlt( hdc, x, rect.top, 1, rect.bottom - rect.top, DSTINVERT );
}
/***
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 3c9a0cb..b8e1ce3 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9264,21 +9264,15 @@ static BOOL LISTVIEW_Update(LISTVIEW_INFO *infoPtr, INT nItem)
*/
static BOOL LISTVIEW_DrawTrackLine(const LISTVIEW_INFO *infoPtr)
{
- HPEN hOldPen;
HDC hdc;
- INT oldROP;
if (infoPtr->xTrackLine == -1)
return FALSE;
if (!(hdc = GetDC(infoPtr->hwndSelf)))
return FALSE;
- hOldPen = SelectObject(hdc, GetStockObject(BLACK_PEN));
- oldROP = SetROP2(hdc, R2_XORPEN);
- MoveToEx(hdc, infoPtr->xTrackLine, infoPtr->rcList.top, NULL);
- LineTo(hdc, infoPtr->xTrackLine, infoPtr->rcList.bottom);
- SetROP2(hdc, oldROP);
- SelectObject(hdc, hOldPen);
+ PatBlt( hdc, infoPtr->xTrackLine, infoPtr->rcList.top,
+ 1, infoPtr->rcList.bottom - infoPtr->rcList.top, DSTINVERT );
ReleaseDC(infoPtr->hwndSelf, hdc);
return TRUE;
}
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : winex11: Get the information from the drawable
structure in SwapBuffers.
Message-ID:
Module: wine
Branch: master
Commit: b4e3674747230f215ed63f2d536039c1dff9956e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b4e3674747230f215ed63f2d536039c1dff9956e
Author: Alexandre Julliard
Date: Fri Sep 7 21:00:46 2012 +0200
winex11: Get the information from the drawable structure in SwapBuffers.
---
dlls/winex11.drv/opengl.c | 59 +++++++++++++++++++++++----------------------
1 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 6e0c0b7..32a10ac 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3028,7 +3028,9 @@ static void X11DRV_WineGL_LoadExtensions(void)
*/
static BOOL glxdrv_SwapBuffers(PHYSDEV dev)
{
- struct glx_physdev *physdev = get_glxdrv_dev( dev );
+ enum x11drv_escape_codes code = X11DRV_FLUSH_GL_DRAWABLE;
+ struct gl_drawable *gl;
+ HWND hwnd;
struct wgl_context *ctx = NtCurrentTeb()->glContext;
TRACE("(%p)\n", dev->hdc);
@@ -3040,36 +3042,35 @@ static BOOL glxdrv_SwapBuffers(PHYSDEV dev)
return FALSE;
}
- if (!physdev->drawable)
- {
- WARN("Using an invalid drawable, skipping\n");
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
-
sync_context(ctx);
- switch (physdev->type)
- {
- case DC_GL_PIXMAP_WIN:
- if(pglXCopySubBufferMESA) {
- int w = physdev->x11dev->dc_rect.right - physdev->x11dev->dc_rect.left;
- int h = physdev->x11dev->dc_rect.bottom - physdev->x11dev->dc_rect.top;
-
- /* (glX)SwapBuffers has an implicit glFlush effect, however
- * GLX_MESA_copy_sub_buffer doesn't. Make sure GL is flushed before
- * copying */
- pglFlush();
- if(w > 0 && h > 0)
- pglXCopySubBufferMESA(gdi_display, physdev->drawable, 0, 0, w, h);
- break;
- }
- /* fall through */
- default:
- pglXSwapBuffers(gdi_display, physdev->drawable);
- break;
- }
- flush_gl_drawable( physdev );
+ hwnd = WindowFromDC( dev->hdc );
+ EnterCriticalSection( &context_section );
+
+ if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&gl ) ||
+ !XFindContext( gdi_display, (XID)dev->hdc, gl_pbuffer_context, (char **)&gl ))
+ {
+ switch (gl->type)
+ {
+ case DC_GL_PIXMAP_WIN:
+ if (pglXCopySubBufferMESA) {
+ /* (glX)SwapBuffers has an implicit glFlush effect, however
+ * GLX_MESA_copy_sub_buffer doesn't. Make sure GL is flushed before
+ * copying */
+ pglFlush();
+ pglXCopySubBufferMESA( gdi_display, gl->drawable, 0, 0,
+ gl->rect.right - gl->rect.left, gl->rect.bottom - gl->rect.top );
+ break;
+ }
+ /* fall through */
+ default:
+ pglXSwapBuffers(gdi_display, gl->drawable);
+ break;
+ }
+ }
+ LeaveCriticalSection( &context_section );
+
+ ExtEscape( dev->hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
/* FPS support */
if (TRACE_ON(fps))
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : opengl32: Update the extension list.
Message-ID:
Module: wine
Branch: master
Commit: 9713a54b3353bd8072a561ceaf28d48633ba441d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9713a54b3353bd8072a561ceaf28d48633ba441d
Author: Alexandre Julliard
Date: Fri Sep 7 20:53:06 2012 +0200
opengl32: Update the extension list.
---
dlls/opengl32/make_opengl | 2 +
dlls/opengl32/opengl_ext.c | 464 +++++++++++++++++++++++++++++++++++++++----
dlls/opengl32/opengl_norm.c | 136 ++++++++++++-
include/wine/wgl_driver.h | 60 ++++++-
4 files changed, 612 insertions(+), 50 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=9713a54b3353bd8072a561ceaf28d48633ba441d
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : gdi32: Move the SwapBuffers entry point to the
OpenGL driver.
Message-ID:
Module: wine
Branch: master
Commit: 05c32b9b89b2abebde2d665863b4c959b064d064
URL: http://source.winehq.org/git/wine.git/?a=commit;h=05c32b9b89b2abebde2d665863b4c959b064d064
Author: Alexandre Julliard
Date: Fri Sep 7 21:11:55 2012 +0200
gdi32: Move the SwapBuffers entry point to the OpenGL driver.
---
dlls/gdi32/dibdrv/dc.c | 2 --
dlls/gdi32/dibdrv/opengl.c | 9 +++++++++
dlls/gdi32/driver.c | 6 ------
dlls/gdi32/enhmfdrv/init.c | 1 -
dlls/gdi32/freetype.c | 1 -
dlls/gdi32/mfdrv/init.c | 1 -
dlls/gdi32/painting.c | 15 ++-------------
dlls/gdi32/path.c | 1 -
dlls/opengl32/make_opengl | 1 +
dlls/opengl32/opengl_norm.c | 2 ++
dlls/opengl32/wgl.c | 27 +++++++++++++--------------
dlls/wineps.drv/init.c | 1 -
dlls/winex11.drv/init.c | 1 -
dlls/winex11.drv/opengl.c | 31 +++++++++++++------------------
dlls/winex11.drv/xrender.c | 1 -
include/wine/gdi_driver.h | 3 +--
include/wine/wgl_driver.h | 3 ++-
17 files changed, 43 insertions(+), 63 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=05c32b9b89b2abebde2d665863b4c959b064d064
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : winex11: Move the fps tracing to opengl32.
Message-ID:
Module: wine
Branch: master
Commit: 025f4aed1ed67528141f8d709ec1aca76690279a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=025f4aed1ed67528141f8d709ec1aca76690279a
Author: Alexandre Julliard
Date: Fri Sep 7 21:28:15 2012 +0200
winex11: Move the fps tracing to opengl32.
---
dlls/opengl32/wgl.c | 23 ++++++++++++++++++++++-
dlls/winex11.drv/opengl.c | 20 --------------------
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 8ed2a0e..eb24b0f 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -41,6 +41,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
+WINE_DECLARE_DEBUG_CHANNEL(fps);
static HMODULE opengl32_handle;
@@ -603,7 +604,27 @@ BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers( HDC hdc )
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
if (!funcs || !funcs->wgl.p_wglSwapBuffers) return FALSE;
- return funcs->wgl.p_wglSwapBuffers( hdc );
+ if (!funcs->wgl.p_wglSwapBuffers( hdc )) return FALSE;
+
+ if (TRACE_ON(fps))
+ {
+ static long prev_time, start_time;
+ static unsigned long frames, frames_total;
+
+ DWORD time = GetTickCount();
+ frames++;
+ frames_total++;
+ /* every 1.5 seconds */
+ if (time - prev_time > 1500)
+ {
+ TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n",
+ 1000.0*frames/(time - prev_time), 1000.0*frames_total/(time - start_time));
+ prev_time = time;
+ frames = 0;
+ if (start_time == 0) start_time = time;
+ }
+ }
+ return TRUE;
}
/***********************************************************************
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 281c17e..eb9cd7f 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -57,7 +57,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
#ifdef SONAME_LIBGL
WINE_DECLARE_DEBUG_CHANNEL(winediag);
-WINE_DECLARE_DEBUG_CHANNEL(fps);
#include "wine/wgl_driver.h"
#include "wine/wglext.h"
@@ -3067,25 +3066,6 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc )
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
- /* FPS support */
- if (TRACE_ON(fps))
- {
- static long prev_time, start_time;
- static unsigned long frames, frames_total;
-
- DWORD time = GetTickCount();
- frames++;
- frames_total++;
- /* every 1.5 seconds */
- if (time - prev_time > 1500) {
- TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n",
- 1000.0*frames/(time - prev_time), 1000.0*frames_total/(time - start_time));
- prev_time = time;
- frames = 0;
- if(start_time == 0) start_time = time;
- }
- }
-
return ret;
}
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Alexandre Julliard : winex11: Add helper functions to retrieve
drawable information for a window or DC.
Message-ID:
Module: wine
Branch: master
Commit: 115d4881839d5b2c42fdefb449b21668b4fc5b91
URL: http://source.winehq.org/git/wine.git/?a=commit;h=115d4881839d5b2c42fdefb449b21668b4fc5b91
Author: Alexandre Julliard
Date: Fri Sep 7 22:04:33 2012 +0200
winex11: Add helper functions to retrieve drawable information for a window or DC.
---
dlls/winex11.drv/opengl.c | 175 +++++++++++++++++++++------------------------
1 files changed, 81 insertions(+), 94 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=115d4881839d5b2c42fdefb449b21668b4fc5b91
From julliard at winehq.org Mon Sep 10 15:22:09 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:09 -0500
Subject: Marcus Meissner : gdi32: Fixed passed buffer size.
Message-ID:
Module: wine
Branch: master
Commit: f5c5a30724a87b544ee933e198b3e1e07c3a4538
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f5c5a30724a87b544ee933e198b3e1e07c3a4538
Author: Marcus Meissner
Date: Fri Sep 7 20:34:33 2012 +0200
gdi32: Fixed passed buffer size.
---
dlls/gdi32/tests/font.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 26d88ae..3f7af21 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4037,7 +4037,7 @@ static void test_fullname(void)
bufA[0] = 0;
ret = get_ttf_nametable_entry(hdc, TT_NAME_ID_FULL_NAME, bufW, sizeof(bufW), TT_MS_LANGID_ENGLISH_UNITED_STATES);
ok(ret, "face full name could not be read\n");
- WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, sizeof(bufW), NULL, FALSE);
+ WideCharToMultiByte(CP_ACP, 0, bufW, -1, bufA, sizeof(bufA), NULL, FALSE);
ok(!lstrcmpA(bufA, TestName[i]), "font full names don't match: %s != %s\n", TestName[i], bufA);
SelectObject(hdc, of);
DeleteObject(hfont);
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Henri Verbeet : d3d10core: Store the resource in the d3d10core
rendertarget view.
Message-ID:
Module: wine
Branch: master
Commit: 739e302e6f0934b77c40f1cf439806167178feb7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=739e302e6f0934b77c40f1cf439806167178feb7
Author: Henri Verbeet
Date: Sat Sep 8 11:26:23 2012 +0200
d3d10core: Store the resource in the d3d10core rendertarget view.
---
dlls/d3d10core/d3d10core_private.h | 1 +
dlls/d3d10core/view.c | 27 +++++++--------------------
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index 885a2ef..153c5cc 100644
--- a/dlls/d3d10core/d3d10core_private.h
+++ b/dlls/d3d10core/d3d10core_private.h
@@ -140,6 +140,7 @@ struct d3d10_rendertarget_view
struct wined3d_rendertarget_view *wined3d_view;
D3D10_RENDER_TARGET_VIEW_DESC desc;
+ ID3D10Resource *resource;
};
HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view,
diff --git a/dlls/d3d10core/view.c b/dlls/d3d10core/view.c
index d038faa..a542e63 100644
--- a/dlls/d3d10core/view.c
+++ b/dlls/d3d10core/view.c
@@ -339,6 +339,7 @@ static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_Release(ID3D10RenderTarge
if (!refcount)
{
wined3d_rendertarget_view_decref(This->wined3d_view);
+ ID3D10Resource_Release(This->resource);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -383,29 +384,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_SetPrivateDataInterface
static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTargetView *iface,
ID3D10Resource **resource)
{
- struct d3d10_rendertarget_view *This = impl_from_ID3D10RenderTargetView(iface);
- struct wined3d_resource *wined3d_resource;
- IUnknown *parent;
- HRESULT hr;
+ struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface);
TRACE("iface %p, resource %p\n", iface, resource);
- wined3d_resource = wined3d_rendertarget_view_get_resource(This->wined3d_view);
- if (!wined3d_resource)
- {
- ERR("Failed to get wined3d resource.\n");
- *resource = NULL;
- return;
- }
-
- parent = wined3d_resource_get_parent(wined3d_resource);
- hr = IUnknown_QueryInterface(parent, &IID_ID3D10Resource, (void **)&resource);
- if (FAILED(hr))
- {
- ERR("Resource parent isn't a d3d10 resource, hr %#x\n", hr);
- *resource = NULL;
- return;
- }
+ *resource = view->resource;
+ ID3D10Resource_AddRef(*resource);
}
/* ID3D10RenderTargetView methods */
@@ -470,6 +454,9 @@ HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view,
return hr;
}
+ view->resource = resource;
+ ID3D10Resource_AddRef(resource);
+
return S_OK;
}
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Henri Verbeet : wined3d: wined3d_device_set_viewport() never fails.
Message-ID:
Module: wine
Branch: master
Commit: 64aae8cf02d5620d3b78fb9c8d4d9f295d9afe18
URL: http://source.winehq.org/git/wine.git/?a=commit;h=64aae8cf02d5620d3b78fb9c8d4d9f295d9afe18
Author: Henri Verbeet
Date: Sat Sep 8 11:26:24 2012 +0200
wined3d: wined3d_device_set_viewport() never fails.
---
dlls/d3d8/device.c | 5 ++---
dlls/d3d9/device.c | 5 ++---
dlls/ddraw/device.c | 5 ++---
dlls/wined3d/device.c | 6 ++----
include/wine/wined3d.h | 2 +-
5 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 36b8a7e..b4179eb 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1308,16 +1308,15 @@ static HRESULT WINAPI d3d8_device_MultiplyTransform(IDirect3DDevice8 *iface,
static HRESULT WINAPI d3d8_device_SetViewport(IDirect3DDevice8 *iface, const D3DVIEWPORT8 *viewport)
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
/* Note: D3DVIEWPORT8 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_set_viewport(device->wined3d_device, (const struct wined3d_viewport *)viewport);
+ wined3d_device_set_viewport(device->wined3d_device, (const struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d8_device_GetViewport(IDirect3DDevice8 *iface, D3DVIEWPORT8 *viewport)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 0399ba3..6922e81 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1374,16 +1374,15 @@ static HRESULT WINAPI d3d9_device_MultiplyTransform(IDirect3DDevice9Ex *iface,
static HRESULT WINAPI d3d9_device_SetViewport(IDirect3DDevice9Ex *iface, const D3DVIEWPORT9 *viewport)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
/* Note: D3DVIEWPORT9 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_set_viewport(device->wined3d_device, (const struct wined3d_viewport *)viewport);
+ wined3d_device_set_viewport(device->wined3d_device, (const struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d9_device_GetViewport(IDirect3DDevice9Ex *iface, D3DVIEWPORT9 *viewport)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 24bd993..aec30de 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -4992,7 +4992,6 @@ static HRESULT WINAPI d3d_device7_Clear_FPUPreserve(IDirect3DDevice7 *iface, DWO
static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
@@ -5001,10 +5000,10 @@ static HRESULT d3d_device7_SetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *vi
/* Note: D3DVIEWPORT7 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_set_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
+ wined3d_device_set_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d_device7_SetViewport_FPUSetup(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7a57195..7753ae4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2291,7 +2291,7 @@ INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *devi
return device->stateBlock->state.base_vertex_index;
}
-HRESULT CDECL wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport)
+void CDECL wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport)
{
TRACE("device %p, viewport %p.\n", device, viewport);
TRACE("x %u, y %u, w %u, h %u, min_z %.8e, max_z %.8e.\n",
@@ -2304,12 +2304,10 @@ HRESULT CDECL wined3d_device_set_viewport(struct wined3d_device *device, const s
if (device->isRecordingState)
{
TRACE("Recording... not performing anything\n");
- return WINED3D_OK;
+ return;
}
device_invalidate_state(device, STATE_VIEWPORT);
-
- return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index afb007c..fa8b417 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2239,7 +2239,7 @@ HRESULT __cdecl wined3d_device_set_transform(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device,
struct wined3d_vertex_declaration *declaration);
HRESULT __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);
-HRESULT __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
+void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count);
HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device,
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Henri Verbeet : wined3d: wined3d_device_get_viewport() never fails.
Message-ID:
Module: wine
Branch: master
Commit: 3569b6ccd24e329c30693eba7af08f4fd06d7dfa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3569b6ccd24e329c30693eba7af08f4fd06d7dfa
Author: Henri Verbeet
Date: Sat Sep 8 11:26:25 2012 +0200
wined3d: wined3d_device_get_viewport() never fails.
---
dlls/d3d8/device.c | 5 ++---
dlls/d3d9/device.c | 5 ++---
dlls/ddraw/device.c | 5 ++---
dlls/wined3d/device.c | 4 +---
include/wine/wined3d.h | 2 +-
5 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index b4179eb..5a029f2 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1322,16 +1322,15 @@ static HRESULT WINAPI d3d8_device_SetViewport(IDirect3DDevice8 *iface, const D3D
static HRESULT WINAPI d3d8_device_GetViewport(IDirect3DDevice8 *iface, D3DVIEWPORT8 *viewport)
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
/* Note: D3DVIEWPORT8 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
+ wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3DMATERIAL8 *material)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 6922e81..2e33c9f 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1388,16 +1388,15 @@ static HRESULT WINAPI d3d9_device_SetViewport(IDirect3DDevice9Ex *iface, const D
static HRESULT WINAPI d3d9_device_GetViewport(IDirect3DDevice9Ex *iface, D3DVIEWPORT9 *viewport)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
/* Note: D3DVIEWPORT9 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
+ wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr;
+ return D3D_OK;
}
static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D3DMATERIAL9 *material)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index aec30de..7848b0d 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5042,7 +5042,6 @@ static HRESULT WINAPI d3d_device7_SetViewport_FPUPreserve(IDirect3DDevice7 *ifac
static HRESULT d3d_device7_GetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
- HRESULT hr;
TRACE("iface %p, viewport %p.\n", iface, viewport);
@@ -5051,10 +5050,10 @@ static HRESULT d3d_device7_GetViewport(IDirect3DDevice7 *iface, D3DVIEWPORT7 *vi
/* Note: D3DVIEWPORT7 is compatible with struct wined3d_viewport. */
wined3d_mutex_lock();
- hr = wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
+ wined3d_device_get_viewport(device->wined3d_device, (struct wined3d_viewport *)viewport);
wined3d_mutex_unlock();
- return hr_ddraw_from_wined3d(hr);
+ return D3D_OK;
}
static HRESULT WINAPI d3d_device7_GetViewport_FPUSetup(IDirect3DDevice7 *iface, D3DVIEWPORT7 *viewport)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7753ae4..e0849ce 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2310,13 +2310,11 @@ void CDECL wined3d_device_set_viewport(struct wined3d_device *device, const stru
device_invalidate_state(device, STATE_VIEWPORT);
}
-HRESULT CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
+void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport)
{
TRACE("device %p, viewport %p.\n", device, viewport);
*viewport = device->stateBlock->state.viewport;
-
- return WINED3D_OK;
}
HRESULT CDECL wined3d_device_set_render_state(struct wined3d_device *device,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index fa8b417..1fa1342 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2168,7 +2168,7 @@ HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device
HRESULT __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device,
struct wined3d_vertex_declaration **declaration);
struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wined3d_device *device);
-HRESULT __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport);
+void __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport);
HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
UINT start_register, BOOL *constants, UINT bool_count);
HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Henri Verbeet : user32: Implement RegisterRawInputDevices().
Message-ID:
Module: wine
Branch: master
Commit: 5befb959dd6f6e3567f0cd4fabd28b3b3b92966d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5befb959dd6f6e3567f0cd4fabd28b3b3b92966d
Author: Henri Verbeet
Date: Sat Sep 8 11:26:26 2012 +0200
user32: Implement RegisterRawInputDevices().
---
dlls/user32/input.c | 41 +++++++++++++++++++++++++++++++++--
include/wine/server_protocol.h | 26 +++++++++++++++++++++-
server/process.c | 7 ++++++
server/process.h | 7 ++++++
server/protocol.def | 14 ++++++++++++
server/queue.c | 46 ++++++++++++++++++++++++++++++++++++++++
server/request.h | 3 ++
server/trace.c | 26 ++++++++++++++++++++++
8 files changed, 166 insertions(+), 4 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=5befb959dd6f6e3567f0cd4fabd28b3b3b92966d
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Dan Kegel : msvcp90: Handle npos as length in more places.
Message-ID:
Module: wine
Branch: master
Commit: 8e9e82f41eb0470de154d6b6a583fa15ea4ed176
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e9e82f41eb0470de154d6b6a583fa15ea4ed176
Author: Dan Kegel
Date: Sat Sep 8 07:59:44 2012 -0700
msvcp90: Handle npos as length in more places.
---
dlls/msvcp90/string.c | 12 ++++++------
dlls/msvcp90/tests/string.c | 8 +++++++-
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c
index fb2ba1a..740681f 100644
--- a/dlls/msvcp90/string.c
+++ b/dlls/msvcp90/string.c
@@ -1331,7 +1331,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_cstr_len(
if(this->size < pos)
MSVCP__String_base_Xran();
- if(pos+num > this->size)
+ if(num > this->size-pos)
num = this->size-pos;
ans = MSVCP_char_traits_char_compare(basic_string_char_const_ptr(this)+pos,
@@ -1378,7 +1378,7 @@ int __thiscall MSVCP_basic_string_char_compare_substr_substr(
if(compare->size < off)
MSVCP__String_base_Xran();
- if(off+count > compare->size)
+ if(count > compare->size-off)
count = compare->size-off;
return MSVCP_basic_string_char_compare_substr_cstr_len(this, pos, num,
@@ -2017,7 +2017,7 @@ basic_string_char* __thiscall basic_string_char_replace_substr(basic_string_char
if(str->size < str_off)
MSVCP__String_base_Xran();
- if(str_off+str_len > str->size)
+ if(str_len > str->size-str_off)
str_len = str->size-str_off;
return basic_string_char_replace_cstr_len(this, off, len,
@@ -3265,7 +3265,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_cstr_len(
if(this->size < pos)
MSVCP__String_base_Xran();
- if(pos+num > this->size)
+ if(num > this->size-pos)
num = this->size-pos;
ans = MSVCP_char_traits_wchar_compare(basic_string_wchar_const_ptr(this)+pos,
@@ -3318,7 +3318,7 @@ int __thiscall MSVCP_basic_string_wchar_compare_substr_substr(
if(compare->size < off)
MSVCP__String_base_Xran();
- if(off+count > compare->size)
+ if(count > compare->size-off)
count = compare->size-off;
return MSVCP_basic_string_wchar_compare_substr_cstr_len(this, pos, num,
@@ -3980,7 +3980,7 @@ basic_string_wchar* __thiscall basic_string_wchar_replace_substr(basic_string_wc
if(str->size < str_off)
MSVCP__String_base_Xran();
- if(str_off+str_len > str->size)
+ if(str_len > str->size-str_off)
str_len = str->size-str_off;
return basic_string_wchar_replace_cstr_len(this, off, len,
diff --git a/dlls/msvcp90/tests/string.c b/dlls/msvcp90/tests/string.c
index 1e3ccec..511d846 100644
--- a/dlls/msvcp90/tests/string.c
+++ b/dlls/msvcp90/tests/string.c
@@ -17,6 +17,7 @@
*/
#include
+#include
#include
#include
@@ -450,11 +451,12 @@ static void test_basic_string_char_append(void) {
}
static void test_basic_string_char_compare(void) {
- basic_string_char str1, str2;
+ basic_string_char str1, str2, str3;
int ret;
call_func2(p_basic_string_char_ctor_cstr, &str1, "str1str");
call_func2(p_basic_string_char_ctor_cstr, &str2, "str9str");
+ call_func2(p_basic_string_char_ctor_cstr, &str3, "splash.png");
ret = (int)call_func6(p_basic_string_char_compare_substr_substr,
&str1, 0, 3, &str2, 0, 3);
@@ -470,6 +472,9 @@ static void test_basic_string_char_compare(void) {
&str1, 0, 1000, "str1str", 7);
ok(ret == 0, "ret = %d\n", ret);
ret = (int)call_func5(p_basic_string_char_compare_substr_cstr_len,
+ &str3, 6, UINT_MAX, ".png", 4);
+ ok(ret == 0, "ret = %d\n", ret);
+ ret = (int)call_func5(p_basic_string_char_compare_substr_cstr_len,
&str1, 1, 2, "tr", 2);
ok(ret == 0, "ret = %d\n", ret);
ret = (int)call_func5(p_basic_string_char_compare_substr_cstr_len,
@@ -481,6 +486,7 @@ static void test_basic_string_char_compare(void) {
call_func1(p_basic_string_char_dtor, &str1);
call_func1(p_basic_string_char_dtor, &str2);
+ call_func1(p_basic_string_char_dtor, &str3);
}
static void test_basic_string_char_concatenate(void) {
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Dan Kegel : vcomp: Better stub for _vcomp_set_num_threads.
Message-ID:
Module: wine
Branch: master
Commit: e45b5f556a68e00d2ba4eb8269708c3cb9be3309
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e45b5f556a68e00d2ba4eb8269708c3cb9be3309
Author: Dan Kegel
Date: Wed Sep 5 19:05:54 2012 -0700
vcomp: Better stub for _vcomp_set_num_threads.
---
dlls/vcomp/main.c | 5 +++++
dlls/vcomp/vcomp.spec | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c
index 82c8c94..1e51eef 100644
--- a/dlls/vcomp/main.c
+++ b/dlls/vcomp/main.c
@@ -41,6 +41,11 @@ double CDECL omp_get_wtime(void)
return GetTickCount() / 1000.0;
}
+void CDECL _vcomp_set_num_threads(int num_threads)
+{
+ TRACE("(%d): stub\n", num_threads);
+}
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec
index 7a701ef..3e02bea 100644
--- a/dlls/vcomp/vcomp.spec
+++ b/dlls/vcomp/vcomp.spec
@@ -85,7 +85,7 @@
@ stub _vcomp_reduction_u8
@ stub _vcomp_sections_init
@ stub _vcomp_sections_next
-@ stub _vcomp_set_num_threads
+@ cdecl _vcomp_set_num_threads(long)
@ stub _vcomp_single_begin
@ stub _vcomp_single_end
@ stub omp_destroy_lock
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: =?UTF-8?Q?Rico=20Sch=C3=BCller=20?=: winex11.drv: Remove unneeded
variable definition.
Message-ID:
Module: wine
Branch: master
Commit: c67e48b9fa2bdb5e040aecaa4d0bf62b52ca15f1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c67e48b9fa2bdb5e040aecaa4d0bf62b52ca15f1
Author: Rico Sch?ller
Date: Sun Sep 9 11:37:29 2012 +0200
winex11.drv: Remove unneeded variable definition.
---
dlls/winex11.drv/xrandr.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index e17150b..968ff76 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -61,8 +61,6 @@ static RRMode *xrandr12_modes;
#undef MAKE_FUNCPTR
-extern int usexrandr;
-
static struct x11drv_mode_info *dd_modes;
static SizeID *xrandr10_modes;
static unsigned int xrandr_mode_count;
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Marcus Meissner : winecfg: Remove incorrect HeapFree (Coverity).
Message-ID:
Module: wine
Branch: master
Commit: 73d00515fe8354b2549feb1ee157c82cc3197d6a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=73d00515fe8354b2549feb1ee157c82cc3197d6a
Author: Marcus Meissner
Date: Mon Sep 10 09:38:32 2012 +0200
winecfg: Remove incorrect HeapFree (Coverity).
---
programs/winecfg/winecfg.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index fa18e9b..ea116e8 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -503,7 +503,6 @@ static WCHAR **enumerate_valuesW(HKEY root, WCHAR *path)
if (removed) /* this value was deleted by the user, so don't include it */
{
- HeapFree(GetProcessHeap(), 0, name);
i++;
continue;
}
From julliard at winehq.org Mon Sep 10 15:22:10 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:10 -0500
Subject: Jacek Caban : vbscript: Added support for DISPATCH_PROPERTYGET in
invoke_variant_prop.
Message-ID:
Module: wine
Branch: master
Commit: 24f4c09bb6a4b460623084af34c5bf85a88d5fa1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=24f4c09bb6a4b460623084af34c5bf85a88d5fa1
Author: Jacek Caban
Date: Mon Sep 10 10:34:38 2012 +0200
vbscript: Added support for DISPATCH_PROPERTYGET in invoke_variant_prop.
---
dlls/vbscript/tests/run.c | 6 ++++++
dlls/vbscript/vbdisp.c | 1 +
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index 6a2b72a..0e292af 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -300,6 +300,12 @@ static void test_disp(IDispatch *disp)
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
+ dp.cArgs = dp.cNamedArgs = 0;
+ hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
+ ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
+ ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
+
dp.cArgs = 1;
hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c
index a76660e..1b2b8fe 100644
--- a/dlls/vbscript/vbdisp.c
+++ b/dlls/vbscript/vbdisp.c
@@ -103,6 +103,7 @@ static HRESULT invoke_variant_prop(VARIANT *v, WORD flags, DISPPARAMS *dp, VARIA
switch(flags) {
case DISPATCH_PROPERTYGET|DISPATCH_METHOD:
+ case DISPATCH_PROPERTYGET:
if(dp->cArgs) {
WARN("called with arguments\n");
return DISP_E_MEMBERNOTFOUND; /* That's what tests show */
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Jacek Caban : mshtml: Use first script host's GUID as default script
guid.
Message-ID:
Module: wine
Branch: master
Commit: 156e94429d8bbcf73c194e82864cc9ed2bee1771
URL: http://source.winehq.org/git/wine.git/?a=commit;h=156e94429d8bbcf73c194e82864cc9ed2bee1771
Author: Jacek Caban
Date: Mon Sep 10 10:34:52 2012 +0200
mshtml: Use first script host's GUID as default script guid.
---
dlls/mshtml/htmlwindow.c | 1 -
dlls/mshtml/mshtml_private.h | 1 -
dlls/mshtml/script.c | 18 ++++++++++--------
dlls/mshtml/tests/vbtest.html | 15 +++++++++++++--
4 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index bdec9b9..ed1fa2b 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -2721,7 +2721,6 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon,
init_dispex(&window->dispex, (IUnknown*)&window->base.IHTMLWindow2_iface, &HTMLWindow_dispex);
window->task_magic = get_task_target_magic();
- window->current_script_guid = CLSID_JScript;
if(mon) {
IMoniker_AddRef(mon);
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 18496aa..fa4e073 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -388,7 +388,6 @@ struct HTMLInnerWindow {
HTMLDocumentNode *doc;
struct list script_hosts;
- GUID current_script_guid;
IHTMLEventObj *event;
diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c
index 0fe4f5a..9aa875a 100644
--- a/dlls/mshtml/script.c
+++ b/dlls/mshtml/script.c
@@ -641,8 +641,6 @@ static void parse_text(ScriptHost *script_host, LPCWSTR text)
TRACE("%s\n", debugstr_w(text));
- script_host->window->current_script_guid = script_host->guid;
-
VariantInit(&var);
memset(&excepinfo, 0, sizeof(excepinfo));
TRACE(">>>\n");
@@ -722,6 +720,14 @@ static void parse_script_elem(ScriptHost *script_host, nsIDOMHTMLScriptElement *
nsAString_Finish(&src_str);
}
+static GUID get_default_script_guid(HTMLInnerWindow *window)
+{
+ /* If not specified, we should use very first script host that was created for the page (or JScript if none) */
+ return list_empty(&window->script_hosts)
+ ? CLSID_JScript
+ : LIST_ENTRY(list_head(&window->script_hosts), ScriptHost, entry)->guid;
+}
+
static BOOL get_guid_from_type(LPCWSTR type, GUID *guid)
{
const WCHAR text_javascriptW[] =
@@ -790,7 +796,7 @@ static BOOL get_script_guid(HTMLInnerWindow *window, nsIDOMHTMLScriptElement *ns
if(*language) {
ret = get_guid_from_language(language, guid);
}else {
- *guid = window->current_script_guid;
+ *guid = get_default_script_guid(window);
ret = TRUE;
}
}else {
@@ -871,7 +877,7 @@ IDispatch *script_parse_event(HTMLInnerWindow *window, LPCWSTR text)
ptr++;
}else {
ptr = text;
- guid = window->current_script_guid;
+ guid = get_default_script_guid(window);
}
if(IsEqualGUID(&CLSID_JScript, &guid)
@@ -880,8 +886,6 @@ IDispatch *script_parse_event(HTMLInnerWindow *window, LPCWSTR text)
return NULL;
}
- window->current_script_guid = guid;
-
script_host = get_script_host(window, &guid);
if(!script_host || !script_host->parse_proc)
return NULL;
@@ -923,8 +927,6 @@ HRESULT exec_script(HTMLInnerWindow *window, const WCHAR *code, const WCHAR *lan
return E_FAIL;
}
- window->current_script_guid = guid;
-
memset(&ei, 0, sizeof(ei));
TRACE(">>>\n");
hres = IActiveScriptParse_ParseScriptText(script_host->parse, code, NULL, NULL, delimW, 0, 0, SCRIPTTEXT_ISVISIBLE, ret, &ei);
diff --git a/dlls/mshtml/tests/vbtest.html b/dlls/mshtml/tests/vbtest.html
index 7b8cebc..b864abc 100644
--- a/dlls/mshtml/tests/vbtest.html
+++ b/dlls/mshtml/tests/vbtest.html
@@ -12,19 +12,30 @@ End Sub
-
+
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Jacek Caban : mshtml: Check if value is function only when it needs
to be in invoke_builtin_prop .
Message-ID:
Module: wine
Branch: master
Commit: a4869de7fa5e72fe2daed6bdae11b934f4350aa3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a4869de7fa5e72fe2daed6bdae11b934f4350aa3
Author: Jacek Caban
Date: Mon Sep 10 10:35:05 2012 +0200
mshtml: Check if value is function only when it needs to be in invoke_builtin_prop.
---
dlls/mshtml/dispex.c | 12 ++++++------
dlls/mshtml/tests/vbtest.html | 1 +
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index a3ac623..eca45a6 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -979,13 +979,13 @@ static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD
if(FAILED(hres))
return hres;
- if(V_VT(&v) != VT_DISPATCH) {
- FIXME("Not a function %s\n", debugstr_variant(&v));
- VariantClear(&v);
- return E_FAIL;
- }
-
if(flags != (DISPATCH_PROPERTYGET|DISPATCH_METHOD)) {
+ if(V_VT(&v) != VT_DISPATCH) {
+ FIXME("Not a function %s\n", debugstr_variant(&v));
+ VariantClear(&v);
+ return E_FAIL;
+ }
+
hres = invoke_disp_value(This, V_DISPATCH(&v), lcid, flags, dp, res, ei, caller);
IDispatch_Release(V_DISPATCH(&v));
}else if(res) {
diff --git a/dlls/mshtml/tests/vbtest.html b/dlls/mshtml/tests/vbtest.html
index b864abc..f424b38 100644
--- a/dlls/mshtml/tests/vbtest.html
+++ b/dlls/mshtml/tests/vbtest.html
@@ -31,6 +31,7 @@ If true then counter = counter+1
Sub runTest()
Call ok(counter = 6, "counter = " & counter)
+ Call ok(isNull(document.onkeyup), "document.onkeyup is not null")
Call external.reportSuccess()
End Sub
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Jacek Caban : vbscript: Added support for comparing to null.
Message-ID:
Module: wine
Branch: master
Commit: 167174d88b69c8b10c27d08a240c91db9d5088b3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=167174d88b69c8b10c27d08a240c91db9d5088b3
Author: Jacek Caban
Date: Mon Sep 10 10:35:17 2012 +0200
vbscript: Added support for comparing to null.
---
dlls/vbscript/interp.c | 30 ++++++++++++++++++++----------
dlls/vbscript/tests/lang.vbs | 13 +++++++++++++
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index 28c1b14..3a078b5 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -279,6 +279,13 @@ static HRESULT stack_push(exec_ctx_t *ctx, VARIANT *v)
return S_OK;
}
+static inline HRESULT stack_push_null(exec_ctx_t *ctx)
+{
+ VARIANT v;
+ V_VT(&v) = VT_NULL;
+ return stack_push(ctx, &v);
+}
+
static void stack_popn(exec_ctx_t *ctx, unsigned n)
{
while(n--)
@@ -1143,12 +1150,8 @@ static HRESULT interp_empty(exec_ctx_t *ctx)
static HRESULT interp_null(exec_ctx_t *ctx)
{
- VARIANT v;
-
TRACE("\n");
-
- V_VT(&v) = VT_NULL;
- return stack_push(ctx, &v);
+ return stack_push_null(ctx);
}
static HRESULT interp_nothing(exec_ctx_t *ctx)
@@ -1306,11 +1309,6 @@ static HRESULT var_cmp(exec_ctx_t *ctx, VARIANT *l, VARIANT *r)
{
TRACE("%s %s\n", debugstr_variant(l), debugstr_variant(r));
- if(V_VT(l) == VT_NULL || V_VT(r) == VT_NULL) {
- FIXME("comparing nulls is not implemented\n");
- return E_NOTIMPL;
- }
-
/* FIXME: Fix comparing string to number */
return VarCmp(l, r, ctx->script->lcid, 0);
@@ -1345,6 +1343,8 @@ static HRESULT interp_equal(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
@@ -1361,6 +1361,8 @@ static HRESULT interp_nequal(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres != VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
@@ -1377,6 +1379,8 @@ static HRESULT interp_gt(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_GT ? VARIANT_TRUE : VARIANT_FALSE;
@@ -1393,6 +1397,8 @@ static HRESULT interp_gteq(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_GT || hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
@@ -1409,6 +1415,8 @@ static HRESULT interp_lt(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_LT ? VARIANT_TRUE : VARIANT_FALSE;
@@ -1425,6 +1433,8 @@ static HRESULT interp_lteq(exec_ctx_t *ctx)
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
+ if(hres == VARCMP_NULL)
+ return stack_push_null(ctx);
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_LT || hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 2ba3e5a..3e105b6 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -144,6 +144,19 @@ Call ok(1 = 1 < 0, "! 1 = 1 < 0")
Call ok(1 <= 2, "! 1 <= 2")
Call ok(2 <= 2, "! 2 <= 2")
+Call ok(isNull(0 = null), "'(0 = null)' is not null")
+Call ok(isNull(null = 1), "'(null = 1)' is not null")
+Call ok(isNull(0 > null), "'(0 > null)' is not null")
+Call ok(isNull(null > 1), "'(null > 1)' is not null")
+Call ok(isNull(0 < null), "'(0 < null)' is not null")
+Call ok(isNull(null < 1), "'(null < 1)' is not null")
+Call ok(isNull(0 <> null), "'(0 <> null)' is not null")
+Call ok(isNull(null <> 1), "'(null <> 1)' is not null")
+Call ok(isNull(0 >= null), "'(0 >= null)' is not null")
+Call ok(isNull(null >= 1), "'(null >= 1)' is not null")
+Call ok(isNull(0 <= null), "'(0 <= null)' is not null")
+Call ok(isNull(null <= 1), "'(null <= 1)' is not null")
+
x = 3
Call ok(2+2 = 4, "2+2 = " & (2+2))
Call ok(false + 6 + true = 5, "false + 6 + true <> 5")
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Jacek Caban : vbscript: Added support for VT_NULL in stack_pop_bool.
Message-ID:
Module: wine
Branch: master
Commit: 81766a740e1c1816ba3869bf41832a3532ffa819
URL: http://source.winehq.org/git/wine.git/?a=commit;h=81766a740e1c1816ba3869bf41832a3532ffa819
Author: Jacek Caban
Date: Mon Sep 10 10:35:29 2012 +0200
vbscript: Added support for VT_NULL in stack_pop_bool.
---
dlls/vbscript/interp.c | 3 +++
dlls/vbscript/tests/lang.vbs | 6 ++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index 3a078b5..3a5d9b2 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -373,6 +373,9 @@ static int stack_pop_bool(exec_ctx_t *ctx, BOOL *b)
case VT_BOOL:
*b = V_BOOL(val.v);
break;
+ case VT_NULL:
+ *b = FALSE;
+ break;
case VT_I2:
*b = V_I2(val.v);
break;
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 3e105b6..90d5304 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -434,6 +434,12 @@ do while true
next
loop
+if null then call ok(false, "if null evaluated")
+
+while null
+ call ok(false, "while null evaluated")
+wend
+
Call collectionObj.reset()
y = 0
x = 10
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : windowscodecs: Add more tests for PNG metadata.
Message-ID:
Module: wine
Branch: master
Commit: 44e6a494d9d4e225e94b3dca67c9ef3d108d2f34
URL: http://source.winehq.org/git/wine.git/?a=commit;h=44e6a494d9d4e225e94b3dca67c9ef3d108d2f34
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:25:00 2012 +0900
windowscodecs: Add more tests for PNG metadata.
---
dlls/windowscodecs/tests/metadata.c | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index acd9255..807e00a 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -504,9 +504,10 @@ struct test_data
int count; /* if VT_VECTOR */
LONGLONG value[13];
const char *string;
+ const WCHAR id_string[32];
};
-static void compare_ifd_metadata(IWICMetadataReader *reader, const struct test_data *td, ULONG count)
+static void compare_metadata(IWICMetadataReader *reader, const struct test_data *td, ULONG count)
{
HRESULT hr;
IWICEnumMetadataItem *enumerator;
@@ -530,8 +531,13 @@ static void compare_ifd_metadata(IWICMetadataReader *reader, const struct test_d
ok(items_returned == 1, "unexpected item count %u\n", items_returned);
ok(schema.vt == VT_EMPTY, "%u: unexpected vt: %u\n", i, schema.vt);
- ok(id.vt == VT_UI2, "%u: unexpected vt: %u\n", i, id.vt);
- ok(U(id).uiVal == td[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, U(id).uiVal);
+ ok(id.vt == VT_UI2 || id.vt == VT_LPWSTR, "%u: unexpected vt: %u\n", i, id.vt);
+ if (id.vt == VT_UI2)
+ ok(U(id).uiVal == td[i].id, "%u: expected id %#x, got %#x\n", i, td[i].id, U(id).uiVal);
+ else if (id.vt == VT_LPWSTR)
+ ok(!lstrcmpW(td[i].id_string, U(id).pwszVal),
+ "%u: expected %s, got %s\n", i, wine_dbgstr_w(td[i].id_string), wine_dbgstr_w(U(id).pwszVal));
+
ok(value.vt == td[i].type, "%u: expected vt %#x, got %#x\n", i, td[i].type, value.vt);
if (value.vt & VT_VECTOR)
{
@@ -670,7 +676,7 @@ static void test_metadata_IFD(void)
ok(hr == S_OK, "GetCount error %#x\n", hr);
ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count);
- compare_ifd_metadata(reader, td, count);
+ compare_metadata(reader, td, count);
/* test IFD data with different endianness */
if (persist_options == WICPersistOptionsLittleEndian)
@@ -685,7 +691,7 @@ static void test_metadata_IFD(void)
hr = IWICMetadataReader_GetCount(reader, &count);
ok(hr == S_OK, "GetCount error %#x\n", hr);
ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count);
- compare_ifd_metadata(reader, td, count);
+ compare_metadata(reader, td, count);
HeapFree(GetProcessHeap(), 0, IFD_data_swapped);
hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
@@ -864,6 +870,15 @@ todo_wine
static void test_metadata_png(void)
{
+ static const struct test_data td[6] =
+ {
+ { VT_UI2, 0, 0, { 2005 }, NULL, { 'Y','e','a','r',0 } },
+ { VT_UI1, 0, 0, { 6 }, NULL, { 'M','o','n','t','h',0 } },
+ { VT_UI1, 0, 0, { 3 }, NULL, { 'D','a','y',0 } },
+ { VT_UI1, 0, 0, { 15 }, NULL, { 'H','o','u','r',0 } },
+ { VT_UI1, 0, 0, { 7 }, NULL, { 'M','i','n','u','t','e',0 } },
+ { VT_UI1, 0, 0, { 45 }, NULL, { 'S','e','c','o','n','d',0 } }
+ };
IStream *stream;
IWICBitmapDecoder *decoder;
IWICBitmapFrameDecode *frame;
@@ -926,6 +941,12 @@ static void test_metadata_png(void)
broken(IsEqualGUID(&containerformat, &GUID_MetadataFormatUnknown)) /* Windows XP */,
"unexpected container format\n");
+ hr = IWICMetadataReader_GetCount(reader, &count);
+ ok(hr == S_OK, "GetCount error %#x\n", hr);
+ ok(count == 6 || broken(count == 1) /* XP */, "expected 6, got %u\n", count);
+ if (count == 6)
+ compare_metadata(reader, td, count);
+
IWICMetadataReader_Release(reader);
}
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : windowscodecs: Add a bunch of GIF metadata tests.
Message-ID:
Module: wine
Branch: master
Commit: 248e9ef7c96c4e8af6f917c8678943cbe2eb8a3a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=248e9ef7c96c4e8af6f917c8678943cbe2eb8a3a
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:25:47 2012 +0900
windowscodecs: Add a bunch of GIF metadata tests.
---
dlls/windowscodecs/tests/metadata.c | 296 +++++++++++++++++++++++++++++++++++
include/wincodecsdk.idl | 3 +
2 files changed, 299 insertions(+), 0 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=248e9ef7c96c4e8af6f917c8678943cbe2eb8a3a
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : include/wincodecsdk.idl: Fix a typo.
Message-ID:
Module: wine
Branch: master
Commit: 3ea74413c68e0b7e4f720121a2a704ae4f33335e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ea74413c68e0b7e4f720121a2a704ae4f33335e
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:26:31 2012 +0900
include/wincodecsdk.idl: Fix a typo.
---
dlls/windowscodecs/tests/info.c | 4 ++--
include/wincodecsdk.idl | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index 6eb20cb..6c393d7 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -422,7 +422,7 @@ todo_wine
IWICComponentInfo_Release(info);
- hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICXMBStructMetadataReader, &info);
+ hr = IWICImagingFactory_CreateComponentInfo(factory, &CLSID_WICXMPStructMetadataReader, &info);
todo_wine
ok(hr == S_OK, "CreateComponentInfo failed, hr=%x\n", hr);
@@ -440,7 +440,7 @@ todo_wine
hr = IWICMetadataReaderInfo_GetCLSID(reader_info, &clsid);
ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr);
- ok(IsEqualGUID(&CLSID_WICXMBStructMetadataReader, &clsid), "GetCLSID returned wrong result\n");
+ ok(IsEqualGUID(&CLSID_WICXMPStructMetadataReader, &clsid), "GetCLSID returned wrong result\n");
hr = IWICMetadataReaderInfo_GetMetadataFormat(reader_info, &clsid);
ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr);
diff --git a/include/wincodecsdk.idl b/include/wincodecsdk.idl
index db5162a..e681c64 100644
--- a/include/wincodecsdk.idl
+++ b/include/wincodecsdk.idl
@@ -53,7 +53,7 @@ cpp_quote("DEFINE_GUID(CLSID_WICPngTextMetadataReader, 0x4b59afcc,0xb8c3,0x408a,
cpp_quote("DEFINE_GUID(CLSID_WICPngTextMetadataWriter, 0xb5ebafb9,0x253e,0x4a72,0xa7,0x44,0x07,0x62,0xd2,0x68,0x56,0x83);")
cpp_quote("DEFINE_GUID(CLSID_WICIfdMetadataReader, 0x8f914656,0x9d0a,0x4eb2,0x90,0x19,0x0b,0xf9,0x6d,0x8a,0x9e,0xe6);")
cpp_quote("DEFINE_GUID(CLSID_WICExifMetadataReader, 0xd9403860,0x297f,0x4a49,0xbf,0x9b,0x77,0x89,0x81,0x50,0xa4,0x42);")
-cpp_quote("DEFINE_GUID(CLSID_WICXMBStructMetadataReader, 0x01b90d9a,0x8209,0x47f7,0x9c,0x52,0xe1,0x24,0x4b,0xf5,0x0c,0xed);")
+cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataReader, 0x01b90d9a,0x8209,0x47f7,0x9c,0x52,0xe1,0x24,0x4b,0xf5,0x0c,0xed);")
typedef struct WICMetadataPattern {
ULARGE_INTEGER Position;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : include/wincodecsdk.idl: Add some missing metadata
writer UIDs.
Message-ID:
Module: wine
Branch: master
Commit: 847cdf3fd0fe7229ccf2c13d8f98ffb7d826a2d8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=847cdf3fd0fe7229ccf2c13d8f98ffb7d826a2d8
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:26:57 2012 +0900
include/wincodecsdk.idl: Add some missing metadata writer UIDs.
---
include/wincodecsdk.idl | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/wincodecsdk.idl b/include/wincodecsdk.idl
index e681c64..fcf05b6 100644
--- a/include/wincodecsdk.idl
+++ b/include/wincodecsdk.idl
@@ -52,8 +52,11 @@ cpp_quote("DEFINE_GUID(CLSID_WICUnknownMetadataWriter, 0xa09cca86,0x27ba,0x4f39,
cpp_quote("DEFINE_GUID(CLSID_WICPngTextMetadataReader, 0x4b59afcc,0xb8c3,0x408a,0xb6,0x70,0x89,0xe5,0xfa,0xb6,0xfd,0xa7);")
cpp_quote("DEFINE_GUID(CLSID_WICPngTextMetadataWriter, 0xb5ebafb9,0x253e,0x4a72,0xa7,0x44,0x07,0x62,0xd2,0x68,0x56,0x83);")
cpp_quote("DEFINE_GUID(CLSID_WICIfdMetadataReader, 0x8f914656,0x9d0a,0x4eb2,0x90,0x19,0x0b,0xf9,0x6d,0x8a,0x9e,0xe6);")
+cpp_quote("DEFINE_GUID(CLSID_WICIfdMetadataWriter, 0xb1ebfc28,0xc9bd,0x47a2,0x8d,0x33,0xb9,0x48,0x76,0x97,0x77,0xa7);")
cpp_quote("DEFINE_GUID(CLSID_WICExifMetadataReader, 0xd9403860,0x297f,0x4a49,0xbf,0x9b,0x77,0x89,0x81,0x50,0xa4,0x42);")
+cpp_quote("DEFINE_GUID(CLSID_WICExifMetadataWriter, 0xc9a14cda,0xc339,0x460b,0x90,0x78,0xd4,0xde,0xbc,0xfa,0xbe,0x91);")
cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataReader, 0x01b90d9a,0x8209,0x47f7,0x9c,0x52,0xe1,0x24,0x4b,0xf5,0x0c,0xed);")
+cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataWriter, 0x22c21f93,0x7ddb,0x411c,0x9b,0x17,0xc5,0xb7,0xbd,0x06,0x4a,0xbc);")
typedef struct WICMetadataPattern {
ULARGE_INTEGER Position;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : windowscodecs: Add a bunch of tests for Logical
Screen Descriptor metadata reader.
Message-ID:
Module: wine
Branch: master
Commit: 0b0bf572c1e59f95bd8e8a49d32f67ad1ad01b38
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0b0bf572c1e59f95bd8e8a49d32f67ad1ad01b38
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:27:48 2012 +0900
windowscodecs: Add a bunch of tests for Logical Screen Descriptor metadata reader.
---
dlls/windowscodecs/tests/metadata.c | 81 +++++++++++++++++++++++++++++++++++
include/wincodecsdk.idl | 2 +
2 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index 94a3d3e..6ebeb3e 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -1258,6 +1258,86 @@ todo_wine
IWICBitmapDecoder_Release(decoder);
}
+static void test_metadata_LSD(void)
+{
+ static const WCHAR LSD_name[] = {'L','o','g','i','c','a','l',' ','S','c','r','e','e','n',' ','D','e','s','c','r','i','p','t','o','r',' ','R','e','a','d','e','r',0};
+ static const char LSD_data[] = "hello world!\x1\x2\x3\x4\xab\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf";
+ static const struct test_data td[9] =
+ {
+ { VT_UI1|VT_VECTOR, 0, 6, {'w','o','r','l','d','!'}, NULL, { 'S','i','g','n','a','t','u','r','e',0 } },
+ { VT_UI2, 0, 0, { 0x201 }, NULL, { 'W','i','d','t','h',0 } },
+ { VT_UI2, 0, 0, { 0x403 }, NULL, { 'H','e','i','g','h','t',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'G','l','o','b','a','l','C','o','l','o','r','T','a','b','l','e','F','l','a','g',0 } },
+ { VT_UI1, 0, 0, { 2 }, NULL, { 'C','o','l','o','r','R','e','s','o','l','u','t','i','o','n',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'S','o','r','t','F','l','a','g',0 } },
+ { VT_UI1, 0, 0, { 3 }, NULL, { 'G','l','o','b','a','l','C','o','l','o','r','T','a','b','l','e','S','i','z','e',0 } },
+ { VT_UI1, 0, 0, { 6 }, NULL, { 'B','a','c','k','g','r','o','u','n','d','C','o','l','o','r','I','n','d','e','x',0 } },
+ { VT_UI1, 0, 0, { 7 }, NULL, { 'P','i','x','e','l','A','s','p','e','c','t','R','a','t','i','o',0 } }
+ };
+ LARGE_INTEGER pos;
+ HRESULT hr;
+ IStream *stream;
+ IWICPersistStream *persist;
+ IWICMetadataReader *reader;
+ IWICMetadataHandlerInfo *info;
+ WCHAR name[64];
+ UINT count, dummy;
+ GUID format;
+ CLSID id;
+
+ hr = CoCreateInstance(&CLSID_WICLSDMetadataReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICMetadataReader, (void **)&reader);
+todo_wine
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
+ "CoCreateInstance error %#x\n", hr);
+
+ stream = create_stream(LSD_data, sizeof(LSD_data));
+
+ if (SUCCEEDED(hr))
+ {
+ pos.QuadPart = 6;
+ hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
+ ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+
+ hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
+ ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+
+ hr = IWICPersistStream_Load(persist, stream);
+ ok(hr == S_OK, "Load error %#x\n", hr);
+
+ IWICPersistStream_Release(persist);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICMetadataReader_GetCount(reader, &count);
+ ok(hr == S_OK, "GetCount error %#x\n", hr);
+ ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count);
+
+ compare_metadata(reader, td, count);
+
+ hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
+ ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+ ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), "wrong format %s\n", debugstr_guid(&format));
+
+ hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
+ ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+
+ hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
+ ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+ ok(IsEqualGUID(&id, &CLSID_WICLSDMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id));
+
+ hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
+ ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+ ok(lstrcmpW(name, LSD_name) == 0, "wrong LSD reader name %s\n", wine_dbgstr_w(name));
+
+ IWICMetadataHandlerInfo_Release(info);
+ IWICMetadataReader_Release(reader);
+ }
+
+ IStream_Release(stream);
+}
+
START_TEST(metadata)
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -1269,6 +1349,7 @@ START_TEST(metadata)
test_create_reader();
test_metadata_png();
test_metadata_gif();
+ test_metadata_LSD();
CoUninitialize();
}
diff --git a/include/wincodecsdk.idl b/include/wincodecsdk.idl
index fcf05b6..222ae64 100644
--- a/include/wincodecsdk.idl
+++ b/include/wincodecsdk.idl
@@ -57,6 +57,8 @@ cpp_quote("DEFINE_GUID(CLSID_WICExifMetadataReader, 0xd9403860,0x297f,0x4a49,0xb
cpp_quote("DEFINE_GUID(CLSID_WICExifMetadataWriter, 0xc9a14cda,0xc339,0x460b,0x90,0x78,0xd4,0xde,0xbc,0xfa,0xbe,0x91);")
cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataReader, 0x01b90d9a,0x8209,0x47f7,0x9c,0x52,0xe1,0x24,0x4b,0xf5,0x0c,0xed);")
cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataWriter, 0x22c21f93,0x7ddb,0x411c,0x9b,0x17,0xc5,0xb7,0xbd,0x06,0x4a,0xbc);")
+cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataReader, 0x41070793,0x59e4,0x479a,0xa1,0xf7,0x95,0x4a,0xdc,0x2e,0xf5,0xfc);")
+cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataWriter, 0x73c037e7,0xe5d9,0x4954,0x87,0x6a,0x6d,0xa8,0x1d,0x6e,0x57,0x68);")
typedef struct WICMetadataPattern {
ULARGE_INTEGER Position;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : windowscodecs: Add a bunch of tests for Image
Descriptor metadata reader.
Message-ID:
Module: wine
Branch: master
Commit: 7f93e0a6d2b3618b27c25ba36f323c21d32b0cde
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7f93e0a6d2b3618b27c25ba36f323c21d32b0cde
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:28:39 2012 +0900
windowscodecs: Add a bunch of tests for Image Descriptor metadata reader.
---
dlls/windowscodecs/tests/metadata.c | 80 +++++++++++++++++++++++++++++++++++
include/wincodecsdk.idl | 2 +
2 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index 6ebeb3e..fec283e 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -1338,6 +1338,85 @@ todo_wine
IStream_Release(stream);
}
+static void test_metadata_IMD(void)
+{
+ static const WCHAR IMD_name[] = {'I','m','a','g','e',' ','D','e','s','c','r','i','p','t','o','r',' ','R','e','a','d','e','r',0};
+ static const char IMD_data[] = "hello world!\x1\x2\x3\x4\x5\x6\x7\x8\xed\xa\xb\xc\xd\xe\xf";
+ static const struct test_data td[8] =
+ {
+ { VT_UI2, 0, 0, { 0x201 }, NULL, { 'L','e','f','t',0 } },
+ { VT_UI2, 0, 0, { 0x403 }, NULL, { 'T','o','p',0 } },
+ { VT_UI2, 0, 0, { 0x605 }, NULL, { 'W','i','d','t','h',0 } },
+ { VT_UI2, 0, 0, { 0x807 }, NULL, { 'H','e','i','g','h','t',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'L','o','c','a','l','C','o','l','o','r','T','a','b','l','e','F','l','a','g',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'I','n','t','e','r','l','a','c','e','F','l','a','g',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'S','o','r','t','F','l','a','g',0 } },
+ { VT_UI1, 0, 0, { 5 }, NULL, { 'L','o','c','a','l','C','o','l','o','r','T','a','b','l','e','S','i','z','e',0 } }
+ };
+ LARGE_INTEGER pos;
+ HRESULT hr;
+ IStream *stream;
+ IWICPersistStream *persist;
+ IWICMetadataReader *reader;
+ IWICMetadataHandlerInfo *info;
+ WCHAR name[64];
+ UINT count, dummy;
+ GUID format;
+ CLSID id;
+
+ hr = CoCreateInstance(&CLSID_WICIMDMetadataReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICMetadataReader, (void **)&reader);
+todo_wine
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
+ "CoCreateInstance error %#x\n", hr);
+
+ stream = create_stream(IMD_data, sizeof(IMD_data));
+
+ if (SUCCEEDED(hr))
+ {
+ pos.QuadPart = 12;
+ hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
+ ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+
+ hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
+ ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+
+ hr = IWICPersistStream_Load(persist, stream);
+ ok(hr == S_OK, "Load error %#x\n", hr);
+
+ IWICPersistStream_Release(persist);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICMetadataReader_GetCount(reader, &count);
+ ok(hr == S_OK, "GetCount error %#x\n", hr);
+ ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count);
+
+ compare_metadata(reader, td, count);
+
+ hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
+ ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+ ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong format %s\n", debugstr_guid(&format));
+
+ hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
+ ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+
+ hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
+ ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+ ok(IsEqualGUID(&id, &CLSID_WICIMDMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id));
+
+ hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
+ ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+ ok(lstrcmpW(name, IMD_name) == 0, "wrong IMD reader name %s\n", wine_dbgstr_w(name));
+
+ IWICMetadataHandlerInfo_Release(info);
+ IWICMetadataReader_Release(reader);
+ }
+
+ IStream_Release(stream);
+}
+
START_TEST(metadata)
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -1350,6 +1429,7 @@ START_TEST(metadata)
test_metadata_png();
test_metadata_gif();
test_metadata_LSD();
+ test_metadata_IMD();
CoUninitialize();
}
diff --git a/include/wincodecsdk.idl b/include/wincodecsdk.idl
index 222ae64..ce7cf9f 100644
--- a/include/wincodecsdk.idl
+++ b/include/wincodecsdk.idl
@@ -59,6 +59,8 @@ cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataReader, 0x01b90d9a,0x8209,0x47f
cpp_quote("DEFINE_GUID(CLSID_WICXMPStructMetadataWriter, 0x22c21f93,0x7ddb,0x411c,0x9b,0x17,0xc5,0xb7,0xbd,0x06,0x4a,0xbc);")
cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataReader, 0x41070793,0x59e4,0x479a,0xa1,0xf7,0x95,0x4a,0xdc,0x2e,0xf5,0xfc);")
cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataWriter, 0x73c037e7,0xe5d9,0x4954,0x87,0x6a,0x6d,0xa8,0x1d,0x6e,0x57,0x68);")
+cpp_quote("DEFINE_GUID(CLSID_WICIMDMetadataReader, 0x7447a267,0x0015,0x42c8,0xa8,0xf1,0xfb,0x3b,0x94,0xc6,0x83,0x61);")
+cpp_quote("DEFINE_GUID(CLSID_WICIMDMetadataWriter, 0x8c89071f,0x452e,0x4e95,0x96,0x82,0x9d,0x10,0x24,0x62,0x71,0x72);")
typedef struct WICMetadataPattern {
ULARGE_INTEGER Position;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Dmitry Timoshkov : windowscodecs: Add a bunch of tests for Graphic
Control Extension metadata reader.
Message-ID:
Module: wine
Branch: master
Commit: 2b5739269cd3de922994f638591bae2b7405194f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2b5739269cd3de922994f638591bae2b7405194f
Author: Dmitry Timoshkov
Date: Mon Sep 10 16:29:22 2012 +0900
windowscodecs: Add a bunch of tests for Graphic Control Extension metadata reader.
---
dlls/windowscodecs/tests/metadata.c | 77 +++++++++++++++++++++++++++++++++++
include/wincodecsdk.idl | 2 +
2 files changed, 79 insertions(+), 0 deletions(-)
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index fec283e..4bb33ae 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -1417,6 +1417,82 @@ todo_wine
IStream_Release(stream);
}
+static void test_metadata_GCE(void)
+{
+ static const WCHAR GCE_name[] = {'G','r','a','p','h','i','c',' ','C','o','n','t','r','o','l',' ','E','x','t','e','n','s','i','o','n',' ','R','e','a','d','e','r',0};
+ static const char GCE_data[] = "hello world!\xa\x2\x3\x4\x5\x6\x7\x8\xed\xa\xb\xc\xd\xe\xf";
+ static const struct test_data td[5] =
+ {
+ { VT_UI1, 0, 0, { 2 }, NULL, { 'D','i','s','p','o','s','a','l',0 } },
+ { VT_BOOL, 0, 0, { 1 }, NULL, { 'U','s','e','r','I','n','p','u','t','F','l','a','g',0 } },
+ { VT_BOOL, 0, 0, { 0 }, NULL, { 'T','r','a','n','s','p','a','r','e','n','c','y','F','l','a','g',0 } },
+ { VT_UI2, 0, 0, { 0x302 }, NULL, { 'D','e','l','a','y',0 } },
+ { VT_UI1, 0, 0, { 4 }, NULL, { 'T','r','a','n','s','p','a','r','e','n','t','C','o','l','o','r','I','n','d','e','x',0 } }
+ };
+ LARGE_INTEGER pos;
+ HRESULT hr;
+ IStream *stream;
+ IWICPersistStream *persist;
+ IWICMetadataReader *reader;
+ IWICMetadataHandlerInfo *info;
+ WCHAR name[64];
+ UINT count, dummy;
+ GUID format;
+ CLSID id;
+
+ hr = CoCreateInstance(&CLSID_WICGCEMetadataReader, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IWICMetadataReader, (void **)&reader);
+todo_wine
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE || hr == REGDB_E_CLASSNOTREG) /* before Win7 */,
+ "CoCreateInstance error %#x\n", hr);
+
+ stream = create_stream(GCE_data, sizeof(GCE_data));
+
+ if (SUCCEEDED(hr))
+ {
+ pos.QuadPart = 12;
+ hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
+ ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
+
+ hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
+ ok(hr == S_OK, "QueryInterface error %#x\n", hr);
+
+ hr = IWICPersistStream_Load(persist, stream);
+ ok(hr == S_OK, "Load error %#x\n", hr);
+
+ IWICPersistStream_Release(persist);
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICMetadataReader_GetCount(reader, &count);
+ ok(hr == S_OK, "GetCount error %#x\n", hr);
+ ok(count == sizeof(td)/sizeof(td[0]), "unexpected count %u\n", count);
+
+ compare_metadata(reader, td, count);
+
+ hr = IWICMetadataReader_GetMetadataFormat(reader, &format);
+ ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr);
+ ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), "wrong format %s\n", debugstr_guid(&format));
+
+ hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info);
+ ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr);
+
+ hr = IWICMetadataHandlerInfo_GetCLSID(info, &id);
+ ok(hr == S_OK, "GetCLSID error %#x\n", hr);
+ ok(IsEqualGUID(&id, &CLSID_WICGCEMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id));
+
+ hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy);
+ ok(hr == S_OK, "GetFriendlyName error %#x\n", hr);
+ ok(lstrcmpW(name, GCE_name) == 0, "wrong GCE reader name %s\n", wine_dbgstr_w(name));
+
+ IWICMetadataHandlerInfo_Release(info);
+ IWICMetadataReader_Release(reader);
+ }
+
+ IStream_Release(stream);
+}
+
START_TEST(metadata)
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -1430,6 +1506,7 @@ START_TEST(metadata)
test_metadata_gif();
test_metadata_LSD();
test_metadata_IMD();
+ test_metadata_GCE();
CoUninitialize();
}
diff --git a/include/wincodecsdk.idl b/include/wincodecsdk.idl
index ce7cf9f..2a5b389 100644
--- a/include/wincodecsdk.idl
+++ b/include/wincodecsdk.idl
@@ -61,6 +61,8 @@ cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataReader, 0x41070793,0x59e4,0x479a,0xa1
cpp_quote("DEFINE_GUID(CLSID_WICLSDMetadataWriter, 0x73c037e7,0xe5d9,0x4954,0x87,0x6a,0x6d,0xa8,0x1d,0x6e,0x57,0x68);")
cpp_quote("DEFINE_GUID(CLSID_WICIMDMetadataReader, 0x7447a267,0x0015,0x42c8,0xa8,0xf1,0xfb,0x3b,0x94,0xc6,0x83,0x61);")
cpp_quote("DEFINE_GUID(CLSID_WICIMDMetadataWriter, 0x8c89071f,0x452e,0x4e95,0x96,0x82,0x9d,0x10,0x24,0x62,0x71,0x72);")
+cpp_quote("DEFINE_GUID(CLSID_WICGCEMetadataReader, 0xb92e345d,0xf52d,0x41f3,0xb5,0x62,0x08,0x1b,0xc7,0x72,0xe3,0xb9);")
+cpp_quote("DEFINE_GUID(CLSID_WICGCEMetadataWriter, 0xaf95dc76,0x16b2,0x47f4,0xb3,0xea,0x3c,0x31,0x79,0x66,0x93,0xe7);")
typedef struct WICMetadataPattern {
ULARGE_INTEGER Position;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Alexandre Julliard : winex11: Disable client-side rendering for
OpenGL windows.
Message-ID:
Module: wine
Branch: master
Commit: a39659fcc969eb547686e309c9ca4c02b3de13fa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a39659fcc969eb547686e309c9ca4c02b3de13fa
Author: Alexandre Julliard
Date: Mon Sep 10 16:16:05 2012 +0200
winex11: Disable client-side rendering for OpenGL windows.
---
dlls/winex11.drv/opengl.c | 14 ++++++++++++++
dlls/winex11.drv/window.c | 1 +
dlls/winex11.drv/x11drv.h | 1 +
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 9c1f6e5..d04791d 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1135,6 +1135,15 @@ static void release_gl_drawable( struct gl_drawable *gl )
if (gl) LeaveCriticalSection( &context_section );
}
+BOOL has_gl_drawable( HWND hwnd )
+{
+ struct gl_drawable *gl;
+
+ gl = get_gl_drawable( hwnd, 0 );
+ release_gl_drawable( gl );
+ return gl != NULL;
+}
+
static GLXContext create_glxcontext(Display *display, struct wgl_context *context, GLXContext shareList)
{
GLXContext ctx;
@@ -3342,6 +3351,11 @@ BOOL set_win_format( HWND hwnd, XID fbconfig_id )
return FALSE;
}
+BOOL has_gl_drawable( HWND hwnd )
+{
+ return FALSE;
+}
+
void sync_gl_drawable( HWND hwnd, const RECT *visible_rect, const RECT *client_rect )
{
}
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 8774670..16034ea 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -2051,6 +2051,7 @@ void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flag
if (!data->whole_window) return;
if (swp_flags & SWP_HIDEWINDOW) return;
if (data->whole_window == root_window) return;
+ if (has_gl_drawable( hwnd )) return;
if (!client_side_graphics) return;
surface_rect = get_surface_rect( visible_rect );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 73c89ee..1c4c341 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -558,6 +558,7 @@ extern Window X11DRV_get_whole_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL set_win_format( HWND hwnd, XID fbconfig_id ) DECLSPEC_HIDDEN;
+extern BOOL has_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
extern void sync_gl_drawable( HWND hwnd, const RECT *visible_rect, const RECT *client_rect ) DECLSPEC_HIDDEN;
extern void destroy_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Alexandre Julliard : winex11: Remove support for icon windows,
use a default icon instead.
Message-ID:
Module: wine
Branch: master
Commit: 64dc6561cd2b890867f810ac2220d99a04499b2b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=64dc6561cd2b890867f810ac2220d99a04499b2b
Author: Alexandre Julliard
Date: Tue Sep 4 17:14:46 2012 +0200
winex11: Remove support for icon windows, use a default icon instead.
---
dlls/winex11.drv/window.c | 137 ++++++++++++--------------------------------
dlls/winex11.drv/x11drv.h | 1 -
2 files changed, 38 insertions(+), 100 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 16034ea..07f9d26 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -82,7 +82,6 @@ static Window user_time_window;
static const char foreign_window_prop[] = "__wine_x11_foreign_window";
static const char whole_window_prop[] = "__wine_x11_whole_window";
-static const char icon_window_prop[] = "__wine_x11_icon_window";
static const char clip_window_prop[] = "__wine_x11_clip_window";
static const char managed_prop[] = "__wine_x11_managed";
@@ -449,48 +448,6 @@ static void sync_window_text( Display *display, Window win, const WCHAR *text )
/***********************************************************************
- * create_icon_window
- */
-static Window create_icon_window( Display *display, struct x11drv_win_data *data )
-{
- XSetWindowAttributes attr;
-
- attr.event_mask = (ExposureMask | KeyPressMask | KeyReleaseMask | PointerMotionMask |
- ButtonPressMask | ButtonReleaseMask | EnterWindowMask);
- attr.bit_gravity = NorthWestGravity;
- attr.backing_store = NotUseful/*WhenMapped*/;
- attr.colormap = X11DRV_PALETTE_PaletteXColormap; /* Needed due to our visual */
-
- data->icon_window = XCreateWindow( display, root_window, 0, 0,
- GetSystemMetrics( SM_CXICON ),
- GetSystemMetrics( SM_CYICON ),
- 0, screen_depth,
- InputOutput, visual,
- CWEventMask | CWBitGravity | CWBackingStore | CWColormap, &attr );
- XSaveContext( display, data->icon_window, winContext, (char *)data->hwnd );
- XFlush( display ); /* make sure the window exists before we start painting to it */
-
- TRACE( "created %lx\n", data->icon_window );
- SetPropA( data->hwnd, icon_window_prop, (HANDLE)data->icon_window );
- return data->icon_window;
-}
-
-
-
-/***********************************************************************
- * destroy_icon_window
- */
-static void destroy_icon_window( Display *display, struct x11drv_win_data *data )
-{
- if (!data->icon_window) return;
- XDeleteContext( display, data->icon_window, winContext );
- XDestroyWindow( display, data->icon_window );
- data->icon_window = 0;
- RemovePropA( data->hwnd, icon_window_prop );
-}
-
-
-/***********************************************************************
* get_bitmap_argb
*
* Return the bitmap bits in ARGB format. Helper for setting icon hints.
@@ -624,11 +581,16 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data,
HICON icon_big, HICON icon_small )
{
XWMHints *hints = data->wm_hints;
+ ICONINFO ii, ii_small;
+ HDC hDC;
+ unsigned int size;
+ unsigned long *bits;
if (!icon_big)
{
icon_big = (HICON)SendMessageW( data->hwnd, WM_GETICON, ICON_BIG, 0 );
if (!icon_big) icon_big = (HICON)GetClassLongPtrW( data->hwnd, GCLP_HICON );
+ if (!icon_big) icon_big = LoadIconW( 0, (LPWSTR)IDI_WINLOGO );
}
if (!icon_small)
{
@@ -640,63 +602,46 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data,
if (data->icon_mask) XFreePixmap( gdi_display, data->icon_mask );
data->icon_pixmap = data->icon_mask = 0;
- if (!icon_big)
- {
- if (!data->icon_window) create_icon_window( display, data );
- hints->icon_window = data->icon_window;
- hints->flags = (hints->flags & ~(IconPixmapHint | IconMaskHint)) | IconWindowHint;
- }
- else
- {
- ICONINFO ii, ii_small;
- HDC hDC;
- unsigned int size;
- unsigned long *bits;
+ if (!GetIconInfo(icon_big, &ii)) return;
- if (!GetIconInfo(icon_big, &ii)) return;
+ hDC = CreateCompatibleDC(0);
+ bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size );
+ if (bits && GetIconInfo( icon_small, &ii_small ))
+ {
+ unsigned int size_small;
+ unsigned long *bits_small, *new;
- hDC = CreateCompatibleDC(0);
- bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size );
- if (bits && GetIconInfo( icon_small, &ii_small ))
+ if ((bits_small = get_bitmap_argb( hDC, ii_small.hbmColor, ii_small.hbmMask, &size_small )) &&
+ (bits_small[0] != bits[0] || bits_small[1] != bits[1])) /* size must be different */
{
- unsigned int size_small;
- unsigned long *bits_small, *new;
-
- if ((bits_small = get_bitmap_argb( hDC, ii_small.hbmColor, ii_small.hbmMask, &size_small )) &&
- (bits_small[0] != bits[0] || bits_small[1] != bits[1])) /* size must be different */
+ if ((new = HeapReAlloc( GetProcessHeap(), 0, bits,
+ (size + size_small) * sizeof(unsigned long) )))
{
- if ((new = HeapReAlloc( GetProcessHeap(), 0, bits,
- (size + size_small) * sizeof(unsigned long) )))
- {
- bits = new;
- memcpy( bits + size, bits_small, size_small * sizeof(unsigned long) );
- size += size_small;
- }
+ bits = new;
+ memcpy( bits + size, bits_small, size_small * sizeof(unsigned long) );
+ size += size_small;
}
- HeapFree( GetProcessHeap(), 0, bits_small );
- DeleteObject( ii_small.hbmColor );
- DeleteObject( ii_small.hbmMask );
}
- if (bits)
- XChangeProperty( display, data->whole_window, x11drv_atom(_NET_WM_ICON),
- XA_CARDINAL, 32, PropModeReplace, (unsigned char *)bits, size );
- else
- XDeleteProperty( display, data->whole_window, x11drv_atom(_NET_WM_ICON) );
- HeapFree( GetProcessHeap(), 0, bits );
-
- if (create_icon_pixmaps( hDC, &ii, data ))
- {
- hints->icon_pixmap = data->icon_pixmap;
- hints->icon_mask = data->icon_mask;
- hints->flags |= IconPixmapHint | IconMaskHint;
- }
- destroy_icon_window( display, data );
- hints->flags &= ~IconWindowHint;
+ HeapFree( GetProcessHeap(), 0, bits_small );
+ DeleteObject( ii_small.hbmColor );
+ DeleteObject( ii_small.hbmMask );
+ }
+ if (bits)
+ XChangeProperty( display, data->whole_window, x11drv_atom(_NET_WM_ICON),
+ XA_CARDINAL, 32, PropModeReplace, (unsigned char *)bits, size );
+ else
+ XDeleteProperty( display, data->whole_window, x11drv_atom(_NET_WM_ICON) );
+ HeapFree( GetProcessHeap(), 0, bits );
- DeleteObject( ii.hbmColor );
- DeleteObject( ii.hbmMask );
- DeleteDC(hDC);
+ if (create_icon_pixmaps( hDC, &ii, data ))
+ {
+ hints->icon_pixmap = data->icon_pixmap;
+ hints->icon_mask = data->icon_mask;
+ hints->flags |= IconPixmapHint | IconMaskHint;
}
+ DeleteObject( ii.hbmColor );
+ DeleteObject( ii.hbmMask );
+ DeleteDC(hDC);
}
@@ -1518,7 +1463,6 @@ void CDECL X11DRV_DestroyWindow( HWND hwnd )
destroy_gl_drawable( hwnd );
destroy_whole_window( thread_data->display, data, FALSE );
- destroy_icon_window( thread_data->display, data );
if (thread_data->last_focus == hwnd) thread_data->last_focus = 0;
if (thread_data->last_xic_hwnd == hwnd) thread_data->last_xic_hwnd = 0;
@@ -1864,11 +1808,7 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
if (top == hwnd)
{
- if (data && IsIconic( hwnd ) && data->icon_window)
- {
- escape.drawable = data->icon_window;
- }
- else escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd );
+ escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd );
/* special case: when repainting the root window, clip out top-level windows */
if (data && data->whole_window == root_window) escape.mode = ClipByChildren;
@@ -1962,7 +1902,6 @@ void CDECL X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent )
{
/* destroy the old X windows */
destroy_whole_window( display, data, FALSE );
- destroy_icon_window( display, data );
if (data->managed)
{
data->managed = FALSE;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 1c4c341..c637a67 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -533,7 +533,6 @@ struct x11drv_win_data
{
HWND hwnd; /* hwnd that this private data belongs to */
Window whole_window; /* X window for the complete window */
- Window icon_window; /* X window for the icon */
RECT window_rect; /* USER window rectangle relative to parent */
RECT whole_rect; /* X window rectangle for the whole window relative to parent */
RECT client_rect; /* client area relative to parent */
From julliard at winehq.org Mon Sep 10 15:22:11 2012
From: julliard at winehq.org (Alexandre Julliard)
Date: Mon, 10 Sep 2012 15:22:11 -0500
Subject: Jacek Caban : mshtml: Added support for
DISPATCH_METHOD|DISPATCH_PROPERTYGET flags in
HTMLDocumentNode_invoke .
Message-ID:
Module: wine
Branch: master
Commit: bdcc88a3968deb0bc50f82aeec72018f041b7176
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bdcc88a3968deb0bc50f82aeec72018f041b7176
Author: Jacek Caban
Date: Mon Sep 10 14:41:09 2012 +0200
mshtml: Added support for DISPATCH_METHOD|DISPATCH_PROPERTYGET flags in HTMLDocumentNode_invoke.
---
dlls/mshtml/htmldoc.c | 2 +-
dlls/mshtml/tests/vbtest.html | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 86615df..a6bb56d 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -2183,7 +2183,7 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
nsresult nsres;
HRESULT hres;
- if(flags != DISPATCH_PROPERTYGET) {
+ if(flags != DISPATCH_PROPERTYGET && flags != (DISPATCH_METHOD|DISPATCH_PROPERTYGET)) {
FIXME("unsupported flags %x\n", flags);
return E_NOTIMPL;
}
diff --git a/dlls/mshtml/tests/vbtest.html b/dlls/mshtml/tests/vbtest.html
index f424b38..f023f98 100644
--- a/dlls/mshtml/tests/vbtest.html
+++ b/dlls/mshtml/tests/vbtest.html
@@ -32,6 +32,7 @@ If true then counter = counter+1
Sub runTest()
Call ok(counter = 6, "counter = " & counter)
Call ok(isNull(document.onkeyup), "document.onkeyup is not null")
+ Call ok(document.formname.tagName = "FORM", "document.form.tagName = " & document.formname.tagName)
Call external.reportSuccess()
End Sub
@@ -39,5 +40,6 @@ End Sub
// We're in javascript
+
|