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
November 2020
- 73 participants
- 1459 messages
[PATCH 2/5] riched20: Use a run ptr in the link notify function.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index b54b9334265..38553f7add3 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3451,8 +3451,9 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
int x,y;
BOOL isExact;
ME_Cursor cursor; /* The start of the clicked text. */
-
+ ME_Run *run;
ENLINK info;
+
x = (short)LOWORD(lParam);
y = (short)HIWORD(lParam);
ME_CharFromPos(editor, x, y, &cursor, &isExact);
@@ -3460,8 +3461,6 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
if (is_link( &cursor.pRun->member.run ))
{ /* The clicked run has CFE_LINK set */
- ME_DisplayItem *di;
-
info.nmhdr.hwndFrom = NULL;
info.nmhdr.idFrom = 0;
info.nmhdr.code = EN_LINK;
@@ -3472,15 +3471,15 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
/* find the first contiguous run with CFE_LINK set */
info.chrg.cpMin = ME_GetCursorOfs(&cursor);
- di = cursor.pRun;
- while (ME_PrevRun( NULL, &di, FALSE ) && is_link( &di->member.run ))
- info.chrg.cpMin -= di->member.run.len;
+ run = &cursor.pRun->member.run;
+ while ((run = run_prev( run )) && is_link( run ))
+ info.chrg.cpMin -= run->len;
/* find the last contiguous run with CFE_LINK set */
info.chrg.cpMax = ME_GetCursorOfs(&cursor) + cursor.pRun->member.run.len;
- di = cursor.pRun;
- while (ME_NextRun( NULL, &di, FALSE ) && is_link( &di->member.run ))
- info.chrg.cpMax += di->member.run.len;
+ run = &cursor.pRun->member.run;
+ while ((run = run_next( run )) && is_link( run ))
+ info.chrg.cpMax += run->len;
ITextHost_TxNotify(editor->texthost, info.nmhdr.code, &info);
}
--
2.23.0
Nov. 2, 2020
[PATCH 1/5] riched20: Use paragraph ptrs in the WM_CHAR handler.
by Huw Davies
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 46 ++++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index c1138bd1dab..b54b9334265 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -897,13 +897,13 @@ void ME_RTFTblAttrHook(RTF_Info *info)
if (cellNum >= MAX_TABLE_CELLS)
break;
info->tableDef->cells[cellNum].rightBoundary = info->rtfParam;
- if (cellNum < MAX_TAB_STOPS) {
+ if (cellNum < MAX_TAB_STOPS)
+ {
/* Tab stops were used to store cell positions before v4.1 but v4.1
* still seems to set the tabstops without using them. */
- ME_DisplayItem *para = info->editor->pCursors[0].pPara;
- PARAFORMAT2 *pFmt = ¶->member.para.fmt;
- pFmt->rgxTabs[cellNum] &= ~0x00FFFFFF;
- pFmt->rgxTabs[cellNum] |= 0x00FFFFFF & info->rtfParam;
+ PARAFORMAT2 *fmt = &info->editor->pCursors[0].pPara->member.para.fmt;
+ fmt->rgxTabs[cellNum] &= ~0x00FFFFFF;
+ fmt->rgxTabs[cellNum] |= 0x00FFFFFF & info->rtfParam;
}
info->tableDef->numCellsDefined++;
break;
@@ -2795,7 +2795,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
if ((unsigned)wstr >= ' ' || wstr == '\t')
{
ME_Cursor cursor = editor->pCursors[0];
- ME_DisplayItem *para = cursor.pPara;
+ ME_Paragraph *para = &cursor.pPara->member.para;
int from, to;
BOOL ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000;
ME_GetSelectionOfs(editor, &from, &to);
@@ -2803,38 +2803,40 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
/* v4.1 allows tabs to be inserted with ctrl key down */
!(ctrl_is_down && !editor->bEmulateVersion10))
{
- ME_DisplayItem *para;
BOOL selected_row = FALSE;
- para = cursor.pPara;
if (ME_IsSelection(editor) &&
cursor.pRun->member.run.nCharOfs + cursor.nOffset == 0 &&
- to == ME_GetCursorOfs(&editor->pCursors[0]) &&
- para->member.para.prev_para->type == diParagraph)
+ to == ME_GetCursorOfs(&editor->pCursors[0]) && para_prev( para ))
{
- para = para->member.para.prev_para;
+ para = para_prev( para );
selected_row = TRUE;
}
- if (ME_IsInTable(para))
+ if (para_in_table( para ))
{
table_handle_tab( editor, selected_row );
ME_CommitUndo(editor);
return 0;
}
- } else if (!editor->bEmulateVersion10) { /* v4.1 */
- if (para->member.para.nFlags & MEPF_ROWEND) {
- if (from == to) {
- para = para->member.para.next_para;
- if (para->member.para.nFlags & MEPF_ROWSTART)
- para = para->member.para.next_para;
- editor->pCursors[0].pPara = para;
- editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
+ }
+ else if (!editor->bEmulateVersion10) /* v4.1 */
+ {
+ if (para->nFlags & MEPF_ROWEND)
+ {
+ if (from == to)
+ {
+ para = para_next( para );
+ if (para->nFlags & MEPF_ROWSTART) para = para_next( para );
+ editor->pCursors[0].pPara = para_get_di( para );
+ editor->pCursors[0].pRun = run_get_di( para_first_run( para ) );
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
}
}
- } else { /* v1.0 - 3.0 */
- if (ME_IsInTable(cursor.pRun) &&
+ }
+ else /* v1.0 - 3.0 */
+ {
+ if (para_in_table( para ) &&
cursor.pRun->member.run.nFlags & MERF_ENDPARA &&
from == to)
{
--
2.23.0
Nov. 2, 2020
[PATCH 4/4] concrt140/tests: Add _Context::_CurrentContext tests.
by Daniel Lehman
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
configure.ac | 1 +
dlls/concrt140/tests/Makefile.in | 4 ++
dlls/concrt140/tests/concrt140.c | 82 ++++++++++++++++++++++++++++++++
3 files changed, 87 insertions(+)
create mode 100644 dlls/concrt140/tests/Makefile.in
create mode 100644 dlls/concrt140/tests/concrt140.c
diff --git a/configure.ac b/configure.ac
index 2f81fd22610..06031352866 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3106,6 +3106,7 @@ WINE_CONFIG_MAKEFILE(dlls/compstui)
WINE_CONFIG_MAKEFILE(dlls/comsvcs)
WINE_CONFIG_MAKEFILE(dlls/comsvcs/tests)
WINE_CONFIG_MAKEFILE(dlls/concrt140)
+WINE_CONFIG_MAKEFILE(dlls/concrt140/tests)
WINE_CONFIG_MAKEFILE(dlls/connect)
WINE_CONFIG_MAKEFILE(dlls/credui)
WINE_CONFIG_MAKEFILE(dlls/credui/tests)
diff --git a/dlls/concrt140/tests/Makefile.in b/dlls/concrt140/tests/Makefile.in
new file mode 100644
index 00000000000..e36fc37eb86
--- /dev/null
+++ b/dlls/concrt140/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = concrt140.dll
+
+C_SRCS = \
+ concrt140.c
diff --git a/dlls/concrt140/tests/concrt140.c b/dlls/concrt140/tests/concrt140.c
new file mode 100644
index 00000000000..e450024adee
--- /dev/null
+++ b/dlls/concrt140/tests/concrt140.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2020 Daniel Lehman
+ *
+ * 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"
+
+typedef void (*vtable_ptr)(void);
+
+typedef struct {
+ const vtable_ptr *vtable;
+} Context;
+
+typedef struct {
+ Context *ctx;
+} _Context;
+
+static Context* (__cdecl *p_Context_CurrentContext)(void);
+static _Context* (__cdecl *p__Context__CurrentContext)(_Context*);
+
+#define SETNOFAIL(x,y) x = (void*)GetProcAddress(module,y)
+#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
+
+static BOOL init(void)
+{
+ HMODULE module;
+
+ module = LoadLibraryA("concrt140.dll");
+ if (!module)
+ {
+ win_skip("concrt140.dll not installed\n");
+ return FALSE;
+ }
+
+ SET(p__Context__CurrentContext,
+ "?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ");
+ if(sizeof(void*) == 8) { /* 64-bit initialization */
+ SET(p_Context_CurrentContext,
+ "?CurrentContext(a)Context@Concurrency@@SAPEAV12(a)XZ");
+ } else {
+ SET(p_Context_CurrentContext,
+ "?CurrentContext(a)Context@Concurrency@@SAPAV12(a)XZ");
+ }
+
+ return TRUE;
+}
+
+static void test_CurrentContext(void)
+{
+ _Context _ctx, *_pctx;
+ Context *ctx;
+
+ ctx = p_Context_CurrentContext();
+ ok(!!ctx, "got NULL\n");
+
+ if (0) /* crash Windows */
+ p__Context__CurrentContext(NULL);
+
+ memset(&_ctx, 0xcc, sizeof(_ctx));
+ _pctx = p__Context__CurrentContext(&_ctx);
+ ok(_ctx.ctx == ctx, "expected %p, got %p\n", ctx, _ctx.ctx);
+ ok(_pctx == &_ctx, "expected %p, got %p\n", &_ctx, _pctx);
+}
+
+START_TEST(concrt140)
+{
+ if (!init()) return;
+ test_CurrentContext();
+}
--
2.25.1
Nov. 2, 2020
[PATCH 3/4] msvcr120/tests: Add _Context::_CurrentContext tests.
by Daniel Lehman
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
dlls/msvcr120/tests/msvcr120.c | 36 ++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/dlls/msvcr120/tests/msvcr120.c b/dlls/msvcr120/tests/msvcr120.c
index a055feeac91..f5aea64f2e7 100644
--- a/dlls/msvcr120/tests/msvcr120.c
+++ b/dlls/msvcr120/tests/msvcr120.c
@@ -157,6 +157,16 @@ typedef struct
double i;
} _Dcomplex;
+typedef void (*vtable_ptr)(void);
+
+typedef struct {
+ const vtable_ptr *vtable;
+} Context;
+
+typedef struct {
+ Context *ctx;
+} _Context;
+
static char* (CDECL *p_setlocale)(int category, const char* locale);
static struct MSVCRT_lconv* (CDECL *p_localeconv)(void);
static size_t (CDECL *p_wcstombs_s)(size_t *ret, char* dest, size_t sz, const wchar_t* src, size_t max);
@@ -208,6 +218,9 @@ static MSVCRT_bool (__thiscall *p__Condition_variable_wait_for)(_Condition_varia
static void (__thiscall *p__Condition_variable_notify_one)(_Condition_variable*);
static void (__thiscall *p__Condition_variable_notify_all)(_Condition_variable*);
+static Context* (__cdecl *p_Context_CurrentContext)(void);
+static _Context* (__cdecl *p__Context__CurrentContext)(_Context*);
+
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(module,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
@@ -250,6 +263,7 @@ static BOOL init(void)
SET(p_nexttowardl, "nexttowardl");
SET(p_wctrans, "wctrans");
SET(p_towctrans, "towctrans");
+ SET(p__Context__CurrentContext, "?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ");
if(sizeof(void*) == 8) { /* 64-bit initialization */
SET(p_critical_section_ctor,
"??0critical_section(a)Concurrency@@QEAA(a)XZ");
@@ -281,6 +295,8 @@ static BOOL init(void)
"?notify_one(a)_Condition_variable@details(a)Concurrency@@QEAAXXZ");
SET(p__Condition_variable_notify_all,
"?notify_all(a)_Condition_variable@details(a)Concurrency@@QEAAXXZ");
+ SET(p_Context_CurrentContext,
+ "?CurrentContext(a)Context@Concurrency@@SAPEAV12(a)XZ");
} else {
#ifdef __arm__
SET(p_critical_section_ctor,
@@ -345,6 +361,8 @@ static BOOL init(void)
SET(p__Condition_variable_notify_all,
"?notify_all(a)_Condition_variable@details(a)Concurrency@@QAEXXZ");
#endif
+ SET(p_Context_CurrentContext,
+ "?CurrentContext(a)Context@Concurrency@@SAPAV12(a)XZ");
}
init_thiscall_thunk();
@@ -1065,6 +1083,23 @@ static void test_towctrans(void)
ok(ret == 'T', "towctrans('T', 1) returned %c, expected T\n", ret);
}
+static void test_CurrentContext(void)
+{
+ _Context _ctx, *_pctx;
+ Context *ctx;
+
+ ctx = p_Context_CurrentContext();
+ ok(!!ctx, "got NULL\n");
+
+ if (0) /* crash Windows */
+ p__Context__CurrentContext(NULL);
+
+ memset(&_ctx, 0xcc, sizeof(_ctx));
+ _pctx = p__Context__CurrentContext(&_ctx);
+ ok(_ctx.ctx == ctx, "expected %p, got %p\n", ctx, _ctx.ctx);
+ ok(_pctx == &_ctx, "expected %p, got %p\n", &_ctx, _pctx);
+}
+
START_TEST(msvcr120)
{
if (!init()) return;
@@ -1086,4 +1121,5 @@ START_TEST(msvcr120)
test__Cbuild();
test_nexttoward();
test_towctrans();
+ test_CurrentContext();
}
--
2.25.1
Nov. 2, 2020
[PATCH 2/4] msvcr110: Add _Context::_CurrentContext.
by Daniel Lehman
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
dlls/concrt140/concrt140.spec | 2 +-
dlls/msvcr110/msvcr110.spec | 2 +-
dlls/msvcr110/tests/msvcr110.c | 42 +++++++++++++++++++++++++++++
dlls/msvcr120/msvcr120.spec | 2 +-
dlls/msvcr120_app/msvcr120_app.spec | 2 +-
dlls/msvcrt/scheduler.c | 14 ++++++++++
6 files changed, 60 insertions(+), 4 deletions(-)
diff --git a/dlls/concrt140/concrt140.spec b/dlls/concrt140/concrt140.spec
index 9a8ef13aaeb..ea8a3e00dc5 100644
--- a/dlls/concrt140/concrt140.spec
+++ b/dlls/concrt140/concrt140.spec
@@ -327,7 +327,7 @@
@ stub -arch=win64 ?_ConcRT_Trace(a)details@Concurrency@@YAXHPEB_WZZ
@ stub -arch=i386 ?_Confirm_cancel(a)_Cancellation_beacon@details(a)Concurrency@@QAE_NXZ
@ stub -arch=win64 ?_Confirm_cancel(a)_Cancellation_beacon@details(a)Concurrency@@QEAA_NXZ
-@ stub ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
+@ cdecl ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ() msvcr120.?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
@ stub ?_Current_node(a)location@Concurrency@@SA?AV12(a)XZ
@ stub -arch=i386 ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EAEXXZ
@ stub -arch=win64 ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EEAAXXZ
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index 425bdfdc21a..54196f63690 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -513,7 +513,7 @@
@ stub -arch=arm ?_Copy_str(a)exception@std@@AAAXPBD(a)Z
@ stub -arch=i386 ?_Copy_str(a)exception@std@@AAEXPBD(a)Z
@ stub -arch=win64 ?_Copy_str(a)exception@std@@AEAAXPEBD(a)Z
-@ stub ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
+@ cdecl ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ(ptr) _Context__CurrentContext
@ stub ?_Current_node(a)location@Concurrency@@SA?AV12(a)XZ
@ stub -arch=arm ?_DeregisterCallback(a)_CancellationTokenState@details(a)Concurrency@@QAAXPAV_CancellationTokenRegistration(a)23@@Z
@ stub -arch=i386 ?_DeregisterCallback(a)_CancellationTokenState@details(a)Concurrency@@QAEXPAV_CancellationTokenRegistration(a)23@@Z
diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c
index 364dd26aa82..8d3b85bfbcf 100644
--- a/dlls/msvcr110/tests/msvcr110.c
+++ b/dlls/msvcr110/tests/msvcr110.c
@@ -31,6 +31,16 @@
#include <locale.h>
+typedef void (*vtable_ptr)(void);
+
+typedef struct {
+ const vtable_ptr *vtable;
+} Context;
+
+typedef struct {
+ Context *ctx;
+} _Context;
+
static char* (CDECL *p_setlocale)(int category, const char* locale);
static size_t (CDECL *p___strncnt)(const char *str, size_t count);
@@ -39,6 +49,9 @@ static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(v
static unsigned int (CDECL *p_CurrentScheduler_Id)(void);
static unsigned int (CDECL *p__CurrentScheduler__Id)(void);
+static Context* (__cdecl *p_Context_CurrentContext)(void);
+static _Context* (__cdecl *p__Context__CurrentContext)(_Context*);
+
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(module,y)
#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
@@ -60,6 +73,17 @@ static BOOL init(void)
SET(p_CurrentScheduler_Id, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
SET(p__CurrentScheduler__Id, "?_Id(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
+ SET(p__Context__CurrentContext, "?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ");
+
+ if(sizeof(void*) == 8)
+ {
+ SET(p_Context_CurrentContext, "?CurrentContext(a)Context@Concurrency@@SAPEAV12(a)XZ");
+ }
+ else
+ {
+ SET(p_Context_CurrentContext, "?CurrentContext(a)Context@Concurrency@@SAPAV12(a)XZ");
+ }
+
return TRUE;
}
@@ -146,10 +170,28 @@ static void test___strncnt(void)
}
}
+static void test_CurrentContext(void)
+{
+ _Context _ctx, *_pctx;
+ Context *ctx;
+
+ ctx = p_Context_CurrentContext();
+ ok(!!ctx, "got NULL\n");
+
+ if (0) /* crash Windows */
+ p__Context__CurrentContext(NULL);
+
+ memset(&_ctx, 0xcc, sizeof(_ctx));
+ _pctx = p__Context__CurrentContext(&_ctx);
+ ok(_ctx.ctx == ctx, "expected %p, got %p\n", ctx, _ctx.ctx);
+ ok(_pctx == &_ctx, "expected %p, got %p\n", &_ctx, _pctx);
+}
+
START_TEST(msvcr110)
{
if (!init()) return;
test_CurrentScheduler(); /* MUST be first (at least among Concurrency tests) */
test_setlocale();
test___strncnt();
+ test_CurrentContext();
}
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 368f376939d..f1e6fe210a7 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -509,7 +509,7 @@
@ stub -arch=arm ?_Copy_str(a)exception@std@@AAAXPBD(a)Z
@ stub -arch=i386 ?_Copy_str(a)exception@std@@AAEXPBD(a)Z
@ stub -arch=win64 ?_Copy_str(a)exception@std@@AEAAXPEBD(a)Z
-@ stub ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
+@ cdecl ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ() _Context__CurrentContext
@ stub ?_Current_node(a)location@Concurrency@@SA?AV12(a)XZ
@ stub -arch=arm ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EAAXXZ
@ stub -arch=i386 ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EAEXXZ
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec
index 54a02bb0a90..87a55210951 100644
--- a/dlls/msvcr120_app/msvcr120_app.spec
+++ b/dlls/msvcr120_app/msvcr120_app.spec
@@ -505,7 +505,7 @@
@ stub -arch=arm ?_Copy_str(a)exception@std@@AAAXPBD(a)Z
@ stub -arch=i386 ?_Copy_str(a)exception@std@@AAEXPBD(a)Z
@ stub -arch=win64 ?_Copy_str(a)exception@std@@AEAAXPEBD(a)Z
-@ stub ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
+@ cdecl ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ() msvcr120.?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ
@ stub ?_Current_node(a)location@Concurrency@@SA?AV12(a)XZ
@ stub -arch=arm ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EAAXXZ
@ stub -arch=i386 ?_Destroy(a)_AsyncTaskCollection@details(a)Concurrency@@EAEXXZ
diff --git a/dlls/msvcrt/scheduler.c b/dlls/msvcrt/scheduler.c
index 59e177b5aec..317d0de18c7 100644
--- a/dlls/msvcrt/scheduler.c
+++ b/dlls/msvcrt/scheduler.c
@@ -68,6 +68,10 @@ typedef struct {
#define call_Context_dtor(this, flags) CALL_VTBL_FUNC(this, 20, \
Context*, (Context*, unsigned int), (this, flags))
+typedef struct {
+ Context *context;
+} _Context;
+
union allocator_cache_entry {
struct _free {
int depth;
@@ -278,6 +282,16 @@ unsigned int __cdecl Context_VirtualProcessorId(void)
return ctx ? call_Context_GetVirtualProcessorId(ctx) : -1;
}
+#if _MSVCR_VER > 100
+/* ?_CurrentContext(a)_Context@details(a)Concurrency@@SA?AV123(a)XZ */
+_Context *__cdecl _Context__CurrentContext(_Context *ctx)
+{
+ TRACE("(%p)\n", ctx);
+ ctx->context = Context_CurrentContext();
+ return ctx;
+}
+#endif
+
DEFINE_THISCALL_WRAPPER(ExternalContextBase_GetId, 4)
unsigned int __thiscall ExternalContextBase_GetId(const ExternalContextBase *this)
{
--
2.25.1
Nov. 2, 2020
[PATCH 1/4] msvcr110/tests: Use macro to get function address.
by Daniel Lehman
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
dlls/msvcr110/tests/msvcr110.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcr110/tests/msvcr110.c b/dlls/msvcr110/tests/msvcr110.c
index 09876131f07..364dd26aa82 100644
--- a/dlls/msvcr110/tests/msvcr110.c
+++ b/dlls/msvcr110/tests/msvcr110.c
@@ -39,6 +39,9 @@ static unsigned int (CDECL *p__CurrentScheduler__GetNumberOfVirtualProcessors)(v
static unsigned int (CDECL *p_CurrentScheduler_Id)(void);
static unsigned int (CDECL *p__CurrentScheduler__Id)(void);
+#define SETNOFAIL(x,y) x = (void*)GetProcAddress(module,y)
+#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0)
+
static BOOL init(void)
{
HMODULE module;
@@ -50,12 +53,12 @@ static BOOL init(void)
return FALSE;
}
- p_setlocale = (void*)GetProcAddress(module, "setlocale");
- p___strncnt = (void*)GetProcAddress(module, "__strncnt");
- p_CurrentScheduler_GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?GetNumberOfVirtualProcessors(a)CurrentScheduler@Concurrency@@SAIXZ");
- p__CurrentScheduler__GetNumberOfVirtualProcessors = (void*)GetProcAddress(module, "?_GetNumberOfVirtualProcessors(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
- p_CurrentScheduler_Id = (void*)GetProcAddress(module, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
- p__CurrentScheduler__Id = (void*)GetProcAddress(module, "?_Id(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
+ SET(p_setlocale, "setlocale");
+ SET(p___strncnt, "__strncnt");
+ SET(p_CurrentScheduler_GetNumberOfVirtualProcessors, "?GetNumberOfVirtualProcessors(a)CurrentScheduler@Concurrency@@SAIXZ");
+ SET(p__CurrentScheduler__GetNumberOfVirtualProcessors, "?_GetNumberOfVirtualProcessors(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
+ SET(p_CurrentScheduler_Id, "?Id(a)CurrentScheduler@Concurrency@@SAIXZ");
+ SET(p__CurrentScheduler__Id, "?_Id(a)_CurrentScheduler@details(a)Concurrency@@SAIXZ");
return TRUE;
}
--
2.25.1
Nov. 2, 2020
[PATCH 2/2] appwiz.cpl: Use zero terminated wide-char strings.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/appwiz.cpl/addons.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c
index dd53d9e282e..67d61ea0d22 100644
--- a/dlls/appwiz.cpl/addons.c
+++ b/dlls/appwiz.cpl/addons.c
@@ -598,21 +598,18 @@ static IInternetBindInfo InstallCallbackBindInfo = { &InstallCallbackBindInfoVtb
static void append_url_params( WCHAR *url )
{
- static const WCHAR arch_formatW[] = {'?','a','r','c','h','='};
- static const WCHAR v_formatW[] = {'&','v','='};
- static const WCHAR winevW[] = {'&','w','i','n','e','v','='};
DWORD size = INTERNET_MAX_URL_LENGTH * sizeof(WCHAR);
DWORD len = lstrlenW(url);
- memcpy(url+len, arch_formatW, sizeof(arch_formatW));
- len += ARRAY_SIZE(arch_formatW);
+ lstrcpyW(url+len, L"?arch=");
+ len += lstrlenW(L"?arch=");
len += MultiByteToWideChar(CP_ACP, 0, GECKO_ARCH, sizeof(GECKO_ARCH),
url+len, size/sizeof(WCHAR)-len)-1;
- memcpy(url+len, v_formatW, sizeof(v_formatW));
- len += ARRAY_SIZE(v_formatW);
+ lstrcpyW(url+len, L"&v=");
+ len += lstrlenW(L"&v=");
len += MultiByteToWideChar(CP_ACP, 0, addon->version, -1, url+len, size/sizeof(WCHAR)-len)-1;
- memcpy(url+len, winevW, sizeof(winevW));
- len += ARRAY_SIZE(winevW);
+ lstrcpyW(url+len, L"&winev=");
+ len += lstrlenW(L"&winev=");
MultiByteToWideChar(CP_ACP, 0, wine_get_version(), -1, url+len, size/sizeof(WCHAR)-len);
}
--
2.26.2
Nov. 1, 2020
[PATCH 1/2] appwiz.cpl: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/appwiz.cpl/addons.c | 52 +++++++---------------
dlls/appwiz.cpl/appwiz.c | 96 +++++++++++++---------------------------
2 files changed, 48 insertions(+), 100 deletions(-)
diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c
index 346411867c6..dd53d9e282e 100644
--- a/dlls/appwiz.cpl/addons.c
+++ b/dlls/appwiz.cpl/addons.c
@@ -109,14 +109,9 @@ static LPWSTR url = NULL;
static IBinding *dwl_binding;
static WCHAR *msi_file;
-static const WCHAR winehomedirW[] = {'W','I','N','E','H','O','M','E','D','I','R',0};
-static const WCHAR winedatadirW[] = {'W','I','N','E','D','A','T','A','D','I','R',0};
-static const WCHAR winebuilddirW[] = {'W','I','N','E','B','U','I','L','D','D','I','R',0};
-
extern const char * CDECL wine_get_version(void);
static WCHAR * (CDECL *p_wine_get_dos_file_name)(const char*);
-static const WCHAR kernel32_dllW[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
static BOOL sha_check(const WCHAR *file_name)
{
@@ -187,14 +182,11 @@ enum install_res {
static enum install_res install_file(const WCHAR *file_name)
{
- static const WCHAR update_cmd[] = {
- 'R','E','I','N','S','T','A','L','L','=','A','L','L',' ',
- 'R','E','I','N','S','T','A','L','L','M','O','D','E','=','v','o','m','u','s',0};
ULONG res;
res = MsiInstallProductW(file_name, NULL);
if(res == ERROR_PRODUCT_VERSION)
- res = MsiInstallProductW(file_name, update_cmd);
+ res = MsiInstallProductW(file_name, L"REINSTALL=ALL REINSTALLMODE=vomus");
if(res != ERROR_SUCCESS) {
ERR("MsiInstallProduct failed: %u\n", res);
return INSTALL_FAILED;
@@ -252,10 +244,8 @@ static HKEY open_config_key(void)
HKEY hkey, ret;
DWORD res;
- static const WCHAR wine_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0};
-
/* @@ Wine registry key: HKCU\Software\Wine\$config_key */
- res = RegOpenKeyW(HKEY_CURRENT_USER, wine_keyW, &hkey);
+ res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Wine", &hkey);
if(res != ERROR_SUCCESS)
return NULL;
@@ -298,19 +288,18 @@ static enum install_res install_from_registered_dir(void)
static enum install_res install_from_default_dir(void)
{
- static const WCHAR dotdotW[] = {'\\','.','.','\\',0};
const WCHAR *package_dir;
WCHAR *dir_buf = NULL;
enum install_res ret = INSTALL_NEXT;
- if ((package_dir = _wgetenv( winebuilddirW )))
+ if ((package_dir = _wgetenv( L"WINEBUILDDIR" )))
{
- dir_buf = heap_alloc( lstrlenW(package_dir) * sizeof(WCHAR) + sizeof(dotdotW));
+ dir_buf = heap_alloc( lstrlenW(package_dir) * sizeof(WCHAR) + sizeof(L"\\..\\") );
lstrcpyW( dir_buf, package_dir );
- lstrcatW( dir_buf, dotdotW );
+ lstrcatW( dir_buf, L"\\..\\" );
package_dir = dir_buf;
}
- else package_dir = _wgetenv( winedatadirW );
+ else package_dir = _wgetenv( L"WINEDATADIR" );
if (package_dir)
{
@@ -329,8 +318,6 @@ static enum install_res install_from_default_dir(void)
static WCHAR *get_cache_file_name(BOOL ensure_exists)
{
- static const WCHAR cacheW[] = {'\\','.','c','a','c','h','e',0};
- static const WCHAR wineW[] = {'\\','w','i','n','e',0};
const char *xdg_dir;
const WCHAR *home_dir;
WCHAR *cache_dir, *ret;
@@ -341,11 +328,11 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists)
{
if (!(cache_dir = p_wine_get_dos_file_name( xdg_dir ))) return NULL;
}
- else if ((home_dir = _wgetenv( winehomedirW )))
+ else if ((home_dir = _wgetenv( L"WINEHOMEDIR" )))
{
- if (!(cache_dir = heap_alloc( lstrlenW(home_dir) * sizeof(WCHAR) + sizeof(cacheW) ))) return NULL;
+ if (!(cache_dir = heap_alloc( lstrlenW(home_dir) * sizeof(WCHAR) + sizeof(L"\\.cache") ))) return NULL;
lstrcpyW( cache_dir, home_dir );
- lstrcatW( cache_dir, cacheW );
+ lstrcatW( cache_dir, L"\\.cache" );
cache_dir[1] = '\\'; /* change \??\ into \\?\ */
}
else return NULL;
@@ -357,14 +344,14 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists)
return NULL;
}
- size = lstrlenW( cache_dir ) + ARRAY_SIZE(wineW) + lstrlenW( addon->file_name ) + 1;
+ size = lstrlenW( cache_dir ) + ARRAY_SIZE(L"\\wine") + lstrlenW( addon->file_name ) + 1;
if (!(ret = heap_alloc( size * sizeof(WCHAR) )))
{
heap_free( cache_dir );
return NULL;
}
lstrcpyW( ret, cache_dir );
- lstrcatW( ret, wineW );
+ lstrcatW( ret, L"\\wine" );
heap_free( cache_dir );
if (ensure_exists && !CreateDirectoryW( ret, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
@@ -583,18 +570,15 @@ static HRESULT WINAPI InstallCallbackBindInfo_GetBindInfo(IInternetBindInfo *ifa
static HRESULT WINAPI InstallCallbackBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type,
WCHAR **strs, ULONG cnt, ULONG *fetched)
{
- static const WCHAR wine_addon_downloaderW[] =
- {'W','i','n','e',' ','A','d','d','o','n',' ','D','o','w','n','l','o','a','d','e','r',0};
-
switch(string_type) {
case BINDSTRING_USER_AGENT:
TRACE("BINDSTRING_USER_AGENT\n");
- *strs = CoTaskMemAlloc(sizeof(wine_addon_downloaderW));
+ *strs = CoTaskMemAlloc(sizeof(L"Wine Addon Downloader"));
if(!*strs)
return E_OUTOFMEMORY;
- memcpy(*strs, wine_addon_downloaderW, sizeof(wine_addon_downloaderW));
+ lstrcpyW(*strs, L"Wine Addon Downloader");
*fetched = 1;
return S_OK;
}
@@ -698,13 +682,11 @@ static void run_winebrowser(const WCHAR *url)
WCHAR *args;
BOOL ret;
- static const WCHAR winebrowserW[] = {'\\','w','i','n','e','b','r','o','w','s','e','r','.','e','x','e',0};
-
url_len = lstrlenW(url);
- len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(winebrowserW));
- memcpy(app+len, winebrowserW, sizeof(winebrowserW));
- len += ARRAY_SIZE(winebrowserW) - 1;
+ len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(L"\\winebrowser.exe"));
+ lstrcpyW(app+len, L"\\winebrowser.exe");
+ len += ARRAY_SIZE(L"\\winebrowser.exe") - 1;
args = heap_alloc((len+1+url_len)*sizeof(WCHAR));
if(!args)
@@ -771,7 +753,7 @@ BOOL install_addon(addon_t addon_type)
addon = addons_info+addon_type;
- p_wine_get_dos_file_name = (void*)GetProcAddress(GetModuleHandleW(kernel32_dllW), "wine_get_dos_file_name");
+ p_wine_get_dos_file_name = (void *)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "wine_get_dos_file_name");
/*
* Try to find addon .msi file in following order:
diff --git a/dlls/appwiz.cpl/appwiz.c b/dlls/appwiz.cpl/appwiz.c
index b295e40b2f4..2bc108b63c6 100644
--- a/dlls/appwiz.cpl/appwiz.c
+++ b/dlls/appwiz.cpl/appwiz.c
@@ -80,32 +80,7 @@ HINSTANCE hInst;
static WCHAR btnRemove[MAX_STRING_LEN];
static WCHAR btnModifyRemove[MAX_STRING_LEN];
-static const WCHAR openW[] = {'o','p','e','n',0};
-
-/* names of registry keys */
-static const WCHAR BackSlashW[] = { '\\', 0 };
-static const WCHAR DisplayNameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
-static const WCHAR DisplayIconW[] = {'D','i','s','p','l','a','y','I','c','o','n',0};
-static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
-static const WCHAR PublisherW[] = {'P','u','b','l','i','s','h','e','r',0};
-static const WCHAR ContactW[] = {'C','o','n','t','a','c','t',0};
-static const WCHAR HelpLinkW[] = {'H','e','l','p','L','i','n','k',0};
-static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h','o','n','e',0};
-static const WCHAR ModifyPathW[] = {'M','o','d','i','f','y','P','a','t','h',0};
-static const WCHAR NoModifyW[] = {'N','o','M','o','d','i','f','y',0};
-static const WCHAR ReadmeW[] = {'R','e','a','d','m','e',0};
-static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I','n','f','o',0};
-static const WCHAR CommentsW[] = {'C','o','m','m','e','n','t','s',0};
-static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0};
-static const WCHAR WindowsInstallerW[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
-static const WCHAR SystemComponentW[] = {'S','y','s','t','e','m','C','o','m','p','o','n','e','n','t',0};
-
-static const WCHAR PathUninstallW[] = {
- 'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'U','n','i','n','s','t','a','l','l',0 };
+static const WCHAR PathUninstallW[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
/******************************************************************************
* Name : DllMain
@@ -184,7 +159,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
{
RegOpenKeyExW(root, subKeyName, 0, KEY_READ, &hkeyApp);
size = sizeof(value);
- if (!RegQueryValueExW(hkeyApp, SystemComponentW, NULL, &dwType, (LPBYTE)&value, &size)
+ if (!RegQueryValueExW(hkeyApp, L"SystemComponent", NULL, &dwType, (BYTE *)&value, &size)
&& dwType == REG_DWORD && value == 1)
{
RegCloseKey(hkeyApp);
@@ -193,22 +168,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
}
displen = 0;
uninstlen = 0;
- if (!RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen))
+ if (!RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, NULL, &displen))
{
size = sizeof(value);
- if (!RegQueryValueExW(hkeyApp, WindowsInstallerW, NULL, &dwType, (LPBYTE)&value, &size)
+ if (!RegQueryValueExW(hkeyApp, L"WindowsInstaller", NULL, &dwType, (BYTE *)&value, &size)
&& dwType == REG_DWORD && value == 1)
{
- static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','x','%','s',0};
- int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
+ int len = lstrlenW(L"msiexec /x%s") + lstrlenW(subKeyName);
if (!(command = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
- wsprintfW(command, fmtW, subKeyName);
+ wsprintfW(command, L"msiexec /x%s", subKeyName);
}
- else if (!RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, NULL, &uninstlen))
+ else if (!RegQueryValueExW(hkeyApp, L"UninstallString", 0, 0, NULL, &uninstlen))
{
if (!(command = HeapAlloc(GetProcessHeap(), 0, uninstlen))) goto err;
- RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)command, &uninstlen);
+ RegQueryValueExW(hkeyApp, L"UninstallString", 0, 0, (BYTE *)command, &uninstlen);
}
else
{
@@ -225,12 +199,11 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
if (!info->title)
goto err;
- RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)info->title,
- &displen);
+ RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, (BYTE *)info->title, &displen);
/* now get DisplayIcon */
displen = 0;
- RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, NULL, &displen);
+ RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, NULL, &displen);
if (displen == 0)
info->icon = 0;
@@ -241,8 +214,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
if (!info->icon)
goto err;
- RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, (LPBYTE)info->icon,
- &displen);
+ RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, (BYTE *)info->icon, &displen);
/* separate the index from the icon name, if supplied */
iconPtr = wcschr(info->icon, ',');
@@ -254,21 +226,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
}
}
- info->publisher = get_reg_str(hkeyApp, PublisherW);
- info->version = get_reg_str(hkeyApp, DisplayVersionW);
- info->contact = get_reg_str(hkeyApp, ContactW);
- info->helplink = get_reg_str(hkeyApp, HelpLinkW);
- info->helptelephone = get_reg_str(hkeyApp, HelpTelephoneW);
- info->readme = get_reg_str(hkeyApp, ReadmeW);
- info->urlupdateinfo = get_reg_str(hkeyApp, URLUpdateInfoW);
- info->comments = get_reg_str(hkeyApp, CommentsW);
+ info->publisher = get_reg_str(hkeyApp, L"Publisher");
+ info->version = get_reg_str(hkeyApp, L"DisplayVersion");
+ info->contact = get_reg_str(hkeyApp, L"Contact");
+ info->helplink = get_reg_str(hkeyApp, L"HelpLink");
+ info->helptelephone = get_reg_str(hkeyApp, L"HelpTelephone");
+ info->readme = get_reg_str(hkeyApp, L"Readme");
+ info->urlupdateinfo = get_reg_str(hkeyApp, L"URLUpdateInfo");
+ info->comments = get_reg_str(hkeyApp, L"Comments");
/* Check if NoModify is set */
dwType = REG_DWORD;
dwNoModify = 0;
displen = sizeof(DWORD);
- if (RegQueryValueExW(hkeyApp, NoModifyW, NULL, &dwType, (LPBYTE)&dwNoModify, &displen)
+ if (RegQueryValueExW(hkeyApp, L"NoModify", NULL, &dwType, (BYTE *)&dwNoModify, &displen)
!= ERROR_SUCCESS)
{
dwNoModify = 0;
@@ -282,19 +254,18 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
if (!dwNoModify)
{
size = sizeof(value);
- if (!RegQueryValueExW(hkeyApp, WindowsInstallerW, NULL, &dwType, (LPBYTE)&value, &size)
+ if (!RegQueryValueExW(hkeyApp, L"WindowsInstaller", NULL, &dwType, (BYTE *)&value, &size)
&& dwType == REG_DWORD && value == 1)
{
- static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','i','%','s',0};
- int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
+ int len = lstrlenW(L"msiexec /i%s") + lstrlenW(subKeyName);
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
- wsprintfW(info->path_modify, fmtW, subKeyName);
+ wsprintfW(info->path_modify, L"msiexec /i%s", subKeyName);
}
- else if (!RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, NULL, &displen))
+ else if (!RegQueryValueExW(hkeyApp, L"ModifyPath", 0, 0, NULL, &displen))
{
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, displen))) goto err;
- RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, (LPBYTE)info->path_modify, &displen);
+ RegQueryValueExW(hkeyApp, L"ModifyPath", 0, 0, (BYTE *)info->path_modify, &displen);
}
}
@@ -440,8 +411,6 @@ static void UpdateButtons(HWND hWnd)
*/
static void InstallProgram(HWND hWnd)
{
- static const WCHAR filters[] = {'%','s','%','c','*','i','n','s','t','a','l','*','.','e','x','e',';','*','s','e','t','u','p','*','.','e','x','e',';','*','.','m','s','i','%','c','%','s','%','c','*','.','e','x','e','%','c','%','s','%','c','*','.','*','%','c',0}
-;
OPENFILENAMEW ofn;
WCHAR titleW[MAX_STRING_LEN];
WCHAR filter_installs[MAX_STRING_LEN];
@@ -455,8 +424,8 @@ static void InstallProgram(HWND hWnd)
LoadStringW(hInst, IDS_FILTER_PROGRAMS, filter_programs, ARRAY_SIZE(filter_programs));
LoadStringW(hInst, IDS_FILTER_ALL, filter_all, ARRAY_SIZE(filter_all));
- swprintf( FilterBufferW, MAX_PATH, filters, filter_installs, 0, 0,
- filter_programs, 0, 0, filter_all, 0, 0 );
+ swprintf( FilterBufferW, MAX_PATH, L"%s%c*instal*.exe;*setup*.exe;*.msi%c%s%c*.exe%c%s%c*.*%c",
+ filter_installs, 0, 0, filter_programs, 0, 0, filter_all, 0, 0 );
memset(&ofn, 0, sizeof(OPENFILENAMEW));
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = hWnd;
@@ -476,7 +445,7 @@ static void InstallProgram(HWND hWnd)
SHELLEXECUTEINFOW sei;
memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei);
- sei.lpVerb = openW;
+ sei.lpVerb = L"open";
sei.nShow = SW_SHOWDEFAULT;
sei.fMask = 0;
sei.lpFile = ofn.lpstrFile;
@@ -609,7 +578,7 @@ static INT_PTR CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L
if (iter->id == (int) lParam)
{
lstrcpyW(key, PathUninstallW);
- lstrcatW(key, BackSlashW);
+ lstrcatW(key, L"\\");
lstrcatW(key, iter->regkey);
/* check the application's registry entries */
@@ -959,18 +928,15 @@ static void StartApplet(HWND hWnd)
static LONG start_params(const WCHAR *params)
{
- static const WCHAR install_geckoW[] = {'i','n','s','t','a','l','l','_','g','e','c','k','o',0};
- static const WCHAR install_monoW[] = {'i','n','s','t','a','l','l','_','m','o','n','o',0};
-
if(!params)
return FALSE;
- if(!wcscmp(params, install_geckoW)) {
+ if(!wcscmp(params, L"install_gecko")) {
install_addon(ADDON_GECKO);
return TRUE;
}
- if(!wcscmp(params, install_monoW)) {
+ if(!wcscmp(params, L"install_mono")) {
install_addon(ADDON_MONO);
return TRUE;
}
--
2.26.2
Nov. 1, 2020
[PATCH] oleaut32: IFont never had an IPersistStreamInit interface.
by Damjan Jovanovic
As Nikolay Sivov incidentally noted in
https://bugs.winehq.org/show_bug.cgi?id=23726#c29
the IPersistStreamInit interface on IFont "is not supported
on anything newer and including XP." It is a E_NOINTERFACE
on 95, 98, Me and NT4 as well. It never existed on any
version of Windows, and we never should have had it either.
It was added in error by commit
d0372b4e6ea420eadcdfcb93f3d0706284adbb69.
Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com>
---
dlls/oleaut32/olefont.c | 91 -----------------------------------
dlls/oleaut32/tests/olefont.c | 5 ++
2 files changed, 5 insertions(+), 91 deletions(-)
Nov. 1, 2020