You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d5c85dc450 | ||
|
a78e9f3998 | ||
|
05c875caa5 | ||
|
a2170c577b | ||
|
d8260944be | ||
|
f76ea979db | ||
|
e4078c26a2 | ||
|
b0595d928b | ||
|
6a6e7da97e | ||
|
56d40e2349 | ||
|
2f18b0cd6d | ||
|
0d13d81503 | ||
|
a4b239f15e | ||
|
0f06925bd9 | ||
|
cd8789cb1f | ||
|
3dd9038110 | ||
|
a051432871 | ||
|
6919d12eba | ||
|
ff5ea043b5 | ||
|
e7edc67e91 | ||
|
4c85dbb157 | ||
|
95f743ef8b | ||
|
804145a02a | ||
|
b682f11906 | ||
|
c5ff81413f | ||
|
58ef511299 | ||
|
a9bf69097e | ||
|
0c32c319e2 | ||
|
c33355e3b7 | ||
|
127b7fafb4 | ||
|
054ecfb60a | ||
|
85146f009d | ||
|
8fc0710def | ||
|
e84e5d31e9 | ||
|
1f578b2d53 | ||
|
164a792cb2 |
12
.github/workflows/macOS.yml
vendored
12
.github/workflows/macOS.yml
vendored
@@ -7,17 +7,20 @@ on:
|
||||
|
||||
jobs:
|
||||
wine-staging:
|
||||
runs-on: macos-latest
|
||||
# https://github.com/actions/runner-images/issues/9741
|
||||
runs-on: macos-13
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install --cask xquartz
|
||||
brew install bison \
|
||||
brew install autoconf \
|
||||
bison \
|
||||
gphoto2 \
|
||||
gst-plugins-base \
|
||||
gstreamer \
|
||||
gcenx/wine/libinotify-kqueue \
|
||||
mingw-w64 \
|
||||
molten-vk \
|
||||
sdl2
|
||||
@@ -52,7 +55,6 @@ jobs:
|
||||
--without-alsa \
|
||||
--without-capi \
|
||||
--without-dbus \
|
||||
--without-inotify \
|
||||
--without-oss \
|
||||
--without-pulse \
|
||||
--without-udev \
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 683fab1d88342c11a52ac3b919964837e6f36823 Mon Sep 17 00:00:00 2001
|
||||
From ef7171d2eb01b4b8aaf8c4c608ceebd698d96e3c Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:26 +0100
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
@@ -66,15 +66,15 @@ index 75cd72b5b9f..314123373b7 100644
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
|
||||
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
|
||||
index dced9847390..e86e1945bdd 100644
|
||||
index c0ac5ba9a44..e171c1c6bd8 100644
|
||||
--- a/dlls/d2d1/d2d1_private.h
|
||||
+++ b/dlls/d2d1/d2d1_private.h
|
||||
@@ -697,7 +697,7 @@ struct d2d_factory
|
||||
|
||||
static inline struct d2d_factory *unsafe_impl_from_ID2D1Factory(ID2D1Factory *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory3_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Factory3*)iface, struct d2d_factory, ID2D1Factory3_iface);
|
||||
- return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory7_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Factory7*)iface, struct d2d_factory, ID2D1Factory7_iface);
|
||||
}
|
||||
|
||||
void d2d_effects_init_builtins(struct d2d_factory *factory);
|
||||
|
@@ -1,41 +0,0 @@
|
||||
From 32ae090ad4a99862a420cfe44847d8e2905cdde7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 21 Dec 2013 23:57:02 +0100
|
||||
Subject: winex11: Implement X11DRV_FLUSH_GDI_DISPLAY ExtEscape command
|
||||
|
||||
---
|
||||
dlls/winex11.drv/init.c | 3 +++
|
||||
dlls/winex11.drv/x11drv.h | 3 ++-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
|
||||
index 5a7d316..68d3f96 100644
|
||||
--- a/dlls/winex11.drv/init.c
|
||||
+++ b/dlls/winex11.drv/init.c
|
||||
@@ -440,6 +440,9 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
+ case X11DRV_FLUSH_GDI_DISPLAY:
|
||||
+ XFlush( gdi_display );
|
||||
+ return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
|
||||
index 9008db6..85dd2a5 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -277,7 +277,8 @@ enum x11drv_escape_codes
|
||||
X11DRV_GET_DRAWABLE, /* get current drawable for a DC */
|
||||
X11DRV_START_EXPOSURES, /* start graphics exposures */
|
||||
X11DRV_END_EXPOSURES, /* end graphics exposures */
|
||||
- X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */
|
||||
+ X11DRV_FLUSH_GL_DRAWABLE, /* flush changes made to the gl drawable */
|
||||
+ X11DRV_FLUSH_GDI_DISPLAY /* flush the gdi display */
|
||||
};
|
||||
|
||||
struct x11drv_escape_set_drawable
|
||||
--
|
||||
1.7.9.5
|
||||
|
@@ -1,25 +0,0 @@
|
||||
From ebe00ceb4f2d24f2611dbec87486d6597a3466a9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 2 May 2014 20:46:19 +0200
|
||||
Subject: [PATCH] user32: Decrease minimum SetTimer interval to 5 ms. (try 2)
|
||||
|
||||
---
|
||||
dlls/win32u/message.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
|
||||
index d2909339983..337d4a2cc1d 100644
|
||||
--- a/dlls/win32u/message.c
|
||||
+++ b/dlls/win32u/message.c
|
||||
@@ -3975,7 +3975,7 @@ UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
|
||||
|
||||
if (proc) winproc = alloc_winproc( (WNDPROC)proc, TRUE );
|
||||
|
||||
- timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM );
|
||||
+ timeout = min( max( 5, timeout ), USER_TIMER_MAXIMUM );
|
||||
|
||||
SERVER_START_REQ( set_win_timer )
|
||||
{
|
||||
--
|
||||
2.42.0
|
||||
|
@@ -1,46 +0,0 @@
|
||||
From a9cf27a493697c97249ce526483d25c871c053c4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 1 Jun 2014 22:51:32 +0200
|
||||
Subject: [PATCH] winex11.drv: Indicate direct rendering through OpenGL
|
||||
extension
|
||||
|
||||
---
|
||||
dlls/winex11.drv/opengl.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
|
||||
index 92555841f71..71e7ecbcf7c 100644
|
||||
--- a/dlls/winex11.drv/opengl.c
|
||||
+++ b/dlls/winex11.drv/opengl.c
|
||||
@@ -410,6 +410,7 @@ static int GLXErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
|
||||
static BOOL X11DRV_WineGL_InitOpenglInfo(void)
|
||||
{
|
||||
static const char legacy_extensions[] = " WGL_EXT_extensions_string WGL_EXT_swap_control";
|
||||
+ static const char direct_extension[] = " WINE_EXT_direct_rendering";
|
||||
|
||||
int screen = DefaultScreen(gdi_display);
|
||||
Window win = 0, root = 0;
|
||||
@@ -465,16 +466,18 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
|
||||
}
|
||||
gl_renderer = (const char *)opengl_funcs.gl.p_glGetString(GL_RENDERER);
|
||||
gl_version = (const char *)opengl_funcs.gl.p_glGetString(GL_VERSION);
|
||||
+ glx_direct = pglXIsDirect(gdi_display, ctx);
|
||||
str = (const char *) opengl_funcs.gl.p_glGetString(GL_EXTENSIONS);
|
||||
- glExtensions = malloc( strlen(str) + sizeof(legacy_extensions) );
|
||||
+ glExtensions = malloc( strlen(str)+sizeof(legacy_extensions)+sizeof(direct_extension) );
|
||||
strcpy(glExtensions, str);
|
||||
strcat(glExtensions, legacy_extensions);
|
||||
+ if (glx_direct)
|
||||
+ strcat(glExtensions, direct_extension);
|
||||
|
||||
/* Get the common GLX version supported by GLX client and server ( major/minor) */
|
||||
pglXQueryVersion(gdi_display, &glxVersion[0], &glxVersion[1]);
|
||||
|
||||
glxExtensions = pglXQueryExtensionsString(gdi_display, screen);
|
||||
- glx_direct = pglXIsDirect(gdi_display, ctx);
|
||||
|
||||
TRACE("GL version : %s.\n", gl_version);
|
||||
TRACE("GL renderer : %s.\n", gl_renderer);
|
||||
--
|
||||
2.35.1
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: Reduced SetTimer minimum value from 10 ms to 5 ms (improves Silverlight framerates)
|
||||
Fixes: Other Pipelight-specific enhancements
|
@@ -0,0 +1,182 @@
|
||||
From ae80ae124a784078a9838a8aca4b3af308d645dd Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
Date: Fri, 30 Sep 2022 17:58:15 -0400
|
||||
Subject: [PATCH] d3dx9: Implement d3dx_effect_SetRawValue
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46012
|
||||
|
||||
Signed-off-by: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/effect.c | 154 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 152 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
|
||||
index ea965ce789b..625af4af36b 100644
|
||||
--- a/dlls/d3dx9_36/effect.c
|
||||
+++ b/dlls/d3dx9_36/effect.c
|
||||
@@ -4445,10 +4445,160 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevic
|
||||
static HRESULT WINAPI d3dx_effect_SetRawValue(ID3DXEffect *iface, D3DXHANDLE parameter, const void *data,
|
||||
UINT byte_offset, UINT bytes)
|
||||
{
|
||||
- FIXME("iface %p, parameter %p, data %p, byte_offset %u, bytes %u stub!\n",
|
||||
+ struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
|
||||
+ struct d3dx_parameter *param = (parameter == INVALID_HANDLE_VALUE) ? NULL : get_valid_parameter(effect, parameter);
|
||||
+ const unsigned int single_size = sizeof(DWORD);
|
||||
+ unsigned int x, index_offset, remaining_byte_offset, remaining_bytes;
|
||||
+ void *raw;
|
||||
+
|
||||
+ TRACE("iface %p, parameter %p, data %p, byte_offset %u, bytes %u.\n",
|
||||
iface, parameter, data, byte_offset, bytes);
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ /* pendentic */
|
||||
+ index_offset = 0;
|
||||
+ remaining_byte_offset = 0;
|
||||
+
|
||||
+ /* BOOLs and Matries with a single value copy require sanitization of the
|
||||
+ byte_offset.
|
||||
+
|
||||
+ Specificly, matries with a single value copy only allow byte shifts that
|
||||
+ are not multiples of the value (DWORD) size. For multiples, we increment
|
||||
+ the index of the promoted data type, then add any remainder as a byte
|
||||
+ offset.
|
||||
+
|
||||
+ For BOOLs, due to their value sanitization, we only care about the
|
||||
+ index of their promoted data type. Unless it's a non value size matrix.
|
||||
+ In that case we do care about the byte offset.
|
||||
+ */
|
||||
+ if (byte_offset > 0 && (param->type == D3DXPT_BOOL ||
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ remaining_byte_offset = byte_offset % single_size;
|
||||
+ if (remaining_byte_offset != 0)
|
||||
+ index_offset = byte_offset / single_size;
|
||||
+ else
|
||||
+ index_offset = byte_offset;
|
||||
+ if (param->type != D3DXPT_BOOL || (bytes != single_size &&
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ if (param->type != D3DXPT_BOOL)
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* If parameter is bad, we are expected to throw C0000005. */
|
||||
+ switch (param->class)
|
||||
+ {
|
||||
+ case D3DXPC_STRUCT:
|
||||
+ break;
|
||||
+ case D3DXPC_OBJECT:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (data && bytes)
|
||||
+ {
|
||||
+ if (((char*)raw)[0] != '\0')
|
||||
+ {
|
||||
+ memset(raw, '\0', param->bytes);
|
||||
+ return S_OK; /* This returns a false success. */
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case D3DXPC_SCALAR:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ *(BOOL*)raw = *(BOOL*)data ? TRUE : FALSE;
|
||||
+ else
|
||||
+ memcpy((unsigned char*)raw + byte_offset, data, bytes);
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_VECTOR:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', param->bytes - index_offset - single_size);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_MATRIX_COLUMNS:
|
||||
+ case D3DXPC_MATRIX_ROWS:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ remaining_bytes = param->bytes - index_offset - \
|
||||
+ (x * single_size) - single_size;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes));
|
||||
+ raw = (unsigned char*)raw + (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ ((DWORD*)raw)[x] = ((DWORD*)data)[x] ? TRUE : FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset + remaining_byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; byte_offset + (x * single_size) < param->bytes &&
|
||||
+ (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME("Unhandled param class %s.\n", debug_d3dxparameter_class(param->class));
|
||||
+ break;
|
||||
+ };
|
||||
+
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
File diff suppressed because it is too large
Load Diff
3
patches/d3dx9_SetRawValue/definition
Normal file
3
patches/d3dx9_SetRawValue/definition
Normal file
@@ -0,0 +1,3 @@
|
||||
Fixes: [46012] d3d9: Implement ID3DXEffect::SetRawValue
|
||||
|
||||
# https://gitlab.winehq.org/wine/wine/-/merge_requests/979
|
@@ -1,4 +1,4 @@
|
||||
From 2c5da9b35cb387a1ca09fe49f662189536ee664a Mon Sep 17 00:00:00 2001
|
||||
From 274e40a7f25d8041f5b93d132f01e0a66fefe481 Mon Sep 17 00:00:00 2001
|
||||
From: Matthew Wong <itsmattkc@gmail.com>
|
||||
Date: Fri, 18 Sep 2020 00:47:13 +0000
|
||||
Subject: [PATCH] ddraw: Implement Pick() and GetPickRecords().
|
||||
@@ -31,10 +31,10 @@ Signed-off-by: Matthew Wong <itsmattkc@gmail.com>
|
||||
Signed-off-by: Myah Caron <qsniyg@protonmail.com>
|
||||
---
|
||||
dlls/ddraw/ddraw_private.h | 7 +-
|
||||
dlls/ddraw/device.c | 77 ++++++++++++----
|
||||
dlls/ddraw/device.c | 67 ++++++++++++--
|
||||
dlls/ddraw/executebuffer.c | 176 ++++++++++++++++++++++++++++++++++++-
|
||||
dlls/ddraw/tests/ddraw1.c | 133 ++++++++++++++++++++++++++++
|
||||
4 files changed, 372 insertions(+), 21 deletions(-)
|
||||
4 files changed, 373 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
|
||||
index 1f0c94a9c6e..157384e3579 100644
|
||||
@@ -62,30 +62,20 @@ index 1f0c94a9c6e..157384e3579 100644
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexBuffer
|
||||
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
|
||||
index f64db3aa633..fe29bf0d16e 100644
|
||||
index f64db3aa633..60c43c250b1 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -321,17 +321,8 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
|
||||
IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
|
||||
@@ -333,6 +333,9 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
|
||||
This->ddraw = NULL;
|
||||
}
|
||||
|
||||
- wined3d_stateblock_decref(This->state);
|
||||
- if (This->recording)
|
||||
- wined3d_stateblock_decref(This->recording);
|
||||
-
|
||||
- /* Releasing the render target below may release the last reference to the ddraw object. Detach
|
||||
- * the device from it before so it doesn't try to save / restore state on the teared down device. */
|
||||
- if (This->ddraw)
|
||||
- {
|
||||
- list_remove(&This->ddraw_entry);
|
||||
- This->ddraw = NULL;
|
||||
- }
|
||||
+ if (This->pick_record_size > 0)
|
||||
+ free(This->pick_records);
|
||||
|
||||
+
|
||||
TRACE("Releasing render target %p.\n", This->rt_iface);
|
||||
rt_iface = This->rt_iface;
|
||||
@@ -739,7 +730,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface,
|
||||
This->rt_iface = NULL;
|
||||
@@ -739,7 +742,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface,
|
||||
|
||||
/* Execute... */
|
||||
wined3d_mutex_lock();
|
||||
@@ -94,7 +84,7 @@ index f64db3aa633..fe29bf0d16e 100644
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
@@ -1006,16 +997,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface,
|
||||
@@ -1006,16 +1009,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface,
|
||||
* x2 and y2 are ignored.
|
||||
*
|
||||
* Returns:
|
||||
@@ -143,7 +133,7 @@ index f64db3aa633..fe29bf0d16e 100644
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1031,13 +1050,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB
|
||||
@@ -1031,13 +1062,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB
|
||||
* D3DPickRec: Address to store the resulting D3DPICKRECORD array.
|
||||
*
|
||||
* Returns:
|
||||
@@ -397,10 +387,10 @@ index 0cf0bf121f3..89915fb7145 100644
|
||||
static inline struct d3d_execute_buffer *impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
|
||||
{
|
||||
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
|
||||
index 0940aa8d78a..faf4e2b7694 100644
|
||||
index 96047744635..2364c92eb96 100644
|
||||
--- a/dlls/ddraw/tests/ddraw1.c
|
||||
+++ b/dlls/ddraw/tests/ddraw1.c
|
||||
@@ -15467,6 +15467,137 @@ static void test_enum_devices(void)
|
||||
@@ -15507,6 +15507,137 @@ static void test_enum_devices(void)
|
||||
ok(!refcount, "Device has %lu references left.\n", refcount);
|
||||
}
|
||||
|
||||
@@ -538,7 +528,7 @@ index 0940aa8d78a..faf4e2b7694 100644
|
||||
/* Emperor: Rise of the Middle Kingdom locks a sysmem surface and then accesses
|
||||
* the pointer after unlocking it. This test roughly replicates the calls that
|
||||
* it makes. */
|
||||
@@ -15527,6 +15658,7 @@ static void test_pinned_sysmem(void)
|
||||
@@ -15567,6 +15698,7 @@ static void test_pinned_sysmem(void)
|
||||
IDirectDrawSurface_Release(surface);
|
||||
refcount = IDirectDraw_Release(ddraw);
|
||||
ok(!refcount, "Device has %lu references left.\n", refcount);
|
||||
@@ -546,7 +536,7 @@ index 0940aa8d78a..faf4e2b7694 100644
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@@ -15749,6 +15881,7 @@ START_TEST(ddraw1)
|
||||
@@ -15789,6 +15921,7 @@ START_TEST(ddraw1)
|
||||
test_vtbl_protection();
|
||||
test_window_position();
|
||||
test_get_display_mode();
|
||||
|
@@ -174,7 +174,7 @@ index 7806ad2ec1f..e5adc0d4e2c 100644
|
||||
+ basic_info.LastAccessTime = info.LastAccessTime;
|
||||
+ basic_info.LastWriteTime = info.LastWriteTime;
|
||||
+ basic_info.ChangeTime = info.ChangeTime;
|
||||
+ basic_info.FileAttributes &= FILE_ATTRIBUTE_READONLY;
|
||||
+ basic_info.FileAttributes = info.FileAttributes & FILE_ATTRIBUTE_READONLY;
|
||||
+ NtSetInformationFile( h2, &io, &basic_info, sizeof(basic_info), FileBasicInformation );
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
CloseHandle( h1 );
|
||||
|
@@ -1,65 +0,0 @@
|
||||
From 49fa193ec777f68372b549752482ef82fb63a7b7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:38:38 +0200
|
||||
Subject: [PATCH] ntdll: Add inline versions of RtlEnterCriticalSection /
|
||||
RtlLeaveCriticalSections.
|
||||
|
||||
---
|
||||
dlls/ntdll/ntdll_misc.h | 34 ++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 34 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 171ded98c67..54a65e3bae5 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "winternl.h"
|
||||
#include "rtlsupportapi.h"
|
||||
#include "unixlib.h"
|
||||
+#include "wine/debug.h"
|
||||
#include "wine/asm.h"
|
||||
|
||||
#define MAX_NT_PATH_LENGTH 277
|
||||
@@ -106,6 +107,39 @@ extern void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *
|
||||
|
||||
extern struct _KUSER_SHARED_DATA *user_shared_data;
|
||||
|
||||
+/* inline version of RtlEnterCriticalSection */
|
||||
+static inline void enter_critical_section( RTL_CRITICAL_SECTION *crit )
|
||||
+{
|
||||
+ if (InterlockedIncrement( &crit->LockCount ))
|
||||
+ {
|
||||
+ if (crit->OwningThread == ULongToHandle(GetCurrentThreadId()))
|
||||
+ {
|
||||
+ crit->RecursionCount++;
|
||||
+ return;
|
||||
+ }
|
||||
+ RtlpWaitForCriticalSection( crit );
|
||||
+ }
|
||||
+ crit->OwningThread = ULongToHandle(GetCurrentThreadId());
|
||||
+ crit->RecursionCount = 1;
|
||||
+}
|
||||
+
|
||||
+/* inline version of RtlLeaveCriticalSection */
|
||||
+static inline void leave_critical_section( RTL_CRITICAL_SECTION *crit )
|
||||
+{
|
||||
+ WINE_DECLARE_DEBUG_CHANNEL(ntdll);
|
||||
+ if (--crit->RecursionCount)
|
||||
+ {
|
||||
+ if (crit->RecursionCount > 0) InterlockedDecrement( &crit->LockCount );
|
||||
+ else ERR_(ntdll)( "section %p is not acquired\n", crit );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ crit->OwningThread = 0;
|
||||
+ if (InterlockedDecrement( &crit->LockCount ) >= 0)
|
||||
+ RtlpUnWaitCriticalSection( crit );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#ifdef _WIN64
|
||||
static inline TEB64 *NtCurrentTeb64(void) { return NULL; }
|
||||
#else
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,74 +0,0 @@
|
||||
From 85e5938c50ad5a1eebc7ec21d6c01ea7f4faf49d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:23 +0200
|
||||
Subject: [PATCH] ntdll: Use fast CS functions for heap locking.
|
||||
|
||||
---
|
||||
dlls/ntdll/heap.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
|
||||
index cb1ff12c679..757e0246925 100644
|
||||
--- a/dlls/ntdll/heap.c
|
||||
+++ b/dlls/ntdll/heap.c
|
||||
@@ -476,13 +476,13 @@ static inline ULONG heap_get_flags( const struct heap *heap, ULONG flags )
|
||||
static inline void heap_lock( struct heap *heap, ULONG flags )
|
||||
{
|
||||
if (flags & HEAP_NO_SERIALIZE) return;
|
||||
- RtlEnterCriticalSection( &heap->cs );
|
||||
+ enter_critical_section( &heap->cs );
|
||||
}
|
||||
|
||||
static inline void heap_unlock( struct heap *heap, ULONG flags )
|
||||
{
|
||||
if (flags & HEAP_NO_SERIALIZE) return;
|
||||
- RtlLeaveCriticalSection( &heap->cs );
|
||||
+ leave_critical_section( &heap->cs );
|
||||
}
|
||||
|
||||
static void heap_set_status( const struct heap *heap, ULONG flags, NTSTATUS status )
|
||||
@@ -1392,9 +1392,9 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
|
||||
/* link it into the per-process heap list */
|
||||
if (process_heap)
|
||||
{
|
||||
- RtlEnterCriticalSection( &process_heap->cs );
|
||||
+ enter_critical_section( &process_heap->cs );
|
||||
list_add_head( &process_heap->entry, &heap->entry );
|
||||
- RtlLeaveCriticalSection( &process_heap->cs );
|
||||
+ leave_critical_section( &process_heap->cs );
|
||||
}
|
||||
else if (!addr)
|
||||
{
|
||||
@@ -1451,9 +1451,9 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE handle )
|
||||
if (heap == process_heap) return handle; /* cannot delete the main process heap */
|
||||
|
||||
/* remove it from the per-process list */
|
||||
- RtlEnterCriticalSection( &process_heap->cs );
|
||||
+ enter_critical_section( &process_heap->cs );
|
||||
list_remove( &heap->entry );
|
||||
- RtlLeaveCriticalSection( &process_heap->cs );
|
||||
+ leave_critical_section( &process_heap->cs );
|
||||
|
||||
heap->cs.DebugInfo->Spare[0] = 0;
|
||||
RtlDeleteCriticalSection( &heap->cs );
|
||||
@@ -1968,7 +1968,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
|
||||
ULONG total = 1; /* main heap */
|
||||
struct list *ptr;
|
||||
|
||||
- RtlEnterCriticalSection( &process_heap->cs );
|
||||
+ enter_critical_section( &process_heap->cs );
|
||||
LIST_FOR_EACH( ptr, &process_heap->entry ) total++;
|
||||
if (total <= count)
|
||||
{
|
||||
@@ -1976,7 +1976,7 @@ ULONG WINAPI RtlGetProcessHeaps( ULONG count, HANDLE *heaps )
|
||||
LIST_FOR_EACH( ptr, &process_heap->entry )
|
||||
*heaps++ = LIST_ENTRY( ptr, struct heap, entry );
|
||||
}
|
||||
- RtlLeaveCriticalSection( &process_heap->cs );
|
||||
+ leave_critical_section( &process_heap->cs );
|
||||
return total;
|
||||
}
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
@@ -1,396 +0,0 @@
|
||||
From 6d5610f8950d0319dbec724ef4d1f0ed140a97ec Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:37 +0200
|
||||
Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking.
|
||||
|
||||
---
|
||||
dlls/ntdll/threadpool.c | 90 ++++++++++++++++++++---------------------
|
||||
1 file changed, 45 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
|
||||
index 99525f831e1..36d1351aedc 100644
|
||||
--- a/dlls/ntdll/threadpool.c
|
||||
+++ b/dlls/ntdll/threadpool.c
|
||||
@@ -1063,7 +1063,7 @@ static void CALLBACK timerqueue_thread_proc( void *param )
|
||||
TRACE( "starting timer queue thread\n" );
|
||||
set_thread_name(L"wine_threadpool_timerqueue");
|
||||
|
||||
- RtlEnterCriticalSection( &timerqueue.cs );
|
||||
+ enter_critical_section( &timerqueue.cs );
|
||||
for (;;)
|
||||
{
|
||||
NtQuerySystemTime( &now );
|
||||
@@ -1136,7 +1136,7 @@ static void CALLBACK timerqueue_thread_proc( void *param )
|
||||
}
|
||||
|
||||
timerqueue.thread_running = FALSE;
|
||||
- RtlLeaveCriticalSection( &timerqueue.cs );
|
||||
+ leave_critical_section( &timerqueue.cs );
|
||||
|
||||
TRACE( "terminating timer queue thread\n" );
|
||||
RtlExitUserThread( 0 );
|
||||
@@ -1181,7 +1181,7 @@ static NTSTATUS tp_timerqueue_lock( struct threadpool_object *timer )
|
||||
timer->u.timer.period = 0;
|
||||
timer->u.timer.window_length = 0;
|
||||
|
||||
- RtlEnterCriticalSection( &timerqueue.cs );
|
||||
+ enter_critical_section( &timerqueue.cs );
|
||||
|
||||
/* Make sure that the timerqueue thread is running. */
|
||||
if (!timerqueue.thread_running)
|
||||
@@ -1202,7 +1202,7 @@ static NTSTATUS tp_timerqueue_lock( struct threadpool_object *timer )
|
||||
timerqueue.objcount++;
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &timerqueue.cs );
|
||||
+ leave_critical_section( &timerqueue.cs );
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ static void tp_timerqueue_unlock( struct threadpool_object *timer )
|
||||
{
|
||||
assert( timer->type == TP_OBJECT_TYPE_TIMER );
|
||||
|
||||
- RtlEnterCriticalSection( &timerqueue.cs );
|
||||
+ enter_critical_section( &timerqueue.cs );
|
||||
if (timer->u.timer.timer_initialized)
|
||||
{
|
||||
/* If timer was pending, remove it. */
|
||||
@@ -1234,7 +1234,7 @@ static void tp_timerqueue_unlock( struct threadpool_object *timer )
|
||||
|
||||
timer->u.timer.timer_initialized = FALSE;
|
||||
}
|
||||
- RtlLeaveCriticalSection( &timerqueue.cs );
|
||||
+ leave_critical_section( &timerqueue.cs );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1253,7 +1253,7 @@ static void CALLBACK waitqueue_thread_proc( void *param )
|
||||
TRACE( "starting wait queue thread\n" );
|
||||
set_thread_name(L"wine_threadpool_waitqueue");
|
||||
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -1302,10 +1302,10 @@ static void CALLBACK waitqueue_thread_proc( void *param )
|
||||
/* All wait objects have been destroyed, if no new wait objects are created
|
||||
* within some amount of time, then we can shutdown this thread. */
|
||||
assert( num_handles == 0 );
|
||||
- RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
+ leave_critical_section( &waitqueue.cs );
|
||||
timeout.QuadPart = (ULONGLONG)THREADPOOL_WORKER_TIMEOUT * -10000;
|
||||
status = NtWaitForMultipleObjects( 1, &bucket->update_event, TRUE, bucket->alertable, &timeout );
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
|
||||
if (status == STATUS_TIMEOUT && !bucket->objcount)
|
||||
break;
|
||||
@@ -1315,7 +1315,7 @@ static void CALLBACK waitqueue_thread_proc( void *param )
|
||||
handles[num_handles] = bucket->update_event;
|
||||
RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
status = NtWaitForMultipleObjects( num_handles + 1, handles, TRUE, bucket->alertable, &timeout );
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
|
||||
if (status >= STATUS_WAIT_0 && status < STATUS_WAIT_0 + num_handles)
|
||||
{
|
||||
@@ -1399,7 +1399,7 @@ static void CALLBACK waitqueue_thread_proc( void *param )
|
||||
if (!--waitqueue.num_buckets)
|
||||
assert( list_empty( &waitqueue.buckets ) );
|
||||
|
||||
- RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
+ leave_critical_section( &waitqueue.cs );
|
||||
|
||||
TRACE( "terminating wait queue thread\n" );
|
||||
|
||||
@@ -1429,7 +1429,7 @@ static NTSTATUS tp_waitqueue_lock( struct threadpool_object *wait )
|
||||
wait->u.wait.timeout = 0;
|
||||
wait->u.wait.handle = INVALID_HANDLE_VALUE;
|
||||
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
|
||||
/* Try to assign to existing bucket if possible. */
|
||||
LIST_FOR_EACH_ENTRY( bucket, &waitqueue.buckets, struct waitqueue_bucket, bucket_entry )
|
||||
@@ -1486,7 +1486,7 @@ static NTSTATUS tp_waitqueue_lock( struct threadpool_object *wait )
|
||||
}
|
||||
|
||||
out:
|
||||
- RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
+ leave_critical_section( &waitqueue.cs );
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1497,7 +1497,7 @@ static void tp_waitqueue_unlock( struct threadpool_object *wait )
|
||||
{
|
||||
assert( wait->type == TP_OBJECT_TYPE_WAIT );
|
||||
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
if (wait->u.wait.bucket)
|
||||
{
|
||||
struct waitqueue_bucket *bucket = wait->u.wait.bucket;
|
||||
@@ -1509,7 +1509,7 @@ static void tp_waitqueue_unlock( struct threadpool_object *wait )
|
||||
|
||||
NtSetEvent( bucket->update_event, NULL );
|
||||
}
|
||||
- RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
+ leave_critical_section( &waitqueue.cs );
|
||||
}
|
||||
|
||||
static void CALLBACK ioqueue_thread_proc( void *param )
|
||||
@@ -1787,7 +1787,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
pool = default_threadpool;
|
||||
}
|
||||
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
|
||||
/* Make sure that the threadpool has at least one thread. */
|
||||
if (!pool->num_workers)
|
||||
@@ -1801,7 +1801,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
pool->objcount++;
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
|
||||
if (status != STATUS_SUCCESS)
|
||||
return status;
|
||||
@@ -1817,9 +1817,9 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
*/
|
||||
static void tp_threadpool_unlock( struct threadpool *pool )
|
||||
{
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
pool->objcount--;
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
tp_threadpool_release( pool );
|
||||
}
|
||||
|
||||
@@ -1957,10 +1957,10 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
|
||||
struct threadpool_group *group = object->group;
|
||||
InterlockedIncrement( &group->refcount );
|
||||
|
||||
- RtlEnterCriticalSection( &group->cs );
|
||||
+ enter_critical_section( &group->cs );
|
||||
list_add_tail( &group->members, &object->group_entry );
|
||||
object->is_group_member = TRUE;
|
||||
- RtlLeaveCriticalSection( &group->cs );
|
||||
+ leave_critical_section( &group->cs );
|
||||
}
|
||||
|
||||
if (is_simple_callback)
|
||||
@@ -1987,7 +1987,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
assert( !object->shutdown );
|
||||
assert( !pool->shutdown );
|
||||
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
|
||||
/* Start new worker threads if required. */
|
||||
if (pool->num_busy_workers >= pool->num_workers &&
|
||||
@@ -2010,7 +2010,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
RtlWakeConditionVariable( &pool->update_event );
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2023,7 +2023,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
struct threadpool *pool = object->pool;
|
||||
LONG pending_callbacks = 0;
|
||||
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
if (object->num_pending_callbacks)
|
||||
{
|
||||
pending_callbacks = object->num_pending_callbacks;
|
||||
@@ -2038,7 +2038,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
object->u.io.skipped_count += object->u.io.pending_count;
|
||||
object->u.io.pending_count = 0;
|
||||
}
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
|
||||
while (pending_callbacks--)
|
||||
tp_object_release( object );
|
||||
@@ -2067,7 +2067,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
{
|
||||
struct threadpool *pool = object->pool;
|
||||
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
while (!object_is_finished( object, group_wait ))
|
||||
{
|
||||
if (group_wait)
|
||||
@@ -2075,7 +2075,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
else
|
||||
RtlSleepConditionVariableCS( &object->finished_event, &pool->cs, NULL );
|
||||
}
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
}
|
||||
|
||||
static void tp_ioqueue_unlock( struct threadpool_object *io )
|
||||
@@ -2129,13 +2129,13 @@ static BOOL tp_object_release( struct threadpool_object *object )
|
||||
{
|
||||
struct threadpool_group *group = object->group;
|
||||
|
||||
- RtlEnterCriticalSection( &group->cs );
|
||||
+ enter_critical_section( &group->cs );
|
||||
if (object->is_group_member)
|
||||
{
|
||||
list_remove( &object->group_entry );
|
||||
object->is_group_member = FALSE;
|
||||
}
|
||||
- RtlLeaveCriticalSection( &group->cs );
|
||||
+ leave_critical_section( &group->cs );
|
||||
|
||||
tp_group_release( group );
|
||||
}
|
||||
@@ -2337,7 +2337,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
TRACE( "starting worker thread for pool %p\n", pool );
|
||||
set_thread_name(L"wine_threadpool_worker");
|
||||
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
for (;;)
|
||||
{
|
||||
while ((ptr = threadpool_get_next_item( pool )))
|
||||
@@ -2377,7 +2377,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
}
|
||||
}
|
||||
pool->num_workers--;
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
|
||||
TRACE( "terminating worker thread for pool %p\n", pool );
|
||||
tp_threadpool_release( pool );
|
||||
@@ -2625,7 +2625,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
pool = object->pool;
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
|
||||
/* Start new worker threads if required. */
|
||||
if (pool->num_busy_workers >= pool->num_workers)
|
||||
@@ -2640,7 +2640,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
}
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
this->may_run_long = TRUE;
|
||||
return status;
|
||||
}
|
||||
@@ -2721,13 +2721,13 @@ VOID WINAPI TpDisassociateCallback( TP_CALLBACK_INSTANCE *instance )
|
||||
return;
|
||||
|
||||
pool = object->pool;
|
||||
- RtlEnterCriticalSection( &pool->cs );
|
||||
+ enter_critical_section( &pool->cs );
|
||||
|
||||
object->num_associated_callbacks--;
|
||||
if (object_is_finished( object, FALSE ))
|
||||
RtlWakeAllConditionVariable( &object->finished_event );
|
||||
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
this->associated = FALSE;
|
||||
}
|
||||
|
||||
@@ -2779,7 +2779,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
|
||||
TRACE( "%p %u %p\n", group, cancel_pending, userdata );
|
||||
|
||||
- RtlEnterCriticalSection( &this->cs );
|
||||
+ enter_critical_section( &this->cs );
|
||||
|
||||
/* Unset group, increase references, and mark objects for shutdown */
|
||||
LIST_FOR_EACH_ENTRY_SAFE( object, next, &this->members, struct threadpool_object, group_entry )
|
||||
@@ -2805,7 +2805,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
list_init( &members );
|
||||
list_move_tail( &members, &this->members );
|
||||
|
||||
- RtlLeaveCriticalSection( &this->cs );
|
||||
+ leave_critical_section( &this->cs );
|
||||
|
||||
/* Cancel pending callbacks if requested */
|
||||
if (cancel_pending)
|
||||
@@ -2928,10 +2928,10 @@ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum )
|
||||
|
||||
TRACE( "%p %lu\n", pool, maximum );
|
||||
|
||||
- RtlEnterCriticalSection( &this->cs );
|
||||
+ enter_critical_section( &this->cs );
|
||||
this->max_workers = max( maximum, 1 );
|
||||
this->min_workers = min( this->min_workers, this->max_workers );
|
||||
- RtlLeaveCriticalSection( &this->cs );
|
||||
+ leave_critical_section( &this->cs );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2944,7 +2944,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
|
||||
TRACE( "%p %lu\n", pool, minimum );
|
||||
|
||||
- RtlEnterCriticalSection( &this->cs );
|
||||
+ enter_critical_section( &this->cs );
|
||||
|
||||
while (this->num_workers < minimum)
|
||||
{
|
||||
@@ -2959,7 +2959,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
this->max_workers = max( this->min_workers, this->max_workers );
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &this->cs );
|
||||
+ leave_critical_section( &this->cs );
|
||||
return !status;
|
||||
}
|
||||
|
||||
@@ -2975,7 +2975,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
|
||||
TRACE( "%p %p %lu %lu\n", timer, timeout, period, window_length );
|
||||
|
||||
- RtlEnterCriticalSection( &timerqueue.cs );
|
||||
+ enter_critical_section( &timerqueue.cs );
|
||||
|
||||
assert( this->u.timer.timer_initialized );
|
||||
this->u.timer.timer_set = timeout != NULL;
|
||||
@@ -3035,7 +3035,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
this->u.timer.timer_pending = TRUE;
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &timerqueue.cs );
|
||||
+ leave_critical_section( &timerqueue.cs );
|
||||
|
||||
if (submit_timer)
|
||||
tp_object_submit( this, FALSE );
|
||||
@@ -3051,7 +3051,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
|
||||
TRACE( "%p %p %p\n", wait, handle, timeout );
|
||||
|
||||
- RtlEnterCriticalSection( &waitqueue.cs );
|
||||
+ enter_critical_section( &waitqueue.cs );
|
||||
|
||||
assert( this->u.wait.bucket );
|
||||
this->u.wait.handle = handle;
|
||||
@@ -3090,7 +3090,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
NtSetEvent( bucket->update_event, NULL );
|
||||
}
|
||||
|
||||
- RtlLeaveCriticalSection( &waitqueue.cs );
|
||||
+ leave_critical_section( &waitqueue.cs );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
--
|
||||
2.38.1
|
||||
|
@@ -0,0 +1,51 @@
|
||||
From 246a50e7cf09bd1d77d327e170c2d7432e0d5f5e Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Ferrillo <lorenzofersteam@live.it>
|
||||
Date: Mon, 6 May 2024 23:46:44 +0200
|
||||
Subject: [PATCH] Return correct status value if handle is not a reparse point
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/file.c | 19 ++++++++++++++-----
|
||||
1 file changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index 2bfb9b7d051..93732543ae4 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -3944,9 +3944,11 @@ NTSTATUS get_reparse_point_unix(const char *unix_name, REPARSE_DATA_BUFFER *buff
|
||||
char *p;
|
||||
|
||||
ret = readlink( unix_name, link_path, sizeof(link_path) );
|
||||
+
|
||||
if (ret < 0)
|
||||
{
|
||||
- status = errno_to_status( errno );
|
||||
+ if (errno == EINVAL) status = STATUS_NOT_A_REPARSE_POINT;
|
||||
+ else status = errno_to_status( errno );
|
||||
goto cleanup;
|
||||
}
|
||||
link_path_len = ret;
|
||||
@@ -7303,10 +7305,17 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
}
|
||||
case FSCTL_GET_REPARSE_POINT:
|
||||
{
|
||||
- REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)out_buffer;
|
||||
- ULONG size = out_size;
|
||||
- status = get_reparse_point( handle, buffer, &size );
|
||||
- io->Information = size;
|
||||
+ io->Information = 0;
|
||||
+ if (out_buffer){
|
||||
+ REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)out_buffer;
|
||||
+ ULONG size = out_size;
|
||||
+ status = get_reparse_point( handle, buffer, &size );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ io->Information = size;
|
||||
+ }
|
||||
+ else {
|
||||
+ status = STATUS_INVALID_USER_BUFFER;
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
case FSCTL_SET_REPARSE_POINT:
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,63 +0,0 @@
|
||||
From 8c7d326435794a72c70e05acdff945edf506ec3c Mon Sep 17 00:00:00 2001
|
||||
From: Qian Hong <qhong@codeweavers.com>
|
||||
Date: Wed, 21 Oct 2015 06:23:22 +0800
|
||||
Subject: [PATCH] ntdll: Add fake data implementation for ProcessQuotaLimits
|
||||
class.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/process.c | 32 +++++++++++++++++++++++++++++++-
|
||||
1 file changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
|
||||
index 93d7e7b0140..ae3ab9a8058 100644
|
||||
--- a/dlls/ntdll/unix/process.c
|
||||
+++ b/dlls/ntdll/unix/process.c
|
||||
@@ -1050,7 +1050,6 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
|
||||
|
||||
switch (class)
|
||||
{
|
||||
- UNIMPLEMENTED_INFO_CLASS(ProcessQuotaLimits);
|
||||
UNIMPLEMENTED_INFO_CLASS(ProcessBasePriority);
|
||||
UNIMPLEMENTED_INFO_CLASS(ProcessRaisePriority);
|
||||
UNIMPLEMENTED_INFO_CLASS(ProcessExceptionPort);
|
||||
@@ -1109,6 +1108,37 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
|
||||
}
|
||||
break;
|
||||
|
||||
+ case ProcessQuotaLimits:
|
||||
+ {
|
||||
+ QUOTA_LIMITS pqli;
|
||||
+
|
||||
+ if (size >= sizeof(QUOTA_LIMITS))
|
||||
+ {
|
||||
+ if (!info)
|
||||
+ ret = STATUS_ACCESS_VIOLATION;
|
||||
+ else if (!handle)
|
||||
+ ret = STATUS_INVALID_HANDLE;
|
||||
+ else
|
||||
+ {
|
||||
+ /* FIXME : real data */
|
||||
+ memset(&pqli, 0, sizeof(QUOTA_LIMITS));
|
||||
+
|
||||
+ memcpy(info, &pqli, sizeof(QUOTA_LIMITS));
|
||||
+
|
||||
+ len = sizeof(QUOTA_LIMITS);
|
||||
+ }
|
||||
+
|
||||
+ if (size > sizeof(QUOTA_LIMITS))
|
||||
+ ret = STATUS_INFO_LENGTH_MISMATCH;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ len = sizeof(QUOTA_LIMITS);
|
||||
+ ret = STATUS_INFO_LENGTH_MISMATCH;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
case ProcessIoCounters:
|
||||
{
|
||||
IO_COUNTERS pii;
|
||||
--
|
||||
2.27.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [44812] Multiple applications need NtQueryInformationProcess 'ProcessQuotaLimits' class support (MSYS2, ProcessHacker 2.x)
|
@@ -1,4 +1,4 @@
|
||||
From 265b5cb7e6f676562e077181f681c40387c4d0c5 Mon Sep 17 00:00:00 2001
|
||||
From 4aea41b4f635ab83ad6ac571b04ca0f8f00310ab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 00:50:50 +0100
|
||||
Subject: [PATCH] ntdll/tests: Add basic tests for RtlQueryPackageIdentity.
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll/tests: Add basic tests for RtlQueryPackageIdentity.
|
||||
2 files changed, 81 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/Makefile.in b/dlls/ntdll/tests/Makefile.in
|
||||
index 3ca77a03053..7508e1ad796 100644
|
||||
index 3742968c415..084469a2820 100644
|
||||
--- a/dlls/ntdll/tests/Makefile.in
|
||||
+++ b/dlls/ntdll/tests/Makefile.in
|
||||
@@ -1,5 +1,5 @@
|
||||
@@ -20,12 +20,12 @@ index 3ca77a03053..7508e1ad796 100644
|
||||
SOURCES = \
|
||||
atom.c \
|
||||
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
|
||||
index 4a4370d5903..e5b74c6bfc7 100644
|
||||
index e678f7f43a0..71a413d9f18 100644
|
||||
--- a/dlls/ntdll/tests/rtl.c
|
||||
+++ b/dlls/ntdll/tests/rtl.c
|
||||
@@ -29,6 +29,9 @@
|
||||
#include "ip2string.h"
|
||||
@@ -36,6 +36,9 @@
|
||||
#include "ddk/ntifs.h"
|
||||
#include "wine/test.h"
|
||||
#include "wine/asm.h"
|
||||
+#include "initguid.h"
|
||||
+#define COBJMACROS
|
||||
@@ -33,7 +33,7 @@ index 4a4370d5903..e5b74c6bfc7 100644
|
||||
|
||||
#ifndef __WINE_WINTERNL_H
|
||||
|
||||
@@ -97,6 +100,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
|
||||
@@ -104,6 +107,9 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION
|
||||
static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG);
|
||||
static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *);
|
||||
static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *);
|
||||
@@ -43,7 +43,7 @@ index 4a4370d5903..e5b74c6bfc7 100644
|
||||
static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **);
|
||||
static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *);
|
||||
static VOID (WINAPI *pRtlGetDeviceFamilyInfoEnum)(ULONGLONG *,DWORD *,DWORD *);
|
||||
@@ -141,6 +147,9 @@ static void InitFunctionPtrs(void)
|
||||
@@ -148,6 +154,9 @@ static void InitFunctionPtrs(void)
|
||||
pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx");
|
||||
pRtlFindExportedRoutineByName = (void *)GetProcAddress(hntdll, "RtlFindExportedRoutineByName");
|
||||
pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules");
|
||||
@@ -53,7 +53,7 @@ index 4a4370d5903..e5b74c6bfc7 100644
|
||||
pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification");
|
||||
pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification");
|
||||
pRtlGetDeviceFamilyInfoEnum = (void *)GetProcAddress(hntdll, "RtlGetDeviceFamilyInfoEnum");
|
||||
@@ -3701,6 +3710,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
@@ -3708,6 +3717,76 @@ static void test_RtlFirstFreeAce(void)
|
||||
HeapFree(GetProcessHeap(), 0, acl);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ index 4a4370d5903..e5b74c6bfc7 100644
|
||||
static void test_RtlInitializeSid(void)
|
||||
{
|
||||
SID_IDENTIFIER_AUTHORITY sid_ident = { SECURITY_NT_AUTHORITY };
|
||||
@@ -3816,6 +3895,7 @@ START_TEST(rtl)
|
||||
@@ -3823,6 +3902,7 @@ START_TEST(rtl)
|
||||
test_RtlInitializeCriticalSectionEx();
|
||||
test_RtlLeaveCriticalSection();
|
||||
test_LdrEnumerateLoadedModules();
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,113 +1,51 @@
|
||||
From 9491dc2b72947bef59d8fb191fdc27a96bcc1c68 Mon Sep 17 00:00:00 2001
|
||||
From b129fd1a7b4de4959f8929f03ece4688b3e1a6fd Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 3 Feb 2023 14:16:21 +1100
|
||||
Subject: [PATCH] odbc32: Add initial tests
|
||||
|
||||
---
|
||||
configure | 1 +
|
||||
configure.ac | 1 +
|
||||
dlls/odbc32/tests/Makefile.in | 5 +
|
||||
dlls/odbc32/tests/connection.c | 165 +++++++++++++++++++++++++++++++++
|
||||
4 files changed, 172 insertions(+)
|
||||
create mode 100644 dlls/odbc32/tests/Makefile.in
|
||||
create mode 100644 dlls/odbc32/tests/connection.c
|
||||
dlls/odbc32/tests/odbc32.c | 52 +++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 51 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index ca6e87d4740..027f3fbe53d 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -22137,6 +22137,7 @@ wine_fn_config_makefile dlls/ntprint enable_ntprint
|
||||
wine_fn_config_makefile dlls/ntprint/tests enable_tests
|
||||
wine_fn_config_makefile dlls/objsel enable_objsel
|
||||
wine_fn_config_makefile dlls/odbc32 enable_odbc32
|
||||
+wine_fn_config_makefile dlls/odbc32/tests enable_tests
|
||||
wine_fn_config_makefile dlls/odbcbcp enable_odbcbcp
|
||||
wine_fn_config_makefile dlls/odbccp32 enable_odbccp32
|
||||
wine_fn_config_makefile dlls/odbccp32/tests enable_tests
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cba55126869..fc09d145ee7 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2954,6 +2954,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntprint)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ntprint/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/objsel)
|
||||
WINE_CONFIG_MAKEFILE(dlls/odbc32)
|
||||
+WINE_CONFIG_MAKEFILE(dlls/odbc32/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/odbcbcp)
|
||||
WINE_CONFIG_MAKEFILE(dlls/odbccp32)
|
||||
WINE_CONFIG_MAKEFILE(dlls/odbccp32/tests)
|
||||
diff --git a/dlls/odbc32/tests/Makefile.in b/dlls/odbc32/tests/Makefile.in
|
||||
new file mode 100644
|
||||
index 00000000000..d7a300417a0
|
||||
--- /dev/null
|
||||
+++ b/dlls/odbc32/tests/Makefile.in
|
||||
@@ -0,0 +1,5 @@
|
||||
+TESTDLL = odbc32.dll
|
||||
+IMPORTS = odbc32
|
||||
+
|
||||
+SOURCES = \
|
||||
+ connection.c
|
||||
diff --git a/dlls/odbc32/tests/connection.c b/dlls/odbc32/tests/connection.c
|
||||
new file mode 100644
|
||||
index 00000000000..b04d93c42c5
|
||||
--- /dev/null
|
||||
+++ b/dlls/odbc32/tests/connection.c
|
||||
@@ -0,0 +1,165 @@
|
||||
+/*
|
||||
+ * Copyright 2018 Alistair Leslie-Hughes
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#include <wine/test.h>
|
||||
+#include <stdarg.h>
|
||||
+
|
||||
+#include "windef.h"
|
||||
+#include "winbase.h"
|
||||
+#include "sqlext.h"
|
||||
+#include "sqlucode.h"
|
||||
+#include "odbcinst.h"
|
||||
+
|
||||
+static void test_SQLAllocEnv(void)
|
||||
+{
|
||||
+ SQLRETURN ret;
|
||||
+ SQLHENV sqlenv, sqlenv2;
|
||||
+
|
||||
+ ret = SQLAllocEnv(NULL);
|
||||
+ ok(ret == SQL_ERROR, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLAllocEnv(&sqlenv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLAllocEnv(&sqlenv2);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+ ok(sqlenv != sqlenv2, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLFreeEnv(sqlenv2);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLFreeEnv(sqlenv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLFreeEnv(sqlenv);
|
||||
+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLFreeEnv(SQL_NULL_HENV);
|
||||
+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret);
|
||||
+}
|
||||
diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c
|
||||
index 8a744f23834..7e1f62e559f 100644
|
||||
--- a/dlls/odbc32/tests/odbc32.c
|
||||
+++ b/dlls/odbc32/tests/odbc32.c
|
||||
@@ -28,7 +28,7 @@
|
||||
static void test_SQLAllocHandle( void )
|
||||
{
|
||||
SQLHANDLE handle;
|
||||
- SQLHENV env;
|
||||
+ SQLHENV env, env2;
|
||||
SQLHDBC con;
|
||||
SQLRETURN ret;
|
||||
|
||||
@@ -46,6 +46,12 @@ static void test_SQLAllocHandle( void )
|
||||
ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
ok( env != (void *)0xdeadbeef, "env not set\n" );
|
||||
|
||||
+ env2 = (void *)0xdeadbeef;
|
||||
+ ret = SQLAllocEnv( &env2 );
|
||||
+ ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
+ ok( env2 != (void *)0xdeadbeef, "env2 not set\n" );
|
||||
+ ok( env2 != env, "environment is the same\n" );
|
||||
+
|
||||
con = (void *)0xdeadbeef;
|
||||
ret = SQLAllocConnect( env, &con );
|
||||
ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
@@ -57,6 +63,8 @@ static void test_SQLAllocHandle( void )
|
||||
ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret );
|
||||
ret = SQLFreeEnv( env );
|
||||
ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
+ ret = SQLFreeEnv( env2 );
|
||||
+ ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
ret = SQLFreeEnv( 0 );
|
||||
ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret );
|
||||
}
|
||||
@@ -302,6 +310,47 @@ static void test_SQLExecDirect( void )
|
||||
ok( ret == SQL_SUCCESS, "got %d\n", ret );
|
||||
}
|
||||
|
||||
+void test_SQLGetEnvAttr(void)
|
||||
+{
|
||||
+ SQLRETURN ret;
|
||||
@@ -149,75 +87,15 @@ index 00000000000..b04d93c42c5
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+}
|
||||
+
|
||||
+static void test_SQLDriver(void)
|
||||
+{
|
||||
+ SQLHENV henv = SQL_NULL_HENV;
|
||||
+ SQLRETURN ret;
|
||||
+ SQLCHAR driver[256];
|
||||
+ SQLCHAR attr[256];
|
||||
+ SQLSMALLINT driver_ret;
|
||||
+ SQLSMALLINT attr_ret;
|
||||
+ SQLUSMALLINT direction;
|
||||
+
|
||||
+ ret = SQLAllocEnv(&henv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+ ok(henv != SQL_NULL_HENV, "NULL handle\n");
|
||||
+
|
||||
+ direction = SQL_FETCH_FIRST;
|
||||
+
|
||||
+ while(SQL_SUCCEEDED(ret = SQLDrivers(henv, direction, driver, sizeof(driver),
|
||||
+ &driver_ret, attr, sizeof(attr), &attr_ret)))
|
||||
+ {
|
||||
+ direction = SQL_FETCH_NEXT;
|
||||
+
|
||||
+ trace("%s - %s\n", driver, attr);
|
||||
+ }
|
||||
+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLFreeEnv(henv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+}
|
||||
+
|
||||
+static void test_SQLGetDiagRec(void)
|
||||
+{
|
||||
+ SQLHENV henv = SQL_NULL_HENV;
|
||||
+ SQLHDBC connection;
|
||||
+ SQLRETURN ret;
|
||||
+ WCHAR version[11];
|
||||
+ WCHAR SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
|
||||
+ SQLINTEGER NativeError;
|
||||
+ SQLSMALLINT MsgLen;
|
||||
+
|
||||
+ ret = SQLAllocEnv(&henv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+ ok(henv != SQL_NULL_HENV, "NULL handle\n");
|
||||
+
|
||||
+ ret = SQLAllocConnect(henv, &connection);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+
|
||||
+ ret = SQLGetInfoW(connection, SQL_ODBC_VER, version, 22, NULL);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+ trace("ODBC_VER=%s\n", wine_dbgstr_w(version));
|
||||
+
|
||||
+ ret = SQLFreeConnect(connection);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+
|
||||
+ NativeError = 88;
|
||||
+ ret = SQLGetDiagRecW( SQL_HANDLE_ENV, henv, 1, SqlState, &NativeError, Msg, sizeof(Msg), &MsgLen);
|
||||
+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret);
|
||||
+ ok(NativeError == 88, "got %d\n", NativeError);
|
||||
+
|
||||
+ ret = SQLFreeEnv(henv);
|
||||
+ ok(ret == SQL_SUCCESS, "got %d\n", ret);
|
||||
+}
|
||||
+
|
||||
+START_TEST(connection)
|
||||
+{
|
||||
+ test_SQLAllocEnv();
|
||||
START_TEST(odbc32)
|
||||
{
|
||||
test_SQLAllocHandle();
|
||||
@@ -309,4 +358,5 @@ START_TEST(odbc32)
|
||||
test_SQLDataSources();
|
||||
test_SQLDrivers();
|
||||
test_SQLExecDirect();
|
||||
+ test_SQLGetEnvAttr();
|
||||
+ test_SQLDriver();
|
||||
+ test_SQLGetDiagRec();
|
||||
+}
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user