Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 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
September 2019
- 76 participants
- 1410 messages
[PATCH v2 resend 1/4] powrprof/tests: Test NtPowerInformation() with SystemExecutionState.
by Chip Davis
Test interaction between SetThreadExecutionState(), PowerSetRequest(),
and this parameter.
Signed-off-by: Chip Davis <cdavis(a)codeweavers.com>
---
Notes:
v2: Test that, when a thread terminates, its execution state is cleaned up.
configure.ac | 1 +
dlls/powrprof/tests/Makefile.in | 4 +
dlls/powrprof/tests/powrprof.c | 219 ++++++++++++++++++++++++++++++++
include/powrprof.h | 5 +
4 files changed, 229 insertions(+)
create mode 100644 dlls/powrprof/tests/Makefile.in
create mode 100644 dlls/powrprof/tests/powrprof.c
diff --git a/configure.ac b/configure.ac
index f45c078674c2..b277642e316f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3616,6 +3616,7 @@ WINE_CONFIG_MAKEFILE(dlls/pdh/tests)
WINE_CONFIG_MAKEFILE(dlls/photometadatahandler)
WINE_CONFIG_MAKEFILE(dlls/pidgen)
WINE_CONFIG_MAKEFILE(dlls/powrprof)
+WINE_CONFIG_MAKEFILE(dlls/powrprof/tests)
WINE_CONFIG_MAKEFILE(dlls/printui)
WINE_CONFIG_MAKEFILE(dlls/prntvpt)
WINE_CONFIG_MAKEFILE(dlls/propsys)
diff --git a/dlls/powrprof/tests/Makefile.in b/dlls/powrprof/tests/Makefile.in
new file mode 100644
index 000000000000..87aa06be5026
--- /dev/null
+++ b/dlls/powrprof/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = powrprof.dll
+IMPORTS = powrprof
+
+C_SRCS = powrprof.c
diff --git a/dlls/powrprof/tests/powrprof.c b/dlls/powrprof/tests/powrprof.c
new file mode 100644
index 000000000000..d744895cc484
--- /dev/null
+++ b/dlls/powrprof/tests/powrprof.c
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2019 Chip Davis for CodeWeavers
+ *
+ * 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 <stdarg.h>
+#include <stdio.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+#include "powrprof.h"
+
+#include "wine/test.h"
+
+HANDLE (WINAPI *pPowerCreateRequest)(REASON_CONTEXT *);
+BOOL (WINAPI *pPowerSetRequest)(HANDLE, POWER_REQUEST_TYPE);
+BOOL (WINAPI *pPowerClearRequest)(HANDLE, POWER_REQUEST_TYPE);
+
+static void test_system_execution_state(void)
+{
+ EXECUTION_STATE es, old_es;
+ NTSTATUS status;
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+
+ old_es = SetThreadExecutionState(ES_SYSTEM_REQUIRED);
+ todo_wine ok(old_es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", old_es);
+
+ old_es = es;
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(es == old_es, "unexpected execution state 0x%08x vs 0x%08x\n", es, old_es);
+
+ old_es = SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
+ todo_wine ok(old_es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", old_es);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ todo_wine ok(es & ES_DISPLAY_REQUIRED, "unexpected execution state 0x%08x\n", es);
+
+ old_es = SetThreadExecutionState(ES_CONTINUOUS);
+ ok(old_es == (ES_CONTINUOUS|ES_DISPLAY_REQUIRED), "unexpected execution state 0x%08x\n", old_es);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+
+ old_es = SetThreadExecutionState(ES_DISPLAY_REQUIRED);
+ ok(old_es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", old_es);
+
+ old_es = es;
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(es == old_es, "unexpected execution state 0x%08x vs 0x%08x\n", es, old_es);
+}
+
+static HANDLE events[2];
+
+static DWORD CALLBACK execution_state_thread(LPVOID param)
+{
+ EXECUTION_STATE old_es;
+
+ SetThreadExecutionState(ES_SYSTEM_REQUIRED);
+ SignalObjectAndWait(events[0], events[1], INFINITE, FALSE);
+
+ old_es = SetThreadExecutionState(ES_DISPLAY_REQUIRED);
+ ok(old_es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", old_es);
+ SignalObjectAndWait(events[0], events[1], INFINITE, FALSE);
+
+ old_es = SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
+ ok(old_es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", old_es);
+ SignalObjectAndWait(events[0], events[1], INFINITE, FALSE);
+
+ old_es = SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
+ ok(old_es == (ES_CONTINUOUS|ES_SYSTEM_REQUIRED), "unexpected execution state 0x%08x\n", old_es);
+ SignalObjectAndWait(events[0], events[1], INFINITE, FALSE);
+
+ return 0;
+}
+
+static void test_system_execution_state_other_thread(void)
+{
+ HANDLE thread;
+ EXECUTION_STATE base_es, es;
+ NTSTATUS status;
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &base_es, sizeof(base_es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ trace("base execution state = 0x%08x\n", base_es);
+
+ events[0] = CreateEventW(NULL, FALSE, FALSE, NULL);
+ events[1] = CreateEventW(NULL, FALSE, FALSE, NULL);
+ thread = CreateThread(NULL, 0, execution_state_thread, NULL, 0, NULL);
+ ok(thread != NULL, "Failed to create thread, err %u\n", GetLastError());
+
+ WaitForSingleObject(events[0], INFINITE);
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(es == base_es, "unexpected execution state 0x%08x\n", es);
+ es = SetThreadExecutionState(0);
+ ok(es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", es);
+ SignalObjectAndWait(events[1], events[0], INFINITE, FALSE);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(es == base_es, "unexpected execution state 0x%08x\n", es);
+ es = SetThreadExecutionState(0);
+ ok(es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", es);
+ SignalObjectAndWait(events[1], events[0], INFINITE, FALSE);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ todo_wine ok(es & ES_SYSTEM_REQUIRED, "unexpected execution state 0x%08x\n", es);
+ es = SetThreadExecutionState(0);
+ todo_wine ok(es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", es);
+ SignalObjectAndWait(events[1], events[0], INFINITE, FALSE);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ todo_wine ok(es & ES_DISPLAY_REQUIRED, "unexpected execution state 0x%08x\n", es);
+ es = SetThreadExecutionState(0);
+ todo_wine ok(es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", es);
+ SignalObjectAndWait(events[1], thread, INFINITE, FALSE);
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(es == base_es, "unexpected execution state 0x%08x\n", es);
+ es = SetThreadExecutionState(0);
+ todo_wine ok(es == ES_CONTINUOUS, "unexpected execution state 0x%08x\n", es);
+
+ CloseHandle(thread);
+ CloseHandle(events[0]);
+ CloseHandle(events[1]);
+}
+
+static void test_system_execution_state_power_request()
+{
+ HANDLE req;
+ REASON_CONTEXT reason;
+ BOOL ret;
+ NTSTATUS status;
+ EXECUTION_STATE base_es, es;
+ static const WCHAR reasonW[] = {'W', 'i', 'n', 'e', ' ', 't', 'e', 's', 't', 0};
+
+ if (!pPowerCreateRequest)
+ {
+ win_skip("Power request objects unavailable\n");
+ return;
+ }
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &base_es, sizeof(base_es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ trace("base execution state = 0x%08x\n", base_es);
+
+ reason.Version = 0;
+ reason.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING;
+ reason.Reason.SimpleReasonString = reasonW;
+ req = pPowerCreateRequest(&reason);
+ todo_wine ok(req != INVALID_HANDLE_VALUE, "err %u\n", GetLastError());
+
+ ret = pPowerSetRequest(req, PowerRequestSystemRequired);
+ todo_wine ok(ret, "err %u\n", GetLastError());
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ todo_wine ok(es & ES_SYSTEM_REQUIRED, "unexpected execution state 0x%08x\n", es);
+
+ ret = pPowerClearRequest(req, PowerRequestSystemRequired);
+ todo_wine ok(ret, "err %u\n", GetLastError());
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(!(es & ES_SYSTEM_REQUIRED) || (base_es & ES_SYSTEM_REQUIRED), "unexpected execution state 0x%08x\n", es);
+
+ ret = pPowerSetRequest(req, PowerRequestDisplayRequired);
+ todo_wine ok(ret, "err %u\n", GetLastError());
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ todo_wine ok(es & ES_DISPLAY_REQUIRED, "unexpected execution state 0x%08x\n", es);
+
+ ret = CloseHandle(req);
+ todo_wine ok(ret, "err %u\n", GetLastError());
+
+ status = CallNtPowerInformation(SystemExecutionState, NULL, 0, &es, sizeof(es));
+ ok(status == STATUS_SUCCESS, "status %08x\n", status);
+ ok(!(es & ES_DISPLAY_REQUIRED) || (base_es & ES_DISPLAY_REQUIRED), "unexpected execution state 0x%08x\n", es);
+}
+
+START_TEST(powrprof)
+{
+ HMODULE hkernel32;
+
+ hkernel32 = GetModuleHandleA("kernel32.dll");
+ pPowerCreateRequest = (void *)GetProcAddress(hkernel32, "PowerCreateRequest");
+ pPowerSetRequest = (void *)GetProcAddress(hkernel32, "PowerSetRequest");
+ pPowerClearRequest = (void *)GetProcAddress(hkernel32, "PowerClearRequest");
+
+ test_system_execution_state();
+ test_system_execution_state_other_thread();
+ test_system_execution_state_power_request();
+}
diff --git a/include/powrprof.h b/include/powrprof.h
index 318188e465e5..421d9d4fc763 100644
--- a/include/powrprof.h
+++ b/include/powrprof.h
@@ -146,6 +146,11 @@ extern "C" {
typedef BOOLEAN (CALLBACK* PWRSCHEMESENUMPROC)(UINT, DWORD, LPWSTR, DWORD, LPWSTR, PPOWER_POLICY, LPARAM);
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED
+typedef LONG NTSTATUS;
+#endif
+
NTSTATUS WINAPI CallNtPowerInformation(POWER_INFORMATION_LEVEL, PVOID, ULONG, PVOID, ULONG);
BOOLEAN WINAPI CanUserWritePwrScheme(VOID);
BOOLEAN WINAPI DeletePwrScheme(UINT);
--
2.21.0
Sept. 2, 2019
[PATCH] cabinet: A spelling fix in a variable / field name.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/cabinet/fci.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c
index 03fbf4676bd..df103225bd5 100644
--- a/dlls/cabinet/fci.c
+++ b/dlls/cabinet/fci.c
@@ -174,7 +174,7 @@ typedef struct FCI_Int
cab_UWORD cFolders;
cab_UWORD cFiles;
cab_ULONG cDataBlocks;
- cab_ULONG cbFileRemainer; /* uncompressed, yet to be written data */
+ cab_ULONG cbFileRemainder; /* uncompressed, yet to be written data */
/* of spanned file of a spanning folder of a spanning cabinet */
struct temp_file data;
BOOL fNewPrevious;
@@ -839,7 +839,7 @@ static BOOL add_data_to_folder( FCI_Int *fci, struct folder *folder, cab_ULONG *
static BOOL add_files_to_folder( FCI_Int *fci, struct folder *folder, cab_ULONG payload )
{
cab_ULONG sizeOfFiles = 0, sizeOfFilesPrev;
- cab_ULONG cbFileRemainer = 0;
+ cab_ULONG cbFileRemainder = 0;
struct file *file, *next;
LIST_FOR_EACH_ENTRY_SAFE( file, next, &fci->files_list, struct file, entry )
@@ -852,10 +852,10 @@ static BOOL add_files_to_folder( FCI_Int *fci, struct folder *folder, cab_ULONG
sizeOfFilesPrev = sizeOfFiles;
/* set complete size of all processed files */
- if (file->folder == cffileCONTINUED_FROM_PREV && fci->cbFileRemainer != 0)
+ if (file->folder == cffileCONTINUED_FROM_PREV && fci->cbFileRemainder != 0)
{
- sizeOfFiles += fci->cbFileRemainer;
- fci->cbFileRemainer = 0;
+ sizeOfFiles += fci->cbFileRemainder;
+ fci->cbFileRemainder = 0;
}
else sizeOfFiles += file->size;
@@ -888,7 +888,7 @@ static BOOL add_files_to_folder( FCI_Int *fci, struct folder *folder, cab_ULONG
{
/* The size of the uncompressed, data of a spanning file in a */
/* spanning data */
- cbFileRemainer = sizeOfFiles - payload;
+ cbFileRemainder = sizeOfFiles - payload;
}
file->folder = cffileCONTINUED_FROM_PREV;
}
@@ -899,7 +899,7 @@ static BOOL add_files_to_folder( FCI_Int *fci, struct folder *folder, cab_ULONG
fci->files_size -= size;
}
}
- fci->cbFileRemainer = cbFileRemainer;
+ fci->cbFileRemainder = cbFileRemainder;
return TRUE;
}
--
2.20.1
Sept. 2, 2019
[PATCH] widl: Fix a variable name in a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
tools/widl/typelib_struct.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/widl/typelib_struct.h b/tools/widl/typelib_struct.h
index 0d9f8ebd53c..58dd95ec3bd 100644
--- a/tools/widl/typelib_struct.h
+++ b/tools/widl/typelib_struct.h
@@ -327,7 +327,7 @@ typedef struct {
} SLTG_BlkEntry;
/* The order of the blocks in the file is given by starting at Block
- entry firt_blk and stepping through using the next pointer */
+ entry first_blk and stepping through using the next pointer */
/* These then get followed by this magic */
typedef struct {
--
2.20.1
Sept. 2, 2019
[PATCH] advapi32/tests: Spelling tweaks in ok() messages.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/advapi32/tests/crypt_lmhash.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c
index a6e812e54a9..4c96e5b7629 100644
--- a/dlls/advapi32/tests/crypt_lmhash.c
+++ b/dlls/advapi32/tests/crypt_lmhash.c
@@ -287,18 +287,18 @@ static void test_SystemFunction004(void)
r = pSystemFunction002(out.Buffer, key.Buffer, output);
ok(r == STATUS_SUCCESS, "function failed\n");
- ok(((unsigned int*)output)[0] == in.Length, "crypted length wrong\n");
- ok(((unsigned int*)output)[1] == 1, "crypted value wrong\n");
+ ok(((unsigned int*)output)[0] == in.Length, "encrypted length wrong\n");
+ ok(((unsigned int*)output)[1] == 1, "encrypted value wrong\n");
memset(output, 0, sizeof output);
r = pSystemFunction002(out.Buffer+8, key.Buffer, output);
ok(r == STATUS_SUCCESS, "function failed\n");
- ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n");
+ ok(!memcmp(output, inbuf, sizeof output), "encrypted data wrong\n");
memset(output, 0, sizeof output);
r = pSystemFunction002(out.Buffer+16, key.Buffer, output);
ok(r == STATUS_SUCCESS, "function failed\n");
- ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n");
+ ok(!memcmp(output, inbuf, sizeof output), "encrypted data wrong\n");
}
static void test_SystemFunction005(void)
--
2.20.1
Sept. 2, 2019
[PATCH] advapi32/tests: Spelling fixes in a couple of comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/advapi32/tests/registry.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index 6b199bc4d35..675426d4a97 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -3933,7 +3933,7 @@ static void test_RegLoadMUIString(void)
ret = GetSystemDirectoryA(sysdir, ARRAY_SIZE(sysdir));
ok(ret > 0, "GetSystemDirectoryA failed\n");
- /* change the current direcoty to system32 */
+ /* change the current directory to system32 */
GetCurrentDirectoryW(ARRAY_SIZE(curdirW), curdirW);
SetCurrentDirectoryW(sysdirW);
@@ -3982,7 +3982,7 @@ static void test_RegLoadMUIString(void)
ret = pRegLoadMUIStringA(hkey, tz_value, buf, ARRAY_SIZE(buf), &size, 0, NULL);
ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret);
- /* change the current direcoty to other than system32 directory */
+ /* change the current directory to other than system32 directory */
SetCurrentDirectoryA("\\");
size = 0xdeadbeef;
--
2.20.1
Sept. 2, 2019
[PATCH] comctl32: Typo and spelling fixes in comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/comctl32/commctrl.c | 2 +-
dlls/comctl32/datetime.c | 2 +-
dlls/comctl32/rebar.c | 2 +-
dlls/comctl32/syslink.c | 2 +-
dlls/comctl32/tests/imagelist.c | 2 +-
dlls/comctl32/toolbar.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 82ed38ebe52..ac53a2cf0fa 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -671,7 +671,7 @@ CreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy,
*
* NOTES
* This function is just a dummy - all the controls are registered at
- * the DLL initialization time. See InitCommonContolsEx for details.
+ * the DLL initialization time. See InitCommonControlsEx for details.
*/
VOID WINAPI
diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index 9e91a2f9487..05ae3a61c0e 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -237,7 +237,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy
* *'dddddd' is handled as 'dddd' plus 'dd'.
* *unrecognized formats are strings (here given the type DT_STRING;
* start of the string is encoded in lower bits of DT_STRING.
- * Therefore, 'string' ends finally up as '<show seconds>tring'.
+ * Therefore, 'string' ends up as '<show seconds>tring'.
*
*/
static void
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index f113bb2d1f1..8c667a192b3 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -2135,7 +2135,7 @@ REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
}
else
{
- /* Place the band in the prexisting row the mouse is hovering over */
+ /* Place the band in the preexisting row the mouse is hovering over */
iRowBegin = first_visible(infoPtr);
while(iRowBegin < infoPtr->uNumBands)
{
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c
index 7b9cccfc989..b2d36826d2a 100644
--- a/dlls/comctl32/syslink.c
+++ b/dlls/comctl32/syslink.c
@@ -951,7 +951,7 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
/***********************************************************************
* SYSLINK_SetFocusLink
- * Updates the focus status bits and focusses the specified link.
+ * Updates the focus status bits and focuses the specified link.
* If no document item is specified, the focus bit will be removed from all links.
* Returns the previous focused item.
*/
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c
index 0e62ab9e0c8..daa1715e7ee 100644
--- a/dlls/comctl32/tests/imagelist.c
+++ b/dlls/comctl32/tests/imagelist.c
@@ -2164,7 +2164,7 @@ static void test_color_table(UINT ilc)
rgb[2].rgbBlue = 0xff;
check_color_table("remove all, add 8", hdc, himl, ilc, rgb, default_table);
- /* remove all, add 4. Color table remains the same since it's inplicitly
+ /* remove all, add 4. Color table remains the same since it's implicitly
been set by the previous _Add */
ret = pImageList_Remove(himl, -1);
ok(ret, "got %d\n", ret);
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 4e4fd757b16..ceab5328bc7 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -5691,7 +5691,7 @@ TOOLBAR_LButtonUp (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
if (nButton == infoPtr->nButtonDrag)
{
- /* if the button is moved sightly left and we have a
+ /* if the button is moved slightly left and we have a
* separator there then remove it */
if (pt.x < (btnPtr->rect.left + (btnPtr->rect.right - btnPtr->rect.left)/2))
{
--
2.20.1
Sept. 2, 2019
[PATCH] makefiles: Avoid rpath=$ORIGIN/... on NetBSD.
by Francois Gouget
On NetBSD using $ORIGIN in an rpath does not work when running the
executable from a symbolic link located in another directory. This is
probably because $ORIGIN is set from /proc/self/exe which contains the
paths of the symbolic link instead of that of the executable, resulting
in the rpath pointing to the wrong location.
For Wine this means running './wine notepad' from a 64 bit build does
not work because libwine.so.1 is not found.
So avoid $ORIGIN on NetBSD and instead use the full path to the build
directory. At least this will work until the build directory is moved
around.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
I don't really like this patch but it gets things going. I consider it
to be a NetBSD bug and ideally they would fix it. But then we need some
solution in the interim. Also the NetBSD developers seem to dislike the
$ORIGIN feature so I'm not sure that will happen.
https://mail-index.netbsd.org/tech-pkg/2013/11/15/msg012248.html
configure.ac | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 581189b2156..2a535ca90eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -958,11 +958,21 @@ case $host_os in
WINEPRELOADER_LDFLAGS="-static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000"
WINE_TRY_CFLAGS([-Wl,--rpath,\$ORIGIN/../lib],
- [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
- LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"],
+ [rpath_opt="-Wl,--rpath"],
[WINE_TRY_CFLAGS([-Wl,-R,\$ORIGIN/../lib],
- [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
- LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"])])
+ [rpath_opt="-Wl,-R"])])
+ if test -n "$rpath_opt"
+ then
+ LDRPATH_INSTALL="$rpath_opt,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`"
+ case $host_os in
+ netbsd)
+ LDRPATH_LOCAL="$rpath_opt,$ac_pwd/libs/wine"
+ ;;
+ *)
+ LDRPATH_LOCAL="$rpath_opt,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"
+ ;;
+ esac
+ fi
WINE_TRY_CFLAGS([-Wl,--enable-new-dtags],
[LDRPATH_INSTALL="$LDRPATH_INSTALL -Wl,--enable-new-dtags"])
--
2.20.1
Sept. 2, 2019
[PATCH] libwine: Fully dereference the /proc/self/exe symbolic link.
by Francois Gouget
Linux will do it for us but not NetBSD. That is, if foo is an executable
that prints the path /proc/self/exe points to, on Linux one gets:
$ ./foo
/tmp/foo
$ ln -s foo bar
$ ln -s bar babar
$ /tmp/babar
/tmp/foo
But on NetBSD one gets instead:
$ ./foo
/tmp/./foo
$ ln -s foo bar
$ ln -s bar babar
$ /tmp/babar
/tmp/babar
Fully dereferencing /proc/self/exe is necessary to be able to run both
32 and 64 bit executables from the build tree.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Using realpath() simplifies the code quite a bit and letting it allocate
the memory itself seems to be part of POSIX.1-2008. But let me know if
this self-allocating feature should be avoided or if realpath() should
be avoided altogether (though note we're already using it in a couple of
places).
libs/wine/config.c | 31 +++++++------------------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/libs/wine/config.c b/libs/wine/config.c
index ab5e3816dc5..f4fda02bf95 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -164,33 +164,16 @@ static char *get_runtime_libdir(void)
/* read a symlink and return its directory */
static char *symlink_dirname( const char *name )
{
- char *p, *buffer, *absdir = NULL;
- int ret, size;
+ char *p, *fullpath = NULL;
- for (size = 256; ; size *= 2)
+ fullpath = realpath( name, NULL );
+ if (fullpath)
{
- if (!(buffer = malloc( size ))) return NULL;
- if ((ret = readlink( name, buffer, size )) == -1) break;
- if (ret != size)
- {
- buffer[ret] = 0;
- if (!(p = strrchr( buffer, '/' ))) break;
- if (p == buffer) p++;
- *p = 0;
- if (buffer[0] == '/') return buffer;
- /* make it absolute */
- absdir = xmalloc( strlen(name) + strlen(buffer) + 1 );
- strcpy( absdir, name );
- if (!(p = strrchr( absdir, '/' ))) break;
- strcpy( p + 1, buffer );
- free( buffer );
- return absdir;
- }
- free( buffer );
+ p = strrchr( fullpath, '/' );
+ if (p == fullpath) p++;
+ if (p) *p = 0;
}
- free( buffer );
- free( absdir );
- return NULL;
+ return fullpath;
}
/* return the directory that contains the main exe at run-time */
--
2.20.1
Sept. 2, 2019
[PATCH] libwine: Like Linux, NetBSD has /proc/self/exe.
by Francois Gouget
It also has /proc/curproc/exe but there does not seem to be a reason to
prefer it over /proc/self/exe.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
libs/wine/config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/wine/config.c b/libs/wine/config.c
index 3c9110b3b80..ab5e3816dc5 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -61,7 +61,7 @@ static void fatal_error( const char *err, ... ) __attribute__((noreturn,format(
static void fatal_perror( const char *err, ... ) __attribute__((noreturn,format(printf,1,2)));
#endif
-#if defined(__linux__) || defined(__FreeBSD_kernel__ )
+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
static const char exe_link[] = "/proc/self/exe";
#elif defined (__FreeBSD__) || defined(__DragonFly__)
static const char exe_link[] = "/proc/curproc/file";
--
2.20.1
Sept. 2, 2019
[PATCH] libwine: Only link libi386 with the libraries that need it.
by Francois Gouget
In particular it does not make sense to link executables and dlls built
with MinGW with it.
From: Naveen Narayanan <zerous(a)nocebo.space>
Signed-off-by: Francois Gouget <fgouget(a)icodeweavers.com>
---
configure.ac | 2 +-
libs/wine/Makefile.in | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index d0af7ef4a1a..581189b2156 100644
--- a/configure.ac
+++ b/configure.ac
@@ -409,7 +409,7 @@ WINE_WARNING_WITH(gettext,[test "$MSGFMT" = false],
dnl **** Check for some libraries ****
dnl Check for -li386 for NetBSD and OpenBSD
-AC_CHECK_LIB(i386,i386_set_ldt)
+AC_CHECK_LIB(i386,i386_set_ldt,[AC_SUBST(I386_LIBS, "-li386")])
AC_SUBST(OPENGL_LIBS,"")
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index 789d09a2185..f7dd34b058d 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -1,4 +1,5 @@
-EXTRALIBS = $(DL_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS)
+EXTRALIBS = $(DL_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(I386_LIBS)
+
C_SRCS = \
config.c \
--
2.20.1
Sept. 2, 2019