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 2018
- 70 participants
- 1549 messages
Re: [PATCH 3/4] d2d1: Implement SetTarget() for bitmap targets.
by Henri Verbeet
On 26 September 2018 at 04:04, Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
> @@ -136,7 +136,6 @@ struct d2d_device_context
> ID2D1Factory *factory;
> ID2D1Device *device;
> ID3D10Device *d3d_device;
> - ID3D10RenderTargetView *view;
> ID3D10StateBlock *stateblock;
> struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT];
> ID3D10PixelShader *ps;
> @@ -146,6 +145,19 @@ struct d2d_device_context
> ID3D10RasterizerState *rs;
> ID3D10BlendState *bs;
>
> + struct
> + {
> + union
> + {
> + ID2D1Image *image;
> + struct
> + {
> + ID2D1Bitmap *bitmap;
> + ID3D10RenderTargetView *view;
> + } bitmap;
> + } u;
> + } target;
I don't think you need a separate view field if you have a bitmap. I
think the rendertarget view should be stored in the d2d_bitmap
structure. I.e., the same way the shader resource view is part of that
structure.
I also don't think you need that union in this patch. Depending on
where we go with this in the future we may want it at some later
point, but I think that's a separate change from implementing
SetTarget() for bitmap targets.
I.e., for this patch, I think just replacing "ID3D10RenderTargetView
*view;" with "struct d2d_bitmap *target;" should be enough.
Sept. 26, 2018
Re: [PATCH vkd3d v2 6/9] vkd3d: Use heap memory for placed resources.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
Sept. 26, 2018
[PATCH v3] riched20: Avoid using GCC's typeof extension
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/riched20/txthost.c | 90 ++++++++++++++++++++---------------------
dlls/riched20/txtsrv.c | 6 +--
2 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c
index b479bde81b..eaa6aaef06 100644
--- a/dlls/riched20/txthost.c
+++ b/dlls/riched20/txthost.c
@@ -501,10 +501,10 @@ DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *i
#ifdef __i386__ /* thiscall functions are i386-specific */
-#define THISCALL(func) __thiscall_ ## func
+#define THISCALL(func) (void *) __thiscall_ ## func
#define DEFINE_THISCALL_WRAPPER(func,args) \
- extern typeof(func) THISCALL(func); \
- __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \
+ extern HRESULT __thiscall_ ## func(void); \
+ __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
@@ -559,10 +559,10 @@ DEFINE_THISCALL_WRAPPER(ITextHostImpl_TxGetSelectionBarWidth,8)
#ifdef __i386__ /* thiscall functions are i386-specific */
-#define STDCALL(func) __stdcall_ ## func
+#define STDCALL(func) (void *) __stdcall_ ## func
#define DEFINE_STDCALL_WRAPPER(num,func,args) \
- extern typeof(func) __stdcall_ ## func; \
- __ASM_STDCALL_FUNC(__stdcall_ ## func, args, \
+ extern HRESULT __stdcall_ ## func(void); \
+ __ASM_GLOBAL_FUNC(__stdcall_ ## func, \
"popl %eax\n\t" \
"popl %ecx\n\t" \
"pushl %eax\n\t" \
@@ -613,45 +613,45 @@ const ITextHostVtbl itextHostStdcallVtbl = {
NULL,
NULL,
NULL,
- __stdcall_ITextHostImpl_TxGetDC,
- __stdcall_ITextHostImpl_TxReleaseDC,
- __stdcall_ITextHostImpl_TxShowScrollBar,
- __stdcall_ITextHostImpl_TxEnableScrollBar,
- __stdcall_ITextHostImpl_TxSetScrollRange,
- __stdcall_ITextHostImpl_TxSetScrollPos,
- __stdcall_ITextHostImpl_TxInvalidateRect,
- __stdcall_ITextHostImpl_TxViewChange,
- __stdcall_ITextHostImpl_TxCreateCaret,
- __stdcall_ITextHostImpl_TxShowCaret,
- __stdcall_ITextHostImpl_TxSetCaretPos,
- __stdcall_ITextHostImpl_TxSetTimer,
- __stdcall_ITextHostImpl_TxKillTimer,
- __stdcall_ITextHostImpl_TxScrollWindowEx,
- __stdcall_ITextHostImpl_TxSetCapture,
- __stdcall_ITextHostImpl_TxSetFocus,
- __stdcall_ITextHostImpl_TxSetCursor,
- __stdcall_ITextHostImpl_TxScreenToClient,
- __stdcall_ITextHostImpl_TxClientToScreen,
- __stdcall_ITextHostImpl_TxActivate,
- __stdcall_ITextHostImpl_TxDeactivate,
- __stdcall_ITextHostImpl_TxGetClientRect,
- __stdcall_ITextHostImpl_TxGetViewInset,
- __stdcall_ITextHostImpl_TxGetCharFormat,
- __stdcall_ITextHostImpl_TxGetParaFormat,
- __stdcall_ITextHostImpl_TxGetSysColor,
- __stdcall_ITextHostImpl_TxGetBackStyle,
- __stdcall_ITextHostImpl_TxGetMaxLength,
- __stdcall_ITextHostImpl_TxGetScrollBars,
- __stdcall_ITextHostImpl_TxGetPasswordChar,
- __stdcall_ITextHostImpl_TxGetAcceleratorPos,
- __stdcall_ITextHostImpl_TxGetExtent,
- __stdcall_ITextHostImpl_OnTxCharFormatChange,
- __stdcall_ITextHostImpl_OnTxParaFormatChange,
- __stdcall_ITextHostImpl_TxGetPropertyBits,
- __stdcall_ITextHostImpl_TxNotify,
- __stdcall_ITextHostImpl_TxImmGetContext,
- __stdcall_ITextHostImpl_TxImmReleaseContext,
- __stdcall_ITextHostImpl_TxGetSelectionBarWidth,
+ STDCALL(ITextHostImpl_TxGetDC),
+ STDCALL(ITextHostImpl_TxReleaseDC),
+ STDCALL(ITextHostImpl_TxShowScrollBar),
+ STDCALL(ITextHostImpl_TxEnableScrollBar),
+ STDCALL(ITextHostImpl_TxSetScrollRange),
+ STDCALL(ITextHostImpl_TxSetScrollPos),
+ STDCALL(ITextHostImpl_TxInvalidateRect),
+ STDCALL(ITextHostImpl_TxViewChange),
+ STDCALL(ITextHostImpl_TxCreateCaret),
+ STDCALL(ITextHostImpl_TxShowCaret),
+ STDCALL(ITextHostImpl_TxSetCaretPos),
+ STDCALL(ITextHostImpl_TxSetTimer),
+ STDCALL(ITextHostImpl_TxKillTimer),
+ STDCALL(ITextHostImpl_TxScrollWindowEx),
+ STDCALL(ITextHostImpl_TxSetCapture),
+ STDCALL(ITextHostImpl_TxSetFocus),
+ STDCALL(ITextHostImpl_TxSetCursor),
+ STDCALL(ITextHostImpl_TxScreenToClient),
+ STDCALL(ITextHostImpl_TxClientToScreen),
+ STDCALL(ITextHostImpl_TxActivate),
+ STDCALL(ITextHostImpl_TxDeactivate),
+ STDCALL(ITextHostImpl_TxGetClientRect),
+ STDCALL(ITextHostImpl_TxGetViewInset),
+ STDCALL(ITextHostImpl_TxGetCharFormat),
+ STDCALL(ITextHostImpl_TxGetParaFormat),
+ STDCALL(ITextHostImpl_TxGetSysColor),
+ STDCALL(ITextHostImpl_TxGetBackStyle),
+ STDCALL(ITextHostImpl_TxGetMaxLength),
+ STDCALL(ITextHostImpl_TxGetScrollBars),
+ STDCALL(ITextHostImpl_TxGetPasswordChar),
+ STDCALL(ITextHostImpl_TxGetAcceleratorPos),
+ STDCALL(ITextHostImpl_TxGetExtent),
+ STDCALL(ITextHostImpl_OnTxCharFormatChange),
+ STDCALL(ITextHostImpl_OnTxParaFormatChange),
+ STDCALL(ITextHostImpl_TxGetPropertyBits),
+ STDCALL(ITextHostImpl_TxNotify),
+ STDCALL(ITextHostImpl_TxImmGetContext),
+ STDCALL(ITextHostImpl_TxImmReleaseContext),
+ STDCALL(ITextHostImpl_TxGetSelectionBarWidth),
};
#endif /* __i386__ */
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index ee65621b1d..771c362de3 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -35,10 +35,10 @@
#ifdef __i386__ /* thiscall functions are i386-specific */
-#define THISCALL(func) __thiscall_ ## func
+#define THISCALL(func) (void *) __thiscall_ ## func
#define DEFINE_THISCALL_WRAPPER(func,args) \
- extern typeof(func) THISCALL(func); \
- __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \
+ extern HRESULT __thiscall_ ## func(void); \
+ __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
--
2.19.0
Sept. 26, 2018
Re: [PATCH v2] riched20: Avoid using GCC's typeof extension
by Alex Henrie
On Wed, Sep 26, 2018 at 4:21 AM Huw Davies <huw(a)codeweavers.com> wrote:
>
> On Mon, Sep 24, 2018 at 10:42:03PM -0600, Alex Henrie wrote:
> > Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> > ---
> > dlls/riched20/txthost.c | 94 ++++++++++++++++++++++-------------------
> > dlls/riched20/txtsrv.c | 15 ++++++-
> > 2 files changed, 64 insertions(+), 45 deletions(-)
> >
> > diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c
> > index b479bde81b..ec180200e1 100644
> > --- a/dlls/riched20/txthost.c
> > +++ b/dlls/riched20/txthost.c
> > @@ -501,9 +501,17 @@ DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetSelectionBarWidth(ITextHost *i
> >
> > #ifdef __i386__ /* thiscall functions are i386-specific */
> >
> > -#define THISCALL(func) __thiscall_ ## func
> > +#define DEFINE_ARGS_PLACEHOLDER(args) struct __args_placeholder ## args { char a[args]; };
> > +DEFINE_ARGS_PLACEHOLDER(4);
> > +DEFINE_ARGS_PLACEHOLDER(8);
> > +DEFINE_ARGS_PLACEHOLDER(12);
> > +DEFINE_ARGS_PLACEHOLDER(16);
> > +DEFINE_ARGS_PLACEHOLDER(20);
> > +DEFINE_ARGS_PLACEHOLDER(32);
> > +
> > +#define THISCALL(func) (void *) __thiscall_ ## func
> > #define DEFINE_THISCALL_WRAPPER(func,args) \
> > - extern typeof(func) THISCALL(func); \
> > + extern HRESULT WINAPI __thiscall_ ## func(struct __args_placeholder ## args); \
> > __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \
> > "popl %eax\n\t" \
> > "pushl %ecx\n\t" \
>
> Could this be made to work in the same way as msvcrt handles thiscall?
Yes, it looks like we can use __ASM_GLOBAL_FUNC instead of
__ASM_STDCALL_FUNC and then the size of the parameters in the function
prototype doesn't have to match the function's assembly definition.
That would indeed be a cleaner solution. Good idea!
-Alex
Sept. 26, 2018
[PATCH] shell32: Improve semi-stub SHGetStockIconInfo to return an iconhandle if SHGSI_ICON flag is set
by Louis Lenders
Fix for bug https://bugs.winehq.org/show_bug.cgi?id=45868
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com>
---
dlls/shell32/iconcache.c | 22 +++++++++++++++++-----
dlls/shell32/tests/shelllink.c | 8 ++++++++
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
index 6107e0c33b..73617761a5 100644
--- a/dlls/shell32/iconcache.c
+++ b/dlls/shell32/iconcache.c
@@ -1004,7 +1004,9 @@ INT WINAPI SHGetIconOverlayIndexW(LPCWSTR pszIconPath, INT iIconIndex)
*/
HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO *sii)
{
- static const WCHAR shell32dll[] = {'\\','s','h','e','l','l','3','2','.','d','l','l',0};
+ static const WCHAR shell32dllW[] = {'s','h','e','l','l','3','2','.','d','l','l',0};
+ static const WCHAR slashW[] = {'\\',0};
+ HMODULE hmod;
FIXME("(%d, 0x%x, %p) semi-stub\n", id, flags, sii);
if ((id < 0) || (id >= SIID_MAX_ICONS) || !sii || (sii->cbSize != sizeof(SHSTOCKICONINFO))) {
@@ -1015,14 +1017,24 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO
/* no icons defined: use default */
sii->iIcon = -IDI_SHELL_FILE;
- lstrcatW(sii->szPath, shell32dll);
-
- if (flags)
- FIXME("flags 0x%x not implemented\n", flags);
+ lstrcatW(sii->szPath, slashW);
+ lstrcatW(sii->szPath, shell32dllW);
sii->hIcon = NULL;
sii->iSysImageIndex = -1;
+ if (flags & SHGSI_ICON)
+ {
+ hmod = GetModuleHandleW(shell32dllW);
+ if (hmod)
+ sii->hIcon = LoadIconW(hmod, MAKEINTRESOURCEW(IDI_SHELL_FILE));
+
+ if (!sii->hIcon)
+ ERR("failed to get an icon handle");
+ }
+ else
+ FIXME("flags 0x%x not implemented\n", flags);
+
TRACE("%3d: returning %s (%d)\n", id, debugstr_w(sii->szPath), sii->iIcon);
return S_OK;
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 65e9a6dd55..e0068978ec 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -1112,6 +1112,14 @@ static void test_SHGetStockIconInfo(void)
/* there is a NULL check for the struct */
hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, NULL);
ok(hr == E_INVALIDARG, "NULL: got 0x%x\n", hr);
+
+ memset(buffer, '#', sizeof(buffer));
+ sii->cbSize = sizeof(SHSTOCKICONINFO);
+ hr = pSHGetStockIconInfo(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, sii);
+ ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr);
+ ok(sii->hIcon != NULL, "got NULL, expected an icon handle\n");
+ ok(sii->iSysImageIndex == -1, "got %d (expected -1)\n", sii->iSysImageIndex);
+ ok(DestroyIcon(sii->hIcon), "DestroyIcon failed\n");
}
static void test_SHExtractIcons(void)
--
2.17.1
Sept. 26, 2018
Re: [PATCH v2 2/2] msi: Allow recursive changes to the target folder path.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=42549
Your paranoid android.
=== w7u (32 bit Windows report) ===
msi:
msi: Timeout
Sept. 26, 2018
Re: [PATCH v2 1/2] msi/tests: Drop workarounds for Windows 2000.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=42548
Your paranoid android.
=== w7u (32 bit Windows report) ===
msi:
action: Timeout
=== w7u (32 bit Windows report) ===
msi:
install: Timeout
=== w7u (32 bit Windows report) ===
msi:
msi: Timeout
Sept. 26, 2018
[PATCH v2 2/2] msi: Allow recursive changes to the target folder path.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/action.c | 10 +++-------
dlls/msi/tests/msi.c | 24 ++++++++----------------
2 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index af867618c6..0d6da3e2cc 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -2394,15 +2394,11 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
else
path = msi_build_directory_name( 2, folder->TargetDefault, NULL );
}
+
normalized_path = msi_normalize_path( path );
- msi_free( path );
- if (folder->ResolvedTarget && !strcmpiW( normalized_path, folder->ResolvedTarget ))
- {
- TRACE("%s already resolved to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget));
- msi_free( normalized_path );
- return;
- }
msi_set_property( package->db, folder->Directory, normalized_path, -1 );
+ msi_free( path );
+
msi_free( folder->ResolvedTarget );
folder->ResolvedTarget = normalized_path;
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 842ed112f5..015cd6538e 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -336,16 +336,18 @@ static const char spf_custom_action_dat[] =
"Action\tType\tSource\tTarget\tISComments\n"
"s72\ti2\tS64\tS0\tS255\n"
"CustomAction\tAction\n"
- "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n";
+ "SetFolderProp\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\t\n"
+ "SetFolderProp2\t51\tMSITESTDIR\t[ProgramFilesFolder]\\msitest\\added\\added2\t\n";
static const char spf_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
"InstallExecuteSequence\tAction\n"
- "CostFinalize\t\t1000\n"
"CostInitialize\t\t800\n"
"FileCost\t\t900\n"
"SetFolderProp\t\t950\n"
+ "SetFolderProp2\t\t960\n"
+ "CostFinalize\t\t1000\n"
"InstallFiles\t\t4000\n"
"InstallServices\t\t5000\n"
"InstallFinalize\t\t6600\n"
@@ -14095,7 +14097,6 @@ static void test_setpropertyfolder(void)
{
UINT r;
CHAR path[MAX_PATH];
- DWORD attr;
if (is_process_limited())
{
@@ -14120,19 +14121,10 @@ static void test_setpropertyfolder(void)
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- attr = GetFileAttributesA(path);
- if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY))
- {
- ok(delete_pf("msitest\\added\\maximus", TRUE), "File not installed\n");
- ok(delete_pf("msitest\\added", FALSE), "Directory not created\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
- }
- else
- {
- trace("changing folder property not supported\n");
- ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
- }
+ ok(delete_pf("msitest\\added\\added2\\maximus", TRUE), "File not installed\n");
+ ok(delete_pf("msitest\\added\\added2", FALSE), "Directory not created\n");
+ ok(delete_pf("msitest\\added", FALSE), "Directory not created\n");
+ ok(delete_pf("msitest", FALSE), "Directory not created\n");
error:
DeleteFileA(msifile);
--
2.11.0
Sept. 26, 2018
[PATCH v2 1/2] msi/tests: Drop workarounds for Windows 2000.
by Hans Leidekker
v2: Fix test failures.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/tests/Makefile.in | 2 +-
dlls/msi/tests/action.c | 14 +++----------
dlls/msi/tests/automation.c | 10 ++-------
dlls/msi/tests/install.c | 6 +-----
dlls/msi/tests/msi.c | 51 +++++++++++++++++++--------------------------
dlls/msi/tests/package.c | 45 +++++++++------------------------------
dlls/msi/tests/patch.c | 7 +------
dlls/msi/tests/source.c | 25 +++-------------------
8 files changed, 42 insertions(+), 118 deletions(-)
diff --git a/dlls/msi/tests/Makefile.in b/dlls/msi/tests/Makefile.in
index a0fdcaeb84..9398ffe93b 100644
--- a/dlls/msi/tests/Makefile.in
+++ b/dlls/msi/tests/Makefile.in
@@ -1,5 +1,5 @@
TESTDLL = msi.dll
-IMPORTS = cabinet msi shell32 ole32 oleaut32 user32 advapi32 version odbccp32
+IMPORTS = secur32 cabinet msi shell32 ole32 oleaut32 user32 advapi32 version odbccp32
custom_IMPORTS = uuid msi ole32 shell32 advapi32 odbccp32 oleaut32
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index f7ef07d0ac..084dbe4532 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -34,6 +34,7 @@
#include <shellapi.h>
#include <winsvc.h>
#include <odbcinst.h>
+#include <sddl.h>
#include "wine/test.h"
#include "utils.h"
@@ -50,11 +51,9 @@ static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
static UINT (WINAPI *pMsiQueryFeatureStateExA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR *);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static HMODULE hsrclient;
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
@@ -2356,6 +2355,7 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
@@ -2368,11 +2368,9 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiGetComponentPathExA);
GET_PROC(hmsi, MsiQueryFeatureStateExA);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
@@ -2386,17 +2384,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -6467,7 +6460,6 @@ START_TEST(action)
if (ret)
remove_restore_point(status.llSequenceNumber);
}
- FreeLibrary(hsrclient);
SetCurrentDirectoryA(prev_path);
}
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 2554df7ee6..7e5124c1a1 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -35,8 +35,6 @@
static BOOL is_wow64;
-static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
-static BOOL (WINAPI *pOpenProcessToken)(HANDLE, DWORD, PHANDLE);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
@@ -219,8 +217,6 @@ static void init_functionpointers(void)
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
- GET_PROC(hadvapi32, CheckTokenMembership);
- GET_PROC(hadvapi32, OpenProcessToken);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
@@ -234,11 +230,9 @@ static BOOL is_process_limited(void)
BOOL IsInGroup;
HANDLE token;
- if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
-
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is an administrator\n");
FreeSid(Group);
@@ -252,7 +246,7 @@ static BOOL is_process_limited(void)
return TRUE;
}
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 4fa186246a..9c8652b353 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -44,13 +44,11 @@ static UINT (WINAPI *pMsiSourceListEnumSourcesA)
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **);
static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *);
-static HMODULE hsrclient = 0;
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
@@ -2146,6 +2144,7 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
@@ -2156,13 +2155,11 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiSourceListEnumSourcesA);
GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
GET_PROC(hkernel32, Wow64DisableWow64FsRedirection);
GET_PROC(hkernel32, Wow64RevertWow64FsRedirection);
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
@@ -6294,7 +6291,6 @@ START_TEST(install)
if (ret)
remove_restore_point(status.llSequenceNumber);
}
- FreeLibrary(hsrclient);
SetCurrentDirectoryA(prev_path);
}
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index f4afef15db..842ed112f5 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -38,7 +38,6 @@ static BOOL is_wow64;
static const char msifile[] = "winetest.msi";
static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','.','m','s','i',0};
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
@@ -104,7 +103,6 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiEnumComponentsExA)
GET_PROC(hmsi, MsiSourceListGetInfoA)
- GET_PROC(hadvapi32, ConvertSidToStringSidA)
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
@@ -1180,7 +1178,7 @@ static char *get_user_sid(void)
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -14445,33 +14443,26 @@ START_TEST(msi)
test_MsiGetFileHash();
test_MsiSetInternalUI();
test_MsiSetExternalUI();
-
- if (!pConvertSidToStringSidA)
- win_skip("ConvertSidToStringSidA not implemented\n");
- else
- {
- /* These tests rely on get_user_sid that needs ConvertSidToStringSidA */
- test_MsiQueryProductState();
- test_MsiQueryFeatureState();
- test_MsiQueryComponentState();
- test_MsiGetComponentPath();
- test_MsiGetComponentPathEx();
- test_MsiProvideComponent();
- test_MsiGetProductCode();
- test_MsiEnumClients();
- test_MsiGetProductInfo();
- test_MsiGetProductInfoEx();
- test_MsiGetUserInfo();
- test_MsiOpenProduct();
- test_MsiEnumPatchesEx();
- test_MsiEnumPatches();
- test_MsiGetPatchInfoEx();
- test_MsiGetPatchInfo();
- test_MsiEnumProducts();
- test_MsiEnumProductsEx();
- test_MsiEnumComponents();
- test_MsiEnumComponentsEx();
- }
+ test_MsiQueryProductState();
+ test_MsiQueryFeatureState();
+ test_MsiQueryComponentState();
+ test_MsiGetComponentPath();
+ test_MsiGetComponentPathEx();
+ test_MsiProvideComponent();
+ test_MsiGetProductCode();
+ test_MsiEnumClients();
+ test_MsiGetProductInfo();
+ test_MsiGetProductInfoEx();
+ test_MsiGetUserInfo();
+ test_MsiOpenProduct();
+ test_MsiEnumPatchesEx();
+ test_MsiEnumPatches();
+ test_MsiGetPatchInfoEx();
+ test_MsiGetPatchInfo();
+ test_MsiEnumProducts();
+ test_MsiEnumProductsEx();
+ test_MsiEnumComponents();
+ test_MsiEnumComponentsEx();
test_MsiGetFileVersion();
test_MsiGetFileSignatureInformation();
test_MsiConfigureProductEx();
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index d6d90ce39f..d5f156825d 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -29,6 +29,7 @@
#include <msiquery.h>
#include <srrestoreptapi.h>
#include <shlobj.h>
+#include <sddl.h>
#include "wine/test.h"
@@ -39,18 +40,10 @@ static const WCHAR msifileW[] =
static char CURR_DIR[MAX_PATH];
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
-static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR);
-static BOOL (WINAPI *pCheckTokenMembership)(HANDLE,PSID,PBOOL);
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
-static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
-static void (WINAPI *pGetSystemInfo)(LPSYSTEM_INFO);
-static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
-static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR, UINT);
-
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
@@ -59,28 +52,20 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hshell32 = GetModuleHandleA("shell32.dll");
- HMODULE hsrclient;
+ HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func);
GET_PROC(hmsi, MsiGetComponentPathExA);
- GET_PROC(hshell32, SHGetFolderPathA);
- GET_PROC(hadvapi32, CheckTokenMembership);
- GET_PROC(hadvapi32, ConvertSidToStringSidA);
- GET_PROC(hadvapi32, OpenProcessToken);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hadvapi32, RegDeleteKeyExW)
GET_PROC(hkernel32, IsWow64Process)
- GET_PROC(hkernel32, GetNativeSystemInfo)
- GET_PROC(hkernel32, GetSystemInfo)
- GET_PROC(hkernel32, GetSystemWow64DirectoryA)
- hsrclient = LoadLibraryA("srclient.dll");
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
+
#undef GET_PROC
}
@@ -91,11 +76,9 @@ static BOOL is_process_limited(void)
BOOL IsInGroup;
HANDLE token;
- if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE;
-
if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) ||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is an administrator\n");
FreeSid(Group);
@@ -109,7 +92,7 @@ static BOOL is_process_limited(void)
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_POWER_USERS,
0, 0, 0, 0, 0, 0, &Group) ||
- !pCheckTokenMembership(NULL, Group, &IsInGroup))
+ !CheckTokenMembership(NULL, Group, &IsInGroup))
{
trace("Could not check if the current user is a power user\n");
return FALSE;
@@ -121,7 +104,7 @@ static BOOL is_process_limited(void)
}
}
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
@@ -148,17 +131,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -4705,7 +4683,7 @@ static void test_appsearch_reglocator(void)
ok(!lstrcmpA(prop, "#-42"), "Expected \"#-42\", got \"%s\"\n", prop);
memset(&si, 0, sizeof(si));
- if (pGetNativeSystemInfo) pGetNativeSystemInfo(&si);
+ GetNativeSystemInfo(&si);
if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{
@@ -5721,10 +5699,7 @@ static void test_installprops(void)
r = MsiGetPropertyA(hpkg, "MsiNetAssemblySupport", buf, &size);
if (r == ERROR_SUCCESS) trace( "MsiNetAssemblySupport \"%s\"\n", buf );
- if (pGetNativeSystemInfo)
- pGetNativeSystemInfo(&si);
- else
- pGetSystemInfo(&si);
+ GetNativeSystemInfo(&si);
if (S(U(si)).wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
{
@@ -5739,7 +5714,7 @@ static void test_installprops(void)
strcat(path, "\\");
check_prop(hpkg, "System64Folder", path);
- pGetSystemWow64DirectoryA(path, MAX_PATH);
+ GetSystemWow64DirectoryA(path, MAX_PATH);
strcat(path, "\\");
check_prop(hpkg, "SystemFolder", path);
diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c
index b577982443..63d38b8ff9 100644
--- a/dlls/msi/tests/patch.c
+++ b/dlls/msi/tests/patch.c
@@ -36,7 +36,6 @@ static UINT (WINAPI *pMsiGetPatchInfoExA)( LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCON
LPCSTR, LPSTR, DWORD * );
static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR,
LPSTR, MSIINSTALLCONTEXT *, LPSTR, LPDWORD );
-static BOOL (WINAPI *pOpenProcessToken)( HANDLE, DWORD, PHANDLE );
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
@@ -145,7 +144,6 @@ static const struct msi_table tables[] =
static void init_function_pointers( void )
{
HMODULE hmsi = GetModuleHandleA( "msi.dll" );
- HMODULE hadvapi32 = GetModuleHandleA( "advapi32.dll" );
#define GET_PROC( mod, func ) \
p ## func = (void *)GetProcAddress( mod, #func ); \
@@ -156,7 +154,6 @@ static void init_function_pointers( void )
GET_PROC( hmsi, MsiGetPatchInfoExA );
GET_PROC( hmsi, MsiEnumPatchesExA );
- GET_PROC( hadvapi32, OpenProcessToken );
#undef GET_PROC
}
@@ -164,9 +161,7 @@ static BOOL is_process_limited(void)
{
HANDLE token;
- if (!pOpenProcessToken) return FALSE;
-
- if (pOpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
+ if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
{
BOOL ret;
TOKEN_ELEVATION_TYPE type = TokenElevationTypeDefault;
diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c
index a03cf557aa..654df35f54 100644
--- a/dlls/msi/tests/source.c
+++ b/dlls/msi/tests/source.c
@@ -34,9 +34,7 @@
static BOOL is_wow64;
-static BOOL (WINAPI *pConvertSidToStringSidA)(PSID, LPSTR*);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
-static BOOLEAN (WINAPI *pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static UINT (WINAPI *pMsiSourceListAddMediaDiskA)
@@ -60,7 +58,6 @@ static void init_functionpointers(void)
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
- HMODULE hsecur32 = LoadLibraryA("secur32.dll");
#define GET_PROC(dll, func) \
p ## func = (void *)GetProcAddress(dll, #func); \
@@ -75,10 +72,8 @@ static void init_functionpointers(void)
GET_PROC(hmsi, MsiSourceListSetInfoA)
GET_PROC(hmsi, MsiSourceListAddSourceA)
- GET_PROC(hadvapi32, ConvertSidToStringSidA)
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
- GET_PROC(hsecur32, GetUserNameExA)
#undef GET_PROC
}
@@ -142,17 +137,12 @@ static char *get_user_sid(void)
TOKEN_USER *user;
char *usersid = NULL;
- if (!pConvertSidToStringSidA)
- {
- win_skip("ConvertSidToStringSidA is not available\n");
- return NULL;
- }
OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
GetTokenInformation(token, TokenUser, NULL, size, &size);
user = HeapAlloc(GetProcessHeap(), 0, size);
GetTokenInformation(token, TokenUser, user, size, &size);
- pConvertSidToStringSidA(user->User.Sid, &usersid);
+ ConvertSidToStringSidA(user->User.Sid, &usersid);
HeapFree(GetProcessHeap(), 0, user);
CloseHandle(token);
@@ -3241,7 +3231,7 @@ static void test_MsiSourceListAddSource(void)
CHAR prod_squashed[MAX_PATH];
CHAR keypath[MAX_PATH*2];
CHAR username[MAX_PATH];
- LPSTR usersid, ptr;
+ LPSTR usersid;
LONG res;
UINT r;
HKEY prodkey, userkey, net, source;
@@ -3263,16 +3253,7 @@ static void test_MsiSourceListAddSource(void)
/* MACHINENAME\username */
size = MAX_PATH;
- if (pGetUserNameExA != NULL)
- pGetUserNameExA(NameSamCompatible, username, &size);
- else
- {
- GetComputerNameA(username, &size);
- lstrcatA(username, "\\");
- ptr = username + lstrlenA(username);
- size = MAX_PATH - (ptr - username);
- GetUserNameA(ptr, &size);
- }
+ GetUserNameExA(NameSamCompatible, username, &size);
trace("username: %s\n", username);
if (is_wow64)
--
2.11.0
Sept. 26, 2018
Re: Making an MFC application Mac OS X aware
by mrt303xx@aol.com
I want to do things differently or I guess in a Mac-like. I have the Wine version, but not if it is running Mac. If we are running on a Mac, then I would like to call a function that creates and installs the menu bar at the top of the application like Mac apps do. Currently, it sits in the application window. I would use a different background and font for Mac
Tarie
-----Original Message-----
From: Ken Thomases <ken(a)codeweavers.com>
To: mrt303xx <mrt303xx(a)aol.com>
Cc: wine-devel <wine-devel(a)winehq.org>
Sent: Mon, Sep 24, 2018 2:23 pm
Subject: Re: Making an MFC application Mac OS X aware
On Sep 24, 2018, at 10:52 AM, mrt303xx(a)aol.com wrote:
>
> Is there any way to call functions in WINE to help an application act more natively on the Mac OS?
Do you mean you want to check if you're running on macOS and, if so, your own code will do things differently? Or do you mean you want Wine to automatically behave more like a native Mac app?
For the former, Wine's ntdll exports a function, wine_get_host_version, which you can use to detect the host OS. Use GetProcAddress() to obtain the function pointer. The pointed-to function has the following signature:
void CDECL wine_get_host_version( const char **sysname, const char **release );
It is safe to pass NULL for either or both parameters.
The function is a wrapper around the uname() system function. On macOS, if you provide sysname, it will store a pointer to the string "Darwin" to *sysname.
If you were asking about the latter, then Wine is already trying to behave as much like a native Mac app as it can while still being compatible with Windows apps. What behavior are you looking to change?
-Ken
Sept. 26, 2018