winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
614 discussions
Start a n
N
ew thread
Vincent Povirk : regsvr32: Re-exec as 32-bit or 64-bit if necessary.
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: e90cca8e7a429c58076262626b8bb4d3f4f2c5c5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e90cca8e7a429c5807626262…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Fri Oct 18 15:46:34 2019 -0500 regsvr32: Re-exec as 32-bit or 64-bit if necessary. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47075
Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regsvr32/regsvr32.c | 122 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 111 insertions(+), 11 deletions(-) diff --git a/programs/regsvr32/regsvr32.c b/programs/regsvr32/regsvr32.c index 4aa3f7d5c1..a7fb12e0fc 100644 --- a/programs/regsvr32/regsvr32.c +++ b/programs/regsvr32/regsvr32.c @@ -83,6 +83,97 @@ static void WINAPIV output_write(UINT id, ...) LocalFree(str); } +static LPCWSTR find_arg_start(LPCWSTR cmdline) +{ + LPCWSTR s; + BOOL in_quotes; + int bcount; + + bcount=0; + in_quotes=FALSE; + s=cmdline; + while (1) { + if (*s==0 || ((*s=='\t' || *s==' ') && !in_quotes)) { + /* end of this command line argument */ + break; + } else if (*s=='\\') { + /* '\', count them */ + bcount++; + } else if ((*s=='"') && ((bcount & 1)==0)) { + /* unescaped '"' */ + in_quotes=!in_quotes; + bcount=0; + } else { + /* a regular character */ + bcount=0; + } + s++; + } + return s; +} + +static void reexec_self(void) +{ + /* restart current process as 32-bit or 64-bit with same command line */ + static const WCHAR exe_name[] = {'\\','r','e','g','s','v','r','3','2','.','e','x','e',0}; +#ifndef _WIN64 + static const WCHAR sysnative[] = {'\\','S','y','s','N','a','t','i','v','e',0}; + BOOL wow64; +#endif + WCHAR systemdir[MAX_PATH]; + LPCWSTR args; + WCHAR *cmdline; + STARTUPINFOW si = {0}; + PROCESS_INFORMATION pi; + +#ifdef _WIN64 + TRACE("restarting as 32-bit\n"); + GetSystemWow64DirectoryW(systemdir, MAX_PATH); +#else + TRACE("restarting as 64-bit\n"); + + if (!IsWow64Process(GetCurrentProcess(), &wow64) || !wow64) + { + TRACE("not running in wow64, can't restart as 64-bit\n"); + return; + } + + GetWindowsDirectoryW(systemdir, MAX_PATH); + wcscat(systemdir, sysnative); +#endif + + args = find_arg_start(GetCommandLineW()); + + cmdline = HeapAlloc(GetProcessHeap(), 0, + (wcslen(systemdir)+wcslen(exe_name)+wcslen(args)+1)*sizeof(WCHAR)); + + wcscpy(cmdline, systemdir); + wcscat(cmdline, exe_name); + wcscat(cmdline, args); + + si.cb = sizeof(si); + + if (CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + DWORD exit_code; + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess(pi.hProcess, &exit_code); + ExitProcess(exit_code); + } + else + { + WINE_TRACE("failed to restart, err=%d\n", GetLastError()); + } + + HeapFree(GetProcessHeap(), 0, cmdline); +} + +#ifdef _WIN64 +# define ALT_BINARY_TYPE SCS_32BIT_BINARY +#else +# define ALT_BINARY_TYPE SCS_64BIT_BINARY +#endif + /** * Loads procedure. * @@ -90,14 +181,22 @@ static void WINAPIV output_write(UINT id, ...) * strDll - name of the dll. * procName - name of the procedure to load from the dll. * DllHandle - a variable that receives the handle of the loaded dll. + * firstDll - true if this is the first dll in the command line. */ -static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHandle) +static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHandle, BOOL firstDll) { VOID* (*proc)(void); *DllHandle = LoadLibraryExW(strDll, 0, LOAD_WITH_ALTERED_SEARCH_PATH); if(!*DllHandle) { + DWORD binary_type; + if (firstDll && GetLastError() == ERROR_BAD_EXE_FORMAT && + GetBinaryTypeW(strDll, &binary_type) && + binary_type == ALT_BINARY_TYPE) + { + reexec_self(); + } output_write(STRING_DLL_LOAD_FAILED, strDll); ExitProcess(LOADLIBRARY_FAILED); } @@ -111,13 +210,13 @@ static VOID *LoadProc(const WCHAR* strDll, const char* procName, HMODULE* DllHan return proc; } -static int RegisterDll(const WCHAR* strDll) +static int RegisterDll(const WCHAR* strDll, BOOL firstDll) { HRESULT hr; DLLREGISTER pfRegister; HMODULE DllHandle = NULL; - pfRegister = LoadProc(strDll, "DllRegisterServer", &DllHandle); + pfRegister = LoadProc(strDll, "DllRegisterServer", &DllHandle, firstDll); if (!pfRegister) return GETPROCADDRESS_FAILED; @@ -134,13 +233,13 @@ static int RegisterDll(const WCHAR* strDll) return 0; } -static int UnregisterDll(const WCHAR* strDll) +static int UnregisterDll(const WCHAR* strDll, BOOL firstDll) { HRESULT hr; DLLUNREGISTER pfUnregister; HMODULE DllHandle = NULL; - pfUnregister = LoadProc(strDll, "DllUnregisterServer", &DllHandle); + pfUnregister = LoadProc(strDll, "DllUnregisterServer", &DllHandle, firstDll); if (!pfUnregister) return GETPROCADDRESS_FAILED; @@ -157,13 +256,13 @@ static int UnregisterDll(const WCHAR* strDll) return 0; } -static int InstallDll(BOOL install, const WCHAR *strDll, const WCHAR *command_line) +static int InstallDll(BOOL install, const WCHAR *strDll, const WCHAR *command_line, BOOL firstDll) { HRESULT hr; DLLINSTALL pfInstall; HMODULE DllHandle = NULL; - pfInstall = LoadProc(strDll, "DllInstall", &DllHandle); + pfInstall = LoadProc(strDll, "DllInstall", &DllHandle, firstDll); if (!pfInstall) return GETPROCADDRESS_FAILED; @@ -278,11 +377,12 @@ int __cdecl wmain(int argc, WCHAR* argv[]) if (argv[i]) { WCHAR *DllName = argv[i]; + BOOL firstDll = !DllFound; res = 0; DllFound = TRUE; if (CallInstall && Unregister) - res = InstallDll(!Unregister, DllName, wsCommandLine); + res = InstallDll(!Unregister, DllName, wsCommandLine, firstDll); /* The Windows version stops processing the current file on the first error. */ if (res) @@ -294,9 +394,9 @@ int __cdecl wmain(int argc, WCHAR* argv[]) if (!CallInstall || CallRegister) { if(Unregister) - res = UnregisterDll(DllName); + res = UnregisterDll(DllName, firstDll); else - res = RegisterDll(DllName); + res = RegisterDll(DllName, firstDll); } if (res) @@ -306,7 +406,7 @@ int __cdecl wmain(int argc, WCHAR* argv[]) } if (CallInstall && !Unregister) - res = InstallDll(!Unregister, DllName, wsCommandLine); + res = InstallDll(!Unregister, DllName, wsCommandLine, firstDll); if (res) {
1
0
0
0
Brendan Shanks : kernel32/tests: Test loading system DLLs with WoW64 redirection disabled.
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: de9406bccd100b9c09afb3cd84173f956e0aa52d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de9406bccd100b9c09afb3cd…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Thu Oct 17 13:23:50 2019 -0700 kernel32/tests: Test loading system DLLs with WoW64 redirection disabled. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47912
Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/loader.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 65184887b8..e5b8c3b28e 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -84,6 +84,8 @@ static BOOL (WINAPI *pFlsSetValue)(DWORD, PVOID); static PVOID (WINAPI *pFlsGetValue)(DWORD); static BOOL (WINAPI *pFlsFree)(DWORD); static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL); +static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **); +static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *); static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module) { @@ -3812,6 +3814,50 @@ static void test_InMemoryOrderModuleList(void) ok(entry2 == mark2, "expected entry2 == mark2, got %p and %p\n", entry2, mark2); } +static void test_wow64_redirection_for_dll(const char *libname) +{ + HMODULE lib; + char buf[256]; + + if (!GetModuleHandleA(libname)) + { + lib = LoadLibraryExA(libname, NULL, 0); + todo_wine ok (broken(lib == NULL) /* Vista/2008 */ || + lib != NULL, "Loading %s should succeed with WOW64 redirection disabled\n", libname); + if (lib) + { + /* Win 7/2008R2 return the un-redirected path (i.e. c:\windows\system32\dwrite.dll), test loading it. */ + GetModuleFileNameA(lib, buf, sizeof(buf)); + FreeLibrary(lib); + lib = LoadLibraryExA(buf, NULL, 0); + ok(lib != NULL, "Loading %s from full path should succeed with WOW64 redirection disabled\n", libname); + if (lib) + FreeLibrary(lib); + } + } + else + { + skip("%s was already loaded in the process\n", libname); + } +} + +static void test_wow64_redirection(void) +{ + void *OldValue; + + if (!is_wow64) + return; + + /* Disable FS redirection, then test loading system libraries (pick ones that shouldn't + * already be loaded in this process). + */ + ok(pWow64DisableWow64FsRedirection(&OldValue), "Disabling FS redirection failed\n"); + test_wow64_redirection_for_dll("wlanapi.dll"); + test_wow64_redirection_for_dll("dxgi.dll"); + test_wow64_redirection_for_dll("dwrite.dll"); + ok(pWow64RevertWow64FsRedirection(OldValue), "Re-enabling FS redirection failed\n"); +} + static void test_dll_file( const char *name ) { HMODULE module = GetModuleHandleA( name ); @@ -3897,6 +3943,8 @@ START_TEST(loader) pFlsGetValue = (void *)GetProcAddress(kernel32, "FlsGetValue"); pFlsFree = (void *)GetProcAddress(kernel32, "FlsFree"); pIsWow64Process = (void *)GetProcAddress(kernel32, "IsWow64Process"); + pWow64DisableWow64FsRedirection = (void *)GetProcAddress(kernel32, "Wow64DisableWow64FsRedirection"); + pWow64RevertWow64FsRedirection = (void *)GetProcAddress(kernel32, "Wow64RevertWow64FsRedirection"); pResolveDelayLoadedAPI = (void *)GetProcAddress(kernel32, "ResolveDelayLoadedAPI"); if (pIsWow64Process) pIsWow64Process( GetCurrentProcess(), &is_wow64 ); @@ -3930,6 +3978,7 @@ START_TEST(loader) test_import_resolution(); test_ExitProcess(); test_InMemoryOrderModuleList(); + test_wow64_redirection(); test_dll_file( "ntdll.dll" ); test_dll_file( "kernel32.dll" ); test_dll_file( "advapi32.dll" );
1
0
0
0
Paul Gofman : user32: Fix coords in WINDOWPOS for WM_NCCALCSIZE sent from SetWindowPos().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: 2ac268436b535ed35c82aa2d5c2518e5dfb3cd12 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ac268436b535ed35c82aa2d…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri Oct 18 13:05:14 2019 +0300 user32: Fix coords in WINDOWPOS for WM_NCCALCSIZE sent from SetWindowPos(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=40777
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 86 ++++++++++++++++++++++++++++++++++++++++++------- dlls/user32/winpos.c | 12 +++++++ 2 files changed, 86 insertions(+), 12 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2766e7f5fb..477661ab62 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -2186,9 +2186,27 @@ static void add_message_(int line, const struct recvd_message *msg) seq->wParam = winpos->flags & 0xffff; /* We are not interested in the flags that don't match under XP and Win9x */ seq->wParam &= ~SWP_NOZORDER; + seq->lParam = (!!winpos->cx) | ((!!winpos->cy) << 1) + | ((!!winpos->x) << 2) | ((!!winpos->y) << 3); break; } + case WM_NCCALCSIZE: + if (msg->wParam) + { + NCCALCSIZE_PARAMS *p = (NCCALCSIZE_PARAMS *)msg->lParam; + WINDOWPOS *winpos = p->lppos; + + sprintf(seq->output, "%s: %p WM_NCCALCSIZE: winpos->cx %u, winpos->cy %u", + msg->descr, msg->hwnd, winpos->cx, winpos->cy); + seq->lParam = (!!winpos->cx) | ((!!winpos->cy) << 1) + | ((!!winpos->x) << 2) | ((!!winpos->y) << 3); + } + else + { + seq->lParam = 0; + } + break; case WM_DRAWITEM: { DRAW_ITEM_STRUCT di; @@ -5664,32 +5682,72 @@ done: flush_sequence(); } +static const struct message WmFrameChanged[] = { + { WM_WINDOWPOSCHANGING, sent|wparam|lparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE, 0 }, + { WM_NCCALCSIZE, sent|wparam|lparam, 1, 0xf }, + { WM_WINDOWPOSCHANGED, sent|wparam|lparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOREDRAW + |SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE, 0xf }, + { WM_GETTEXT, sent|optional }, + { 0 } +}; + +static const struct message WmFrameChanged_move[] = { + { WM_WINDOWPOSCHANGING, sent|wparam|lparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE, 0 }, + { WM_NCCALCSIZE, sent|wparam|lparam, 1, 0x3 }, + { WM_WINDOWPOSCHANGED, sent|wparam|lparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOREDRAW + |SWP_NOSIZE|SWP_NOCLIENTSIZE, 0x3 }, + { WM_MOVE, sent|defwinproc, 0 }, + { WM_GETTEXT, sent|optional }, + { 0 } +}; + static void test_setwindowpos(void) { HWND hwnd; RECT rc; LRESULT res; + const INT X = 50; + const INT Y = 50; const INT winX = 100; const INT winY = 100; const INT sysX = GetSystemMetrics(SM_CXMINTRACK); hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0, - 0, 0, winX, winY, 0, + X, Y, winX, winY, 0, NULL, NULL, 0); GetWindowRect(hwnd, &rc); - expect(sysX, rc.right); - expect(winY, rc.bottom); + expect(sysX + X, rc.right); + expect(winY + Y, rc.bottom); flush_events(); flush_sequence(); - res = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, winX, winY, 0); + res = SetWindowPos(hwnd, HWND_TOPMOST, 50, 50, winX, winY, 0); ok_sequence(WmZOrder, "Z-Order", TRUE); ok(res == TRUE, "SetWindowPos expected TRUE, got %ld\n", res); + GetWindowRect(hwnd, &rc); + expect(sysX + X, rc.right); + expect(winY + Y, rc.bottom); + + res = SetWindowPos( hwnd, 0, 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); + ok_sequence(WmFrameChanged, "FrameChanged", FALSE); + ok(res == TRUE, "SetWindowPos expected TRUE, got %ld.\n", res); + + GetWindowRect(hwnd, &rc); + expect(sysX + X, rc.right); + expect(winY + Y, rc.bottom); + + res = SetWindowPos( hwnd, 0, 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); + ok_sequence(WmFrameChanged_move, "FrameChanged", FALSE); + ok(res == TRUE, "SetWindowPos expected TRUE, got %ld.\n", res); + GetWindowRect(hwnd, &rc); expect(sysX, rc.right); expect(winY, rc.bottom); + DestroyWindow(hwnd); } @@ -12884,27 +12942,31 @@ static void test_TrackMouseEvent(void) static const struct message WmSetWindowRgn[] = { - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE }, - { WM_NCCALCSIZE, sent|wparam, 1 }, + { WM_WINDOWPOSCHANGING, sent|wparam|lparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE + |SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE, 0 }, + { WM_NCCALCSIZE, sent|wparam|lparam, 1, 0xf }, { WM_NCPAINT, sent|optional }, /* wparam != 1 */ { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE }, + { WM_WINDOWPOSCHANGED, sent|wparam|lparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE, 0xf }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmSetWindowRgn_no_redraw[] = { - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW }, - { WM_NCCALCSIZE, sent|wparam, 1 }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW }, + { WM_WINDOWPOSCHANGING, sent|wparam|lparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE + |SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW, 0 }, + { WM_NCCALCSIZE, sent|wparam|lparam, 1, 0xf }, + { WM_WINDOWPOSCHANGED, sent|wparam|lparam, SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE|SWP_NOREDRAW, 0xf }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { 0 } }; static const struct message WmSetWindowRgn_clear[] = { - { WM_WINDOWPOSCHANGING, sent/*|wparam*/, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOMOVE/*|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE only on some Windows versions */ }, - { WM_NCCALCSIZE, sent|wparam, 1 }, + { WM_WINDOWPOSCHANGING, sent/*|wparam|lparam*/, SWP_NOACTIVATE|SWP_FRAMECHANGED + |SWP_NOSIZE|SWP_NOMOVE/*|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE only on some Windows versions */, 0xf + /* Some newer Windows versions set window coordinates instead of zeros in WINDOWPOS structure */}, + { WM_NCCALCSIZE, sent|wparam|lparam, 1, 0xf }, { WM_NCPAINT, sent|optional }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, /* FIXME: remove optional once Wine is fixed */ diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index bbbab60fbe..aad5274973 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1873,6 +1873,18 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS *pWinpos, const RECT *old_window_rect, c params.lppos = &winposCopy; winposCopy = *pWinpos; + if (pWinpos->flags & SWP_NOMOVE) + { + winposCopy.x = old_window_rect->left; + winposCopy.y = old_window_rect->top; + } + + if (pWinpos->flags & SWP_NOSIZE) + { + winposCopy.cx = old_window_rect->right - old_window_rect->left; + winposCopy.cy = old_window_rect->bottom - old_window_rect->top; + } + wvrFlags = SendMessageW( pWinpos->hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms ); *new_client_rect = params.rgrc[0];
1
0
0
0
Vijay Kiran Kamuju : ntdll: Fix the SYSTEM_MODULE struct field names.
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: 1aff1e6a370ee8c0213a0fd4b220d121da8527aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1aff1e6a370ee8c0213a0fd4…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Sun Oct 20 11:18:52 2019 +0200 ntdll: Fix the SYSTEM_MODULE struct field names. Based on
https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/rtl/ldrreloc/…
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 10 +++++----- dlls/ntdll/tests/info.c | 2 +- include/winternl.h | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 5eacc5a23c..e33c24d7af 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3259,14 +3259,14 @@ NTSTATUS WINAPI LdrQueryProcessModuleInformation(PSYSTEM_MODULE_INFORMATION smi, size += sizeof(*sm); if (size <= buf_size) { - sm->Reserved1 = 0; /* FIXME */ - sm->Reserved2 = 0; /* FIXME */ + sm->Section = 0; /* FIXME */ + sm->MappedBaseAddress = mod->BaseAddress; sm->ImageBaseAddress = mod->BaseAddress; sm->ImageSize = mod->SizeOfImage; sm->Flags = mod->Flags; - sm->Id = id++; - sm->Rank = 0; /* FIXME */ - sm->Unknown = 0; /* FIXME */ + sm->LoadOrderIndex = id++; + sm->InitOrderIndex = 0; /* FIXME */ + sm->LoadCount = mod->LoadCount; str.Length = 0; str.MaximumLength = MAXIMUM_FILENAME_LENGTH; str.Buffer = (char*)sm->Name; diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 93920714f2..64c39f0940 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -488,7 +488,7 @@ static void test_query_module(void) /* Loop through all the modules/drivers, Wine doesn't get here (yet) */ for (i = 0; i < ModuleCount ; i++) { - ok( i == sm->Id, "Id (%d) should have matched %u\n", sm->Id, i); + ok( i == sm->LoadOrderIndex, "LoadOrderIndex (%d) should have matched %u\n", sm->LoadOrderIndex, i); sm++; } diff --git a/include/winternl.h b/include/winternl.h index 16df963770..9b8bef0fe7 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2271,14 +2271,14 @@ typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICAT typedef struct _SYSTEM_MODULE { - PVOID Reserved1; /* 00/00 */ - PVOID Reserved2; /* 04/08 */ + PVOID Section; /* 00/00 */ + PVOID MappedBaseAddress; /* 04/08 */ PVOID ImageBaseAddress; /* 08/10 */ ULONG ImageSize; /* 0c/18 */ ULONG Flags; /* 10/1c */ - WORD Id; /* 14/20 */ - WORD Rank; /* 16/22 */ - WORD Unknown; /* 18/24 */ + WORD LoadOrderIndex; /* 14/20 */ + WORD InitOrderIndex; /* 16/22 */ + WORD LoadCount; /* 18/24 */ WORD NameOffset; /* 1a/26 */ BYTE Name[MAXIMUM_FILENAME_LENGTH]; /* 1c/28 */ } SYSTEM_MODULE, *PSYSTEM_MODULE;
1
0
0
0
Nikolay Sivov : gdiplus: Trace GpRectF arguments.
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: 9d123b5424aabcbb99f0b1ad7617a8c8d987bfb5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d123b5424aabcbb99f0b1ad…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Oct 20 23:51:03 2019 +0300 gdiplus: Trace GpRectF arguments. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/brush.c | 4 ++-- dlls/gdiplus/matrix.c | 3 ++- dlls/gdiplus/metafile.c | 6 +++--- dlls/gdiplus/region.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index e65d4a29b2..e321dcaa60 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -410,7 +410,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect, { float angle; - TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode, + TRACE("(%s, %x, %x, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, mode, wrap, line); if(!line || !rect) @@ -466,7 +466,7 @@ GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect REAL sin_angle, cos_angle, sin_cos_angle; GpPointF start, end; - TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable, + TRACE("(%s, %x, %x, %.2f, %d, %d, %p)\n", debugstr_rectf(rect), startcolor, endcolor, angle, isAngleScalable, wrap, line); if (!rect || !line || wrap == WrapModeClamp) diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 2219d46369..5d8cf89007 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -86,7 +86,8 @@ GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect, GDIPCONST GpPointF *pt, GpMatrix **matrix) { REAL m11, m12, m21, m22, dx, dy; - TRACE("(%p, %p, %p)\n", rect, pt, matrix); + + TRACE("(%s, %p, %p)\n", debugstr_rectf(rect), pt, matrix); if(!matrix || !pt) return InvalidParameter; diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index d1a95d678d..2cb1c5f284 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -740,7 +740,7 @@ GpStatus WINGDIPAPI GdipRecordMetafile(HDC hdc, EmfType type, GDIPCONST GpRectF RECT rc, *lprc; GpStatus stat; - TRACE("(%p %d %p %d %p %p)\n", hdc, type, frameRect, frameUnit, desc, metafile); + TRACE("(%p %d %s %d %p %p)\n", hdc, type, debugstr_rectf(frameRect), frameUnit, desc, metafile); if (!hdc || type < EmfTypeEmfOnly || type > EmfTypeEmfPlusDual || !metafile) return InvalidParameter; @@ -885,7 +885,7 @@ GpStatus WINGDIPAPI GdipRecordMetafileStream(IStream *stream, HDC hdc, EmfType t { GpStatus stat; - TRACE("(%p %p %d %p %d %p %p)\n", stream, hdc, type, frameRect, frameUnit, desc, metafile); + TRACE("(%p %p %d %s %d %p %p)\n", stream, hdc, type, debugstr_rectf(frameRect), frameUnit, desc, metafile); if (!stream) return InvalidParameter; @@ -4048,7 +4048,7 @@ GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR* fileName, MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile) { - FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect, + FIXME("%s %p %d %s %d %s %p stub!\n", debugstr_w(fileName), hdc, type, debugstr_rectf(pFrameRect), frameUnit, debugstr_w(desc), metafile); return NotImplemented; diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 470bcd20ce..dcc4000283 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -461,7 +461,7 @@ GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect, { GpStatus stat; - TRACE("%p, %p\n", rect, region); + TRACE("%s, %p\n", debugstr_rectf(rect), region); if (!(rect && region)) return InvalidParameter;
1
0
0
0
Zebediah Figura : d3d8: Handle stateblocks in d3d8_device_SetTextureStageState().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: 65f7fab050520e67f65060b36be1f824caa5b07b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=65f7fab050520e67f65060b3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Oct 19 12:24:00 2019 -0500 d3d8: Handle stateblocks in d3d8_device_SetTextureStageState(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d8/device.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index cc1409d5c1..53e92707ca 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2226,9 +2226,17 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface, wined3d_mutex_lock(); if (l->sampler_state) - wined3d_device_set_sampler_state(device->wined3d_device, stage, l->u.sampler_state, value); + { + wined3d_stateblock_set_sampler_state(device->update_state, stage, l->u.sampler_state, value); + if (!device->recording) + wined3d_device_set_sampler_state(device->wined3d_device, stage, l->u.sampler_state, value); + } else - wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->u.texture_state, value); + { + wined3d_stateblock_set_texture_stage_state(device->update_state, stage, l->u.texture_state, value); + if (!device->recording) + wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->u.texture_state, value); + } wined3d_mutex_unlock(); return D3D_OK;
1
0
0
0
Zebediah Figura : d3d9: Handle stateblocks in d3d9_device_SetTextureStageState().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: cc2750b161ae9a1acd1f078ad71be1d5e16aa3b4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cc2750b161ae9a1acd1f078a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Oct 19 12:23:59 2019 -0500 d3d9: Handle stateblocks in d3d9_device_SetTextureStageState(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index dd4d57938e..07179900c4 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2575,7 +2575,9 @@ static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface } wined3d_mutex_lock(); - wined3d_device_set_texture_stage_state(device->wined3d_device, stage, tss_lookup[state], value); + wined3d_stateblock_set_texture_stage_state(device->update_state, stage, tss_lookup[state], value); + if (!device->recording) + wined3d_device_set_texture_stage_state(device->wined3d_device, stage, tss_lookup[state], value); wined3d_mutex_unlock(); return D3D_OK;
1
0
0
0
Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_texture_stage_state().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: d2a44f45ad1e5942d9c2aecea487fd4b7b9f8ac5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d2a44f45ad1e5942d9c2aece…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Oct 19 12:23:58 2019 -0500 wined3d: Introduce wined3d_stateblock_set_texture_stage_state(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/stateblock.c | 23 +++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 26 insertions(+) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 70724f0545..1965a4303f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1462,6 +1462,29 @@ void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *state stateblock->changed.samplerState[sampler_idx] |= 1u << state; } +void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, + UINT stage, enum wined3d_texture_stage_state state, DWORD value) +{ + TRACE("stateblock %p, stage %u, state %s, value %#x.\n", + stateblock, stage, debug_d3dtexturestate(state), value); + + if (state > WINED3D_HIGHEST_TEXTURE_STATE) + { + WARN("Invalid state %#x passed.\n", state); + return; + } + + if (stage > WINED3D_MAX_TEXTURES) + { + WARN("Attempting to set stage %u which is higher than the max stage %u, ignoring.\n", + stage, WINED3D_MAX_TEXTURES); + return; + } + + stateblock->stateblock_state.texture_states[stage][state] = value; + stateblock->changed.textureState[stage] |= 1u << state; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index bf6b786704..2df6c510b1 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -265,6 +265,7 @@ @ cdecl wined3d_stateblock_set_ps_consts_i(ptr long long ptr) @ cdecl wined3d_stateblock_set_render_state(ptr long long) @ cdecl wined3d_stateblock_set_sampler_state(ptr long long long) +@ cdecl wined3d_stateblock_set_texture_stage_state(ptr long long long) @ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr) @ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr) @ cdecl wined3d_stateblock_set_vs_consts_b(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2fd16958d5..57f5775409 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2673,6 +2673,8 @@ void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stat enum wined3d_render_state state, DWORD value); void __cdecl wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value); +void __cdecl wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, + UINT stage, enum wined3d_texture_stage_state state, DWORD value); void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, struct wined3d_vertex_declaration *declaration); void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
1
0
0
0
Zebediah Figura : d3d9: Handle stateblocks in d3d9_device_SetSamplerState().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: d16d5be1d1341e502a2e3cef38162d58943903b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d16d5be1d1341e502a2e3cef…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Oct 19 12:23:57 2019 -0500 d3d9: Handle stateblocks in d3d9_device_SetSamplerState(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 3d16812d59..dd4d57938e 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2603,7 +2603,9 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState(IDirect3DDev TRACE("iface %p, sampler %u, state %#x, value %#x.\n", iface, sampler, state, value); wined3d_mutex_lock(); - wined3d_device_set_sampler_state(device->wined3d_device, sampler, state, value); + wined3d_stateblock_set_sampler_state(device->update_state, sampler, state, value); + if (!device->recording) + wined3d_device_set_sampler_state(device->wined3d_device, sampler, state, value); wined3d_mutex_unlock(); return D3D_OK;
1
0
0
0
Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_sampler_state().
by Alexandre Julliard
21 Oct '19
21 Oct '19
Module: wine Branch: master Commit: bbb64e7e9575baa48f623e197d956eb8bc30c560 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bbb64e7e9575baa48f623e19…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat Oct 19 12:23:56 2019 -0500 wined3d: Introduce wined3d_stateblock_set_sampler_state(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/stateblock.c | 19 +++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 22 insertions(+) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index a96093295c..70724f0545 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1443,6 +1443,25 @@ void CDECL wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stateb stateblock->changed.blend_state = TRUE; } +void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, + UINT sampler_idx, enum wined3d_sampler_state state, DWORD value) +{ + TRACE("stateblock %p, sampler_idx %u, state %s, value %#x.\n", + stateblock, sampler_idx, debug_d3dsamplerstate(state), value); + + if (sampler_idx >= WINED3DVERTEXTEXTURESAMPLER0 && sampler_idx <= WINED3DVERTEXTEXTURESAMPLER3) + sampler_idx -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS); + + if (sampler_idx >= ARRAY_SIZE(stateblock->stateblock_state.sampler_states)) + { + WARN("Invalid sampler %u.\n", sampler_idx); + return; + } + + stateblock->stateblock_state.sampler_states[sampler_idx][state] = value; + stateblock->changed.samplerState[sampler_idx] |= 1u << state; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index c7b10a2b56..bf6b786704 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -264,6 +264,7 @@ @ cdecl wined3d_stateblock_set_ps_consts_f(ptr long long ptr) @ cdecl wined3d_stateblock_set_ps_consts_i(ptr long long ptr) @ cdecl wined3d_stateblock_set_render_state(ptr long long) +@ cdecl wined3d_stateblock_set_sampler_state(ptr long long long) @ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr) @ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr) @ cdecl wined3d_stateblock_set_vs_consts_b(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 445ecd2f55..2fd16958d5 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2671,6 +2671,8 @@ HRESULT __cdecl wined3d_stateblock_set_ps_consts_i(struct wined3d_stateblock *st unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants); void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, enum wined3d_render_state state, DWORD value); +void __cdecl wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, + UINT sampler_idx, enum wined3d_sampler_state state, DWORD value); void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, struct wined3d_vertex_declaration *declaration); void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
62
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Results per page:
10
25
50
100
200