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
December 2019
- 73 participants
- 1394 messages
[PATCH v3 1/4] kernelbase: Support PROC_THREAD_ATTRIBUTE_PARENT_PROCESS in CreateProcessInternalW().
by Paul Gofman
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com>
---
v2:
- don't use INVALID_HANDLE_VALUE to return an error on zero parent;
v3:
- no changes.
dlls/kernelbase/process.c | 88 ++++++++++++++++++++++++++-------------
1 file changed, 59 insertions(+), 29 deletions(-)
diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c
index 90ea299416..d6106eb5f6 100644
--- a/dlls/kernelbase/process.c
+++ b/dlls/kernelbase/process.c
@@ -244,7 +244,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
*/
static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
- RTL_USER_PROCESS_INFORMATION *info )
+ RTL_USER_PROCESS_INFORMATION *info, HANDLE parent )
{
NTSTATUS status;
UNICODE_STRING nameW;
@@ -257,7 +257,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
status = RtlCreateUserProcess( &nameW, OBJ_CASE_INSENSITIVE, params,
psa ? psa->lpSecurityDescriptor : NULL,
tsa ? tsa->lpSecurityDescriptor : NULL,
- 0, inherit, 0, 0, info );
+ parent, inherit, 0, 0, info );
RtlFreeUnicodeString( &nameW );
}
return status;
@@ -288,7 +288,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer );
RtlInitUnicodeString( ¶ms->ImagePathName, winevdm );
RtlInitUnicodeString( ¶ms->CommandLine, newcmdline );
- status = create_nt_process( psa, tsa, inherit, flags, params, info );
+ status = create_nt_process( psa, tsa, inherit, flags, params, info, NULL );
HeapFree( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -316,7 +316,7 @@ static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer );
RtlInitUnicodeString( ¶ms->ImagePathName, comspec );
RtlInitUnicodeString( ¶ms->CommandLine, newcmdline );
- status = create_nt_process( psa, tsa, inherit, flags, params, info );
+ status = create_nt_process( psa, tsa, inherit, flags, params, info, NULL );
RtlFreeHeap( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -368,7 +368,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW( HANDLE token, const WCHAR *a
inherit, flags, env, cur_dir, startup_info, info, NULL );
}
-
/**********************************************************************
* CreateProcessInternalA (kernelbase.@)
*/
@@ -382,7 +381,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char *
BOOL ret = FALSE;
WCHAR *app_nameW = NULL, *cmd_lineW = NULL, *cur_dirW = NULL;
UNICODE_STRING desktopW, titleW;
- STARTUPINFOW infoW;
+ STARTUPINFOEXW infoW;
desktopW.Buffer = NULL;
titleW.Buffer = NULL;
@@ -393,12 +392,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalA( HANDLE token, const char *
if (startup_info->lpDesktop) RtlCreateUnicodeStringFromAsciiz( &desktopW, startup_info->lpDesktop );
if (startup_info->lpTitle) RtlCreateUnicodeStringFromAsciiz( &titleW, startup_info->lpTitle );
- memcpy( &infoW, startup_info, sizeof(infoW) );
- infoW.lpDesktop = desktopW.Buffer;
- infoW.lpTitle = titleW.Buffer;
+ memcpy( &infoW.StartupInfo, startup_info, sizeof(infoW.StartupInfo) );
+ infoW.StartupInfo.lpDesktop = desktopW.Buffer;
+ infoW.StartupInfo.lpTitle = titleW.Buffer;
+
+ if (flags & EXTENDED_STARTUPINFO_PRESENT)
+ infoW.lpAttributeList = ((STARTUPINFOEXW *)startup_info)->lpAttributeList;
ret = CreateProcessInternalW( token, app_nameW, cmd_lineW, process_attr, thread_attr,
- inherit, flags, env, cur_dirW, &infoW, info, new_token );
+ inherit, flags, env, cur_dirW, (STARTUPINFOW *)&infoW, info, new_token );
done:
RtlFreeHeap( GetProcessHeap(), 0, app_nameW );
RtlFreeHeap( GetProcessHeap(), 0, cmd_lineW );
@@ -408,6 +410,22 @@ done:
return ret;
}
+struct proc_thread_attr
+{
+ DWORD_PTR attr;
+ SIZE_T size;
+ void *value;
+};
+
+struct _PROC_THREAD_ATTRIBUTE_LIST
+{
+ DWORD mask; /* bitmask of items in list */
+ DWORD size; /* max number of items in list */
+ DWORD count; /* number of items in list */
+ DWORD pad;
+ DWORD_PTR unk;
+ struct proc_thread_attr attrs[1];
+};
/**********************************************************************
* CreateProcessInternalW (kernelbase.@)
@@ -423,6 +441,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
WCHAR *p, *tidy_cmdline = cmd_line;
RTL_USER_PROCESS_PARAMETERS *params = NULL;
RTL_USER_PROCESS_INFORMATION rtl_info;
+ HANDLE parent = NULL;
NTSTATUS status;
/* Process the AppName and/or CmdLine to get module name and path */
@@ -473,7 +492,36 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
goto done;
}
- status = create_nt_process( process_attr, thread_attr, inherit, flags, params, &rtl_info );
+ if (flags & EXTENDED_STARTUPINFO_PRESENT)
+ {
+ struct _PROC_THREAD_ATTRIBUTE_LIST *attrs =
+ (struct _PROC_THREAD_ATTRIBUTE_LIST *)((STARTUPINFOEXW *)startup_info)->lpAttributeList;
+ unsigned int i;
+
+ if (attrs)
+ {
+ for (i = 0; i < attrs->count; ++i)
+ {
+ switch(attrs->attrs[i].attr)
+ {
+ case PROC_THREAD_ATTRIBUTE_PARENT_PROCESS:
+ parent = *(HANDLE *)attrs->attrs[i].value;
+ TRACE("PROC_THREAD_ATTRIBUTE_PARENT_PROCESS parent %p.\n", parent);
+ if (!parent)
+ {
+ status = STATUS_INVALID_HANDLE;
+ goto done;
+ }
+ break;
+ default:
+ FIXME("Unsupported attribute %#lx.\n", attrs->attrs[i].attr);
+ break;
+ }
+ }
+ }
+ }
+
+ status = create_nt_process( process_attr, thread_attr, inherit, flags, params, &rtl_info, parent );
switch (status)
{
case STATUS_SUCCESS:
@@ -1301,24 +1349,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableW( LPCWSTR name, LPCWSTR val
* Process/thread attribute lists
***********************************************************************/
-
-struct proc_thread_attr
-{
- DWORD_PTR attr;
- SIZE_T size;
- void *value;
-};
-
-struct _PROC_THREAD_ATTRIBUTE_LIST
-{
- DWORD mask; /* bitmask of items in list */
- DWORD size; /* max number of items in list */
- DWORD count; /* number of items in list */
- DWORD pad;
- DWORD_PTR unk;
- struct proc_thread_attr attrs[1];
-};
-
/***********************************************************************
* InitializeProcThreadAttributeList (kernelbase.@)
*/
--
2.23.0
Dec. 12, 2019
Re: [PATCH 1/5] ole32: Fix property name handling for dictionary entries in CP_UNICODE case.
by Marvin
Hi,
While running your changed tests, 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=62010
Your paranoid android.
=== debian10 (64 bit WoW report) ===
ole32:
clipboard.c:1017: Test failed: failed to clear clipboard, hr = 0x00000000
clipboard.c:626: Test failed: got 800401d0
clipboard.c:1027: Test failed: expected data_cmpl ref=0, got 4
Dec. 12, 2019
[PATCH] shell32: Partially implement ShellLink_AddDataBlock
by Vijay Kiran Kamuju
Wine Bug: https://bugs.winehq.org/show_bug.cgi?id=38171
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
---
dlls/shell32/shelllink.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c
index 0dfb81c6e7..5831a9046e 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -2228,8 +2228,11 @@ ShellLink_DataList_Release( IShellLinkDataList* iface )
static HRESULT WINAPI
ShellLink_AddDataBlock( IShellLinkDataList* iface, void* pDataBlock )
{
- FIXME("(%p)->(%p): stub\n", iface, pDataBlock);
- return E_NOTIMPL;
+ DATABLOCK_HEADER *hdr = (DATABLOCK_HEADER *)pDataBlock;
+
+ FIXME("(%p)->(%p) (Size: %d - Signature: %08x): partially implemented.\n", iface, pDataBlock, hdr->cbSize, hdr->dwSignature);
+
+ return S_OK;
}
static HRESULT WINAPI
--
2.21.0
Dec. 12, 2019
Re: [PATCH] wininet: Fix the spelling of a comment.
by Marvin
Hi,
While running your changed tests, 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=62006
Your paranoid android.
=== debian10 (64 bit WoW report) ===
wininet:
http.c:4946: Test failed: expected 1 pending read, got 2
Dec. 12, 2019
Re: [PATCH v2 2/4] ntdll: Support creating processes with specified parent.
by Paul Gofman
On 12/12/19 13:41, Alexandre Julliard wrote:
> Paul Gofman <gofmanp(a)gmail.com> writes:
>
>> On 12/12/19 11:35, Alexandre Julliard wrote:
>>> Paul Gofman <gofmanp(a)gmail.com> writes:
>>>
>>>> @@ -1667,8 +1667,14 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
>>>>
>>>> RtlNormalizeProcessParams( params );
>>>>
>>>> - TRACE( "%s image %s cmdline %s\n", debugstr_us( path ),
>>>> - debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ));
>>>> + TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ),
>>>> + debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ), parent);
>>>> +
>>>> + if (parent == INVALID_HANDLE_VALUE)
>>>> + {
>>>> + memset(info, 0, sizeof(*info));
>>>> + return STATUS_INVALID_HANDLE;
>>>> + }
>>> You are still using INVALID_HANDLE_VALUE here, I don't think that makes
>>> sense. The check for an invalid handle should use a truly invalid value
>>> like 0xdeadbeef.
>>>
>>> It may be interesting to test what happens with GetCurrentProcess(), and
>>> also some other handle pointing to the current process, but that should
>>> be separate from the generic invalid handle test.
>>>
>> Â Â Â The check for invalid handle here is not for something explicitly
>> assigned in kernelbase, CreateProcessInternalW() in my v2 patch doesn't
>> encode any error conditions in INVALID_HANDLE_VALUE anymore. The truly
>> invalid handles (like 0xdeadbeef) get error from server call. The same
>> is for the other pseudo handles like that for current thread as they
>> have wrong type. Unlike INVALID_HANDLE_VALUE which is taken as current
>> process there. I have a test with 0xdeadbeef in the next patch which
>> returns an error on process creation on all Windows versions as well as
>> with these patches without any explicit checks before server call. There
>> are also tests with INVALID_HANDLE_VALUE and GetCurrentProcess() present
>> in the next patch which fail to create the process on Vista, w7 and w10
>> (and creates a process on w7u / w8), so I added the explicit check to
>> satisfy the "mainstream" behaviour. Now I briefly checked what happens
>> if I set a duplicated GetCurrentProcess() handle or handle from
>> OpenProcess(..., GetCurrentProcessId()) for parent handle, and the
>> process creation succeeds with that valid non-pseudo handle for the
>> current process. Should I add this test?
>>
>> Â Â Â So should I maybe move this check for 0xffffffff handle to
>> CreateProcessInternalW(), where it checks for 0 handle already?
> I'm not sure we need the check at all, since it works on some Windows
> versions, and it works for other handles to the current
> process. Accepting GetCurrentProcess() doesn't strike me as something
> that needs to be considered broken.
>
> More to the point, INVALID_HANDLE_VALUE is meaningless with process
> handles. It's a value that's used with file handle APIs, but for
> processes, the error value is 0, and 0xffffffff is the current process
> pseudo-handle.
>
So I will remove the check then and change what is 'broken' in the tests.
Dec. 12, 2019
[PATCH 5/5] ole32: Get rid of casts in 64-bit int serialization helper.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/stg_prop.c | 5 ++---
dlls/ole32/storage32.c | 7 +++----
dlls/ole32/storage32.h | 3 +--
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index eeda2132dd..84eaa2aac4 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1981,9 +1981,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{
FILETIME temp;
- StorageUtl_WriteULargeInteger((BYTE *)&temp, 0,
- (const ULARGE_INTEGER *)&var->u.filetime);
- hr = IStream_Write(This->stm, &temp, sizeof(FILETIME), &count);
+ StorageUtl_WriteULargeInteger(&temp, 0, (const ULARGE_INTEGER *)&var->u.filetime);
+ hr = IStream_Write(This->stm, &temp, sizeof(temp), &count);
bytesWritten = count;
break;
}
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 5fc1f59b78..52ecf59028 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -6982,17 +6982,16 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
#endif
}
-void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
- const ULARGE_INTEGER *value)
+void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value)
{
#ifdef WORDS_BIGENDIAN
ULARGE_INTEGER tmp;
tmp.u.LowPart = htole32(value->u.HighPart);
tmp.u.HighPart = htole32(value->u.LowPart);
- memcpy(buffer + offset, &tmp, sizeof(ULARGE_INTEGER));
+ memcpy((BYTE *)buffer + offset, &tmp, sizeof(ULARGE_INTEGER));
#else
- memcpy(buffer + offset, value, sizeof(ULARGE_INTEGER));
+ memcpy((BYTE *)buffer + offset, value, sizeof(ULARGE_INTEGER));
#endif
}
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index bfd3a3121f..f79f96e929 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -561,8 +561,7 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSP
void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
ULARGE_INTEGER* value) DECLSPEC_HIDDEN;
-void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
- const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
+void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN;
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
--
2.24.0
Dec. 12, 2019
[PATCH 4/5] ole32: Get rid of casts in GUID serialization helper.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/stg_prop.c | 6 +++---
dlls/ole32/storage32.c | 4 ++--
dlls/ole32/storage32.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index 79f1c20742..eeda2132dd 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1711,7 +1711,7 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC);
StorageUtl_WriteWord(&hdr->wFormat, 0, This->format);
StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS);
- StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid);
+ StorageUtl_WriteGUID(&hdr->clsid, 0, &This->clsid);
StorageUtl_WriteDWord(&hdr->reserved, 0, 1);
}
@@ -1719,7 +1719,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This,
FORMATIDOFFSET *fmtOffset)
{
assert(fmtOffset);
- StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid);
+ StorageUtl_WriteGUID(fmtOffset, 0, &This->fmtid);
StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset),
sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET));
}
@@ -2008,7 +2008,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{
CLSID temp;
- StorageUtl_WriteGUID((BYTE *)&temp, 0, var->u.puuid);
+ StorageUtl_WriteGUID(&temp, 0, var->u.puuid);
hr = IStream_Write(This->stm, &temp, sizeof(temp), &count);
bytesWritten = count;
break;
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 6e0a9bb449..5fc1f59b78 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -7005,13 +7005,13 @@ void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value)
memcpy(value->Data4, buffer+offset+8, sizeof(value->Data4));
}
-void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value)
+void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value)
{
StorageUtl_WriteDWord(buffer, offset, value->Data1);
StorageUtl_WriteWord(buffer, offset+4, value->Data2);
StorageUtl_WriteWord(buffer, offset+6, value->Data3);
- memcpy(buffer+offset+8, value->Data4, sizeof(value->Data4));
+ memcpy((BYTE *)buffer + offset + 8, value->Data4, sizeof(value->Data4));
}
void StorageUtl_CopyDirEntryToSTATSTG(
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index 046334b98b..bfd3a3121f 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -564,7 +564,7 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
const ULARGE_INTEGER *value) DECLSPEC_HIDDEN;
void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN;
-void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN;
+void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN;
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination,
const DirEntry* source, int statFlags) DECLSPEC_HIDDEN;
--
2.24.0
Dec. 12, 2019
[PATCH 3/5] ole32: Get rid of casts in WORD serialization helper.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/stg_prop.c | 7 +++----
dlls/ole32/storage32.c | 6 +++---
dlls/ole32/storage32.h | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index d6b0d6c215..79f1c20742 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1708,9 +1708,8 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
PROPERTYSETHEADER *hdr)
{
assert(hdr);
- StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0,
- PROPSETHDR_BYTEORDER_MAGIC);
- StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format);
+ StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC);
+ StorageUtl_WriteWord(&hdr->wFormat, 0, This->format);
StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS);
StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid);
StorageUtl_WriteDWord(&hdr->reserved, 0, 1);
@@ -1934,7 +1933,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{
WORD wTemp;
- StorageUtl_WriteWord((LPBYTE)&wTemp, 0, var->u.iVal);
+ StorageUtl_WriteWord(&wTemp, 0, var->u.iVal);
hr = IStream_Write(This->stm, &wTemp, sizeof(wTemp), &count);
bytesWritten = count;
break;
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 08a1d2201f..6e0a9bb449 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -6948,10 +6948,10 @@ void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value)
*value = lendian16toh(tmp);
}
-void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value)
+void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value)
{
- value = htole16(value);
- memcpy(buffer+offset, &value, sizeof(WORD));
+ value = htole16(value);
+ memcpy((BYTE *)buffer + offset, &value, sizeof(WORD));
}
void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value)
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index a54871f55b..046334b98b 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -556,7 +556,7 @@ StgStreamImpl* StgStreamImpl_Construct(
* worry about bit order
*/
void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN;
-void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN;
+void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
--
2.24.0
Dec. 12, 2019
[PATCH 2/5] ole32: Get rid of some casts in DWORD serialization helper.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/ole32/stg_prop.c | 39 ++++++++++++++++++---------------------
dlls/ole32/storage32.c | 8 ++++----
dlls/ole32/storage32.h | 2 +-
3 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index 095bbaab94..d6b0d6c215 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1711,9 +1711,9 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This,
StorageUtl_WriteWord((BYTE *)&hdr->wByteOrder, 0,
PROPSETHDR_BYTEORDER_MAGIC);
StorageUtl_WriteWord((BYTE *)&hdr->wFormat, 0, This->format);
- StorageUtl_WriteDWord((BYTE *)&hdr->dwOSVer, 0, This->originatorOS);
+ StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS);
StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid);
- StorageUtl_WriteDWord((BYTE *)&hdr->reserved, 0, 1);
+ StorageUtl_WriteDWord(&hdr->reserved, 0, 1);
}
static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This,
@@ -1721,7 +1721,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This,
{
assert(fmtOffset);
StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid);
- StorageUtl_WriteDWord((BYTE *)fmtOffset, offsetof(FORMATIDOFFSET, dwOffset),
+ StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset),
sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET));
}
@@ -1729,18 +1729,16 @@ static void PropertyStorage_MakeSectionHdr(DWORD cbSection, DWORD numProps,
PROPERTYSECTIONHEADER *hdr)
{
assert(hdr);
- StorageUtl_WriteDWord((BYTE *)hdr, 0, cbSection);
- StorageUtl_WriteDWord((BYTE *)hdr,
- offsetof(PROPERTYSECTIONHEADER, cProperties), numProps);
+ StorageUtl_WriteDWord(hdr, 0, cbSection);
+ StorageUtl_WriteDWord(hdr, offsetof(PROPERTYSECTIONHEADER, cProperties), numProps);
}
static void PropertyStorage_MakePropertyIdOffset(DWORD propid, DWORD dwOffset,
PROPERTYIDOFFSET *propIdOffset)
{
assert(propIdOffset);
- StorageUtl_WriteDWord((BYTE *)propIdOffset, 0, propid);
- StorageUtl_WriteDWord((BYTE *)propIdOffset,
- offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset);
+ StorageUtl_WriteDWord(propIdOffset, 0, propid);
+ StorageUtl_WriteDWord(propIdOffset, offsetof(PROPERTYIDOFFSET, dwOffset), dwOffset);
}
static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm,
@@ -1778,7 +1776,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
assert(key);
assert(closure);
- StorageUtl_WriteDWord((LPBYTE)&propid, 0, PtrToUlong(value));
+ StorageUtl_WriteDWord(&propid, 0, PtrToUlong(value));
c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count);
if (FAILED(c->hr))
goto end;
@@ -1787,7 +1785,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
{
DWORD pad = 0, pad_len;
- StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1);
+ StorageUtl_WriteDWord(&keyLen, 0, lstrlenW((LPCWSTR)key) + 1);
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
if (FAILED(c->hr))
goto end;
@@ -1811,7 +1809,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
}
else
{
- StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1);
+ StorageUtl_WriteDWord(&keyLen, 0, strlen((LPCSTR)key) + 1);
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
if (FAILED(c->hr))
goto end;
@@ -1859,8 +1857,7 @@ static HRESULT PropertyStorage_WriteDictionaryToStream(
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0,
- dictionary_num_entries(This->name_to_propid));
+ StorageUtl_WriteDWord(&dwTemp, 0, dictionary_num_entries(This->name_to_propid));
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
@@ -1914,7 +1911,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
- StorageUtl_WriteDWord((LPBYTE)&dwType, 0, var->vt);
+ StorageUtl_WriteDWord(&dwType, 0, var->vt);
hr = IStream_Write(This->stm, &dwType, sizeof(dwType), &count);
if (FAILED(hr))
goto end;
@@ -1947,7 +1944,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{
DWORD dwTemp;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, var->u.lVal);
+ StorageUtl_WriteDWord(&dwTemp, 0, var->u.lVal);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
bytesWritten = count;
break;
@@ -1960,7 +1957,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
len = (lstrlenW(var->u.pwszVal) + 1) * sizeof(WCHAR);
else
len = lstrlenA(var->u.pszVal) + 1;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len);
+ StorageUtl_WriteDWord(&dwTemp, 0, len);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
@@ -1972,7 +1969,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
{
DWORD len = lstrlenW(var->u.pwszVal) + 1, dwTemp;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, len);
+ StorageUtl_WriteDWord(&dwTemp, 0, len);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
if (FAILED(hr))
goto end;
@@ -1996,8 +1993,8 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This,
DWORD cf_hdr[2], len;
len = var->u.pclipdata->cbSize;
- StorageUtl_WriteDWord((LPBYTE)&cf_hdr[0], 0, len + 8);
- StorageUtl_WriteDWord((LPBYTE)&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt);
+ StorageUtl_WriteDWord(&cf_hdr[0], 0, len + 8);
+ StorageUtl_WriteDWord(&cf_hdr[1], 0, var->u.pclipdata->ulClipFmt);
hr = IStream_Write(This->stm, cf_hdr, sizeof(cf_hdr), &count);
if (FAILED(hr))
goto end;
@@ -2192,7 +2189,7 @@ static HRESULT PropertyStorage_WriteToStream(PropertyStorage_impl *This)
hr = IStream_Seek(This->stm, seek, STREAM_SEEK_SET, NULL);
if (FAILED(hr))
goto end;
- StorageUtl_WriteDWord((LPBYTE)&dwTemp, 0, sectionOffset);
+ StorageUtl_WriteDWord(&dwTemp, 0, sectionOffset);
hr = IStream_Write(This->stm, &dwTemp, sizeof(dwTemp), &count);
end:
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 515880ec36..08a1d2201f 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -6962,10 +6962,10 @@ void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value)
*value = lendian32toh(tmp);
}
-void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value)
+void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value)
{
- value = htole32(value);
- memcpy(buffer+offset, &value, sizeof(DWORD));
+ value = htole32(value);
+ memcpy((BYTE *)buffer + offset, &value, sizeof(DWORD));
}
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
@@ -7896,7 +7896,7 @@ static void SmallBlockChainStream_SetNextBlockInChain(
offsetOfBlockInDepot.QuadPart = (ULONGLONG)blockIndex * sizeof(ULONG);
- StorageUtl_WriteDWord((BYTE *)&buffer, 0, nextBlock);
+ StorageUtl_WriteDWord(&buffer, 0, nextBlock);
/*
* Read those bytes in the buffer from the small block file.
diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h
index c628523d09..a54871f55b 100644
--- a/dlls/ole32/storage32.h
+++ b/dlls/ole32/storage32.h
@@ -558,7 +558,7 @@ StgStreamImpl* StgStreamImpl_Construct(
void StorageUtl_ReadWord(const BYTE* buffer, ULONG offset, WORD* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteWord(BYTE* buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadDWord(const BYTE* buffer, ULONG offset, DWORD* value) DECLSPEC_HIDDEN;
-void StorageUtl_WriteDWord(BYTE* buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
+void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN;
void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset,
ULARGE_INTEGER* value) DECLSPEC_HIDDEN;
void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
--
2.24.0
Dec. 12, 2019
[PATCH 1/5] ole32: Fix property name handling for dictionary entries in CP_UNICODE case.
by Nikolay Sivov
From: Michael Müller <michael(a)fds-team.de>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42046
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Original patch was missing symmetric fix for serialization part.
dlls/ole32/stg_prop.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index 505467cad5..095bbaab94 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -1195,20 +1195,25 @@ static HRESULT PropertyStorage_ReadDictionary(PropertyStorage_impl *This,
ptr += sizeof(PROPID);
StorageUtl_ReadDWord(ptr, 0, &cbEntry);
ptr += sizeof(DWORD);
- TRACE("Reading entry with ID 0x%08x, %d bytes\n", propid, cbEntry);
/* Make sure the source string is NULL-terminated */
if (This->codePage != CP_UNICODE)
ptr[cbEntry - 1] = '\0';
else
- *((LPWSTR)ptr + cbEntry / sizeof(WCHAR)) = '\0';
+ ((WCHAR *)ptr)[cbEntry - 1] = '\0';
+
+ TRACE("Reading entry with ID %#x, %d chars, name %s.\n", propid, cbEntry, This->codePage == CP_UNICODE ?
+ debugstr_wn((WCHAR *)ptr, cbEntry) : debugstr_an((char *)ptr, cbEntry));
+
hr = PropertyStorage_StoreNameWithId(This, (char*)ptr, This->codePage, propid);
if (This->codePage == CP_UNICODE)
{
+ cbEntry *= sizeof(WCHAR);
+
/* Unicode entries are padded to DWORD boundaries */
if (cbEntry % sizeof(DWORD))
ptr += sizeof(DWORD) - (cbEntry % sizeof(DWORD));
}
- ptr += sizeof(DWORD) + cbEntry;
+ ptr += cbEntry;
}
return hr;
}
@@ -1753,7 +1758,7 @@ static inline HRESULT PropertyStorage_WriteWStringToStream(IStream *stm,
HeapFree(GetProcessHeap(), 0, leStr);
return hr;
#else
- return IStream_Write(stm, str, len, written);
+ return IStream_Write(stm, str, len * sizeof(WCHAR), written);
#endif
}
@@ -1768,7 +1773,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
{
PropertyStorage_impl *This = extra;
struct DictionaryClosure *c = closure;
- DWORD propid;
+ DWORD propid, keyLen;
ULONG count;
assert(key);
@@ -1780,10 +1785,9 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
c->bytesWritten += sizeof(DWORD);
if (This->codePage == CP_UNICODE)
{
- DWORD keyLen, pad = 0;
+ DWORD pad = 0, pad_len;
- StorageUtl_WriteDWord((LPBYTE)&keyLen, 0,
- (lstrlenW((LPCWSTR)key) + 1) * sizeof(WCHAR));
+ StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, lstrlenW((LPCWSTR)key) + 1);
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
if (FAILED(c->hr))
goto end;
@@ -1792,20 +1796,21 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
&count);
if (FAILED(c->hr))
goto end;
- c->bytesWritten += keyLen * sizeof(WCHAR);
- if (keyLen % sizeof(DWORD))
+ keyLen *= sizeof(WCHAR);
+ c->bytesWritten += keyLen;
+
+ /* Align to 4 bytes. */
+ pad_len = sizeof(DWORD) - keyLen % sizeof(DWORD);
+ if (pad_len)
{
- c->hr = IStream_Write(This->stm, &pad,
- sizeof(DWORD) - keyLen % sizeof(DWORD), &count);
+ c->hr = IStream_Write(This->stm, &pad, pad_len, &count);
if (FAILED(c->hr))
goto end;
- c->bytesWritten += sizeof(DWORD) - keyLen % sizeof(DWORD);
+ c->bytesWritten += pad_len;
}
}
else
{
- DWORD keyLen;
-
StorageUtl_WriteDWord((LPBYTE)&keyLen, 0, strlen((LPCSTR)key) + 1);
c->hr = IStream_Write(This->stm, &keyLen, sizeof(keyLen), &count);
if (FAILED(c->hr))
--
2.24.0
Dec. 12, 2019
Re: [PATCH v2 2/4] ntdll: Support creating processes with specified parent.
by Alexandre Julliard
Paul Gofman <gofmanp(a)gmail.com> writes:
> On 12/12/19 11:35, Alexandre Julliard wrote:
>> Paul Gofman <gofmanp(a)gmail.com> writes:
>>
>>> @@ -1667,8 +1667,14 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
>>>
>>> RtlNormalizeProcessParams( params );
>>>
>>> - TRACE( "%s image %s cmdline %s\n", debugstr_us( path ),
>>> - debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ));
>>> + TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ),
>>> + debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ), parent);
>>> +
>>> + if (parent == INVALID_HANDLE_VALUE)
>>> + {
>>> + memset(info, 0, sizeof(*info));
>>> + return STATUS_INVALID_HANDLE;
>>> + }
>> You are still using INVALID_HANDLE_VALUE here, I don't think that makes
>> sense. The check for an invalid handle should use a truly invalid value
>> like 0xdeadbeef.
>>
>> It may be interesting to test what happens with GetCurrentProcess(), and
>> also some other handle pointing to the current process, but that should
>> be separate from the generic invalid handle test.
>>
> Â Â Â The check for invalid handle here is not for something explicitly
> assigned in kernelbase, CreateProcessInternalW() in my v2 patch doesn't
> encode any error conditions in INVALID_HANDLE_VALUE anymore. The truly
> invalid handles (like 0xdeadbeef) get error from server call. The same
> is for the other pseudo handles like that for current thread as they
> have wrong type. Unlike INVALID_HANDLE_VALUE which is taken as current
> process there. I have a test with 0xdeadbeef in the next patch which
> returns an error on process creation on all Windows versions as well as
> with these patches without any explicit checks before server call. There
> are also tests with INVALID_HANDLE_VALUE and GetCurrentProcess() present
> in the next patch which fail to create the process on Vista, w7 and w10
> (and creates a process on w7u / w8), so I added the explicit check to
> satisfy the "mainstream" behaviour. Now I briefly checked what happens
> if I set a duplicated GetCurrentProcess() handle or handle from
> OpenProcess(..., GetCurrentProcessId()) for parent handle, and the
> process creation succeeds with that valid non-pseudo handle for the
> current process. Should I add this test?
>
> Â Â Â So should I maybe move this check for 0xffffffff handle to
> CreateProcessInternalW(), where it checks for 0 handle already?
I'm not sure we need the check at all, since it works on some Windows
versions, and it works for other handles to the current
process. Accepting GetCurrentProcess() doesn't strike me as something
that needs to be considered broken.
More to the point, INVALID_HANDLE_VALUE is meaningless with process
handles. It's a value that's used with file handle APIs, but for
processes, the error value is 0, and 0xffffffff is the current process
pseudo-handle.
--
Alexandre Julliard
julliard(a)winehq.org
Dec. 12, 2019
[PATCH] msxml3: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/msxml3/node.c | 2 +-
dlls/msxml3/tests/domdoc.c | 2 +-
dlls/msxml3/tests/saxreader.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index 27abf945301..35777d65918 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -432,7 +432,7 @@ int xmlnode_get_inst_cnt(xmlnode *node)
}
/* _private field holds a number of COM instances spawned from this libxml2 node
- * most significant bits are used to store information about ignorrable whitespace nodes */
+ * most significant bits are used to store information about ignorable whitespace nodes */
void xmlnode_add_ref(xmlNodePtr node)
{
if (node->type == XML_DOCUMENT_NODE) return;
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index aa4c7a28321..843343aa00b 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -4865,7 +4865,7 @@ static void test_XPath(void)
EXPECT_HR(hr, S_OK);
expect_list_and_release(list, "E2.D1");
- /* peform xpath tests */
+ /* perform xpath tests */
for ( ; xptest->query ; xptest++ )
{
char *str;
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index 4e77b00a639..44b5e1bcb5f 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -3172,7 +3172,7 @@ static void test_mxwriter_properties(void)
ok(hr == E_INVALIDARG, "got %08x\n", hr);
SysFreeString(str);
- /* test case sensivity */
+ /* test case sensitivity */
hr = IMXWriter_put_encoding(writer, _bstr_("utf-8"));
EXPECT_HR(hr, S_OK);
str = (void*)0xdeadbeef;
@@ -5639,7 +5639,7 @@ static void test_mxattr_localname(void)
hr = ISAXAttributes_getIndexFromName(saxattr, NULL, 0, NULL, 0, &index);
EXPECT_HR(hr, E_INVALIDARG);
- /* add some ambiguos attribute names */
+ /* add some ambiguous attribute names */
hr = IMXAttributes_addAttribute(mxattr, _bstr_("uri"), _bstr_("localname"),
_bstr_("a:localname"), _bstr_(""), _bstr_("value"));
EXPECT_HR(hr, S_OK);
--
2.20.1
Dec. 12, 2019
[PATCH] oleaut32: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/oleaut32/dispatch.c | 2 +-
dlls/oleaut32/tests/vartype.c | 2 +-
dlls/oleaut32/typelib.c | 2 +-
dlls/oleaut32/typelib.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/oleaut32/dispatch.c b/dlls/oleaut32/dispatch.c
index 7e6398a1621..39d6fddee51 100644
--- a/dlls/oleaut32/dispatch.c
+++ b/dlls/oleaut32/dispatch.c
@@ -176,7 +176,7 @@ done:
* (linked at run-time), as opposed to early-bound (linked at compile time).
*
* The interface is used by objects that wish to called by scripting
- * languages such as VBA, in order to minimise the amount of COM and C/C++
+ * languages such as VBA, in order to minimize the amount of COM and C/C++
* knowledge required, or by objects that wish to live out of process from code
* that will call their methods.
*
diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c
index 7daf2f032ce..8a498defbc0 100644
--- a/dlls/oleaut32/tests/vartype.c
+++ b/dlls/oleaut32/tests/vartype.c
@@ -5934,7 +5934,7 @@ static void test_bstr_cache(void)
str = SysAllocStringLen(NULL, 24);
ok(str == strs[0], "str != strs[0]\n");
- /* Smaller buffers may also use larget cached buffers */
+ /* Smaller buffers may also use larger cached buffers */
str2 = SysAllocStringLen(NULL, 16);
ok(str2 == strs[1], "str2 != strs[1]\n");
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 528fe6372c1..451753e23b1 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -4202,7 +4202,7 @@ static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI,
letter of the name, else the next WORD is an offset to
the arg type and paramName points to the first letter.
So let's take one char off paramName and see if we're
- pointing at an alpha-numeric char. However if *pArg is
+ pointing at an alphanumeric char. However if *pArg is
0xffff or 0xfffe then the param has no name, the former
meaning that the next WORD is the type, the latter
meaning that the next WORD is an offset to the type. */
diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h
index 71e8d080c44..9c700b11a76 100644
--- a/dlls/oleaut32/typelib.h
+++ b/dlls/oleaut32/typelib.h
@@ -325,7 +325,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
Dec. 12, 2019
[PATCH] ntdll: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/ntdll/file.c | 2 +-
dlls/ntdll/sync.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index a65703d6f9e..26acc066cd7 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -3281,7 +3281,7 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
* restart [I] restart EA scan
*
* RETURNS
- * Success: 0. Atrributes read into buffer
+ * Success: 0. Attributes read into buffer
* Failure: An NTSTATUS error code describing the error.
*/
NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length,
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index 35b89df52ed..0dc6fc33900 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -2143,8 +2143,8 @@ void WINAPI RtlReleaseSRWLockShared( RTL_SRWLOCK *lock )
* RtlTryAcquireSRWLockExclusive (NTDLL.@)
*
* NOTES
- * Similar to AcquireSRWLockExclusive recusive calls are not allowed
- * and will fail with return value FALSE.
+ * Similarly to AcquireSRWLockExclusive, recursive calls are not allowed
+ * and will fail with a FALSE return value.
*/
BOOLEAN WINAPI RtlTryAcquireSRWLockExclusive( RTL_SRWLOCK *lock )
{
--
2.20.1
Dec. 12, 2019
[PATCH] wininet: Fix the spelling of a comment.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/wininet/ftp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 5e21076953e..94491689df9 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -3928,7 +3928,7 @@ static DWORD FTP_SetResponseError(DWORD dwResponse)
dwCode = ERROR_INTERNET_CANNOT_CONNECT;
break;
- case 426: /* Connection closed, transer aborted. */
+ case 426: /* Connection closed, transfer aborted. */
dwCode = ERROR_INTERNET_CONNECTION_ABORTED;
break;
--
2.20.1
Dec. 12, 2019
[PATCH] usp10: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/usp10/bidi.c | 4 ++--
dlls/usp10/shape.c | 2 +-
dlls/usp10/usp10.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c
index 34ca955dcb1..e1d0a11697d 100644
--- a/dlls/usp10/bidi.c
+++ b/dlls/usp10/bidi.c
@@ -72,7 +72,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bidi);
Note:
The list of bidirectional character types here is not grouped the
- same way as the table 3-7, since the numberic values for the types
+ same way as the table 3-7, since the numeric values for the types
are chosen to keep the state and action tables compact.
------------------------------------------------------------------------*/
enum directions
@@ -1083,7 +1083,7 @@ search:
}
/*************************************************************
- * BIDI_DeterminLevels
+ * BIDI_DetermineLevels
*/
BOOL BIDI_DetermineLevels(
const WCHAR *lpString, /* [in] The string for which information is to be returned */
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index 86e80aacd5f..8d5d1265fa5 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -998,7 +998,7 @@ static inline BOOL left_join_causing(CHAR joining_type)
static inline BOOL word_break_causing(WCHAR chr)
{
- /* we are working within a string of characters already guareented to
+ /* we are working within a string of characters already guaranteed to
be within one script, Syriac, so we do not worry about any character
other than the space character outside of that range */
return (chr == 0 || chr == 0x20 );
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index f66e85cc485..dd6a8543566 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -3009,7 +3009,7 @@ HRESULT WINAPI ScriptXtoCP(int iX,
else /* (glyph_index >= cGlyphs) */
i = cChars;
- /* If not snaping in the reverse direction (such as Hebrew) Then 0
+ /* If not snapping in the reverse direction (such as Hebrew) Then 0
point flow to the next character */
if (direction < 0)
{
--
2.20.1
Dec. 12, 2019
[PATCH] ole32: Fix the spelling of a couple of comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/ole32/ifs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ole32/ifs.c b/dlls/ole32/ifs.c
index ea03e9b0a28..9c7cb0977f8 100644
--- a/dlls/ole32/ifs.c
+++ b/dlls/ole32/ifs.c
@@ -60,7 +60,7 @@ typedef struct {
/* this is the static object instance */
static _Malloc32 Malloc32 = {{&VT_IMalloc32}, 0, NULL, 0, 0, NULL, 0};
-/* with a spy active all calls from pre to post methods are threadsave */
+/* with a spy active all calls from pre to post methods are threadsafe */
static CRITICAL_SECTION IMalloc32_SpyCS;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
@@ -285,8 +285,8 @@ static void WINAPI IMalloc_fnFree(IMalloc *iface, void *pv)
*
* NOTES
* FIXME returns:
- * win95: size allocated (4 byte boundarys)
- * win2k: size originally requested !!! (allocated on 8 byte boundarys)
+ * win95: size allocated (4 byte boundaries)
+ * win2k: size originally requested !!! (allocated on 8 byte boundaries)
*/
static SIZE_T WINAPI IMalloc_fnGetSize(IMalloc *iface, void *pv)
{
--
2.20.1
Dec. 12, 2019
[PATCH] wineps.drv: Avoid unneeded abbreviations in comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/wineps.drv/ppd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wineps.drv/ppd.c b/dlls/wineps.drv/ppd.c
index aa013940fe7..662dbe6db7e 100644
--- a/dlls/wineps.drv/ppd.c
+++ b/dlls/wineps.drv/ppd.c
@@ -283,7 +283,7 @@ static BOOL get_line( char *buf, int size, struct map_context *ctx )
*
* PSDRV_PPDGetInvocationValue
*
- * Passed string that should be surrounded by `"'s, return string alloced
+ * Passed string that should be surrounded by `"'s, return string allocated
* from process heap.
*/
static BOOL PSDRV_PPDGetInvocationValue(struct map_context *ctx, PPDTuple *tuple)
@@ -318,7 +318,7 @@ static BOOL PSDRV_PPDGetInvocationValue(struct map_context *ctx, PPDTuple *tuple
* PSDRV_PPDGetQuotedValue
*
* Passed string that should be surrounded by `"'s. Expand <xx> as hex
- * return string alloced from process heap.
+ * return string allocated from process heap.
*/
static BOOL PSDRV_PPDGetQuotedValue(struct map_context *ctx, PPDTuple *tuple)
{
@@ -517,7 +517,7 @@ static DUPLEX *get_duplex( PPD *ppd, const char *name )
*
* PSDRV_PPDGetWord
*
- * Returns ptr alloced from heap to first word in str. Strips leading spaces.
+ * Returns ptr allocated from heap to first word in str. Strips leading spaces.
* Puts ptr to next word in next
*/
static char *PSDRV_PPDGetWord(char *str, char **next)
--
2.20.1
Dec. 12, 2019
[PATCH] include: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
include/objbase.h | 2 +-
include/winbase.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/objbase.h b/include/objbase.h
index 78ec6d366db..75280d6de70 100644
--- a/include/objbase.h
+++ b/include/objbase.h
@@ -146,7 +146,7 @@
* - Each method is declared as a pointer to function field in the jump table. The implementation
* will fill this jump table with appropriate values, probably using a static variable, and
* initialize the lpVtbl field to point to this variable.
- * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
+ * - The IDirect3D_Xxx macros then just dereference the lpVtbl pointer and use the function pointer
* corresponding to the macro name. This emulates the behavior of a virtual table and should be
* just as fast.
* - This C code should be quite compatible with the Windows headers both for code that uses COM
diff --git a/include/winbase.h b/include/winbase.h
index 7b7f9f26bd2..2781229fa1e 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -1288,7 +1288,7 @@ typedef struct COPYFILE2_EXTENDED_PARAMETERS
#define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF (0x00000040)
#define ACTCTX_FLAG_HMODULE_VALID (0x00000080)
-/* flags to DeactiveActCtx */
+/* flags to DeactivateActCtx */
#define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x00000001)
/* flags to FindActCtxSection{Guid,String[AW]} */
--
2.20.1
Dec. 12, 2019
[PATCH] wined3d: Fix the spelling of some comments.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)free.fr>
---
dlls/wined3d/arb_program_shader.c | 2 +-
dlls/wined3d/context.c | 2 +-
dlls/wined3d/vertexdeclaration.c | 2 +-
dlls/wined3d/wined3d_private.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 34c3f061a94..9d98c79ce51 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -1472,7 +1472,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
if(ins->dst[0].modifiers & WINED3DSPDM_SATURATE) mod = "_SAT";
else mod = "";
- /* Fragment samplers always have indentity mapping */
+ /* Fragment samplers always have identity mapping */
if(sampler_idx >= WINED3D_MAX_FRAGMENT_SAMPLERS)
{
sampler_idx = priv->cur_vs_args->vertex.samplers[sampler_idx - WINED3D_MAX_FRAGMENT_SAMPLERS];
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index c5d2eeaa477..95769014af6 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -4487,7 +4487,7 @@ static void wined3d_context_gl_draw_primitive_arrays(struct wined3d_context_gl *
* this for now.
*
* Shouldn't be too hard to support with OpenGL, in theory just call
- * glDrawArrays() instead of drawElements(). But the stream fequency value
+ * glDrawArrays() instead of drawElements(). But the stream frequency value
* has a different meaning in that situation. */
if (!idx_size)
{
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 81032745a06..c5df45541e4 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -216,7 +216,7 @@ static HRESULT vertexdeclaration_init(struct wined3d_vertex_declaration *declara
declaration->position_transformed = TRUE;
/* Find the streams used in the declaration. The vertex buffers have
- * to be loaded when drawing, but filter tesselation pseudo streams. */
+ * to be loaded when drawing, but filter tessellation pseudo streams. */
if (e->input_slot >= WINED3D_MAX_STREAMS)
continue;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 60ddf74a0ec..b73d5c7fecf 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3132,7 +3132,7 @@ struct wined3d_state
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[WINED3D_MAX_STREAM_OUTPUT_BUFFERS];
- struct wined3d_stream_state streams[WINED3D_MAX_STREAMS + 1 /* tesselated pseudo-stream */];
+ struct wined3d_stream_state streams[WINED3D_MAX_STREAMS + 1 /* tessellated pseudo-stream */];
struct wined3d_buffer *index_buffer;
enum wined3d_format_id index_format;
unsigned int index_offset;
--
2.20.1
Dec. 12, 2019
Re: [PATCH v2 2/4] ntdll: Support creating processes with specified parent.
by Paul Gofman
On 12/12/19 11:35, Alexandre Julliard wrote:
> Paul Gofman <gofmanp(a)gmail.com> writes:
>
>> @@ -1667,8 +1667,14 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
>>
>> RtlNormalizeProcessParams( params );
>>
>> - TRACE( "%s image %s cmdline %s\n", debugstr_us( path ),
>> - debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ));
>> + TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ),
>> + debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ), parent);
>> +
>> + if (parent == INVALID_HANDLE_VALUE)
>> + {
>> + memset(info, 0, sizeof(*info));
>> + return STATUS_INVALID_HANDLE;
>> + }
> You are still using INVALID_HANDLE_VALUE here, I don't think that makes
> sense. The check for an invalid handle should use a truly invalid value
> like 0xdeadbeef.
>
> It may be interesting to test what happens with GetCurrentProcess(), and
> also some other handle pointing to the current process, but that should
> be separate from the generic invalid handle test.
>
   The check for invalid handle here is not for something explicitly
assigned in kernelbase, CreateProcessInternalW() in my v2 patch doesn't
encode any error conditions in INVALID_HANDLE_VALUE anymore. The truly
invalid handles (like 0xdeadbeef) get error from server call. The same
is for the other pseudo handles like that for current thread as they
have wrong type. Unlike INVALID_HANDLE_VALUE which is taken as current
process there. I have a test with 0xdeadbeef in the next patch which
returns an error on process creation on all Windows versions as well as
with these patches without any explicit checks before server call. There
are also tests with INVALID_HANDLE_VALUE and GetCurrentProcess() present
in the next patch which fail to create the process on Vista, w7 and w10
(and creates a process on w7u / w8), so I added the explicit check to
satisfy the "mainstream" behaviour. Now I briefly checked what happens
if I set a duplicated GetCurrentProcess() handle or handle from
OpenProcess(..., GetCurrentProcessId()) for parent handle, and the
process creation succeeds with that valid non-pseudo handle for the
current process. Should I add this test?
   So should I maybe move this check for 0xffffffff handle to
CreateProcessInternalW(), where it checks for 0 handle already?
Dec. 12, 2019
Re: [PATCH v2 2/4] ntdll: Support creating processes with specified parent.
by Alexandre Julliard
Paul Gofman <gofmanp(a)gmail.com> writes:
> @@ -1667,8 +1667,14 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
>
> RtlNormalizeProcessParams( params );
>
> - TRACE( "%s image %s cmdline %s\n", debugstr_us( path ),
> - debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ));
> + TRACE( "%s image %s cmdline %s, parent %p.\n", debugstr_us( path ),
> + debugstr_us( ¶ms->ImagePathName ), debugstr_us( ¶ms->CommandLine ), parent);
> +
> + if (parent == INVALID_HANDLE_VALUE)
> + {
> + memset(info, 0, sizeof(*info));
> + return STATUS_INVALID_HANDLE;
> + }
You are still using INVALID_HANDLE_VALUE here, I don't think that makes
sense. The check for an invalid handle should use a truly invalid value
like 0xdeadbeef.
It may be interesting to test what happens with GetCurrentProcess(), and
also some other handle pointing to the current process, but that should
be separate from the generic invalid handle test.
--
Alexandre Julliard
julliard(a)winehq.org
Dec. 12, 2019
[PATCH] ucrtbase: Use given context in wcstok.
by Daniel Lehman
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
breaking change in 2015 for wcstok:
https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-change-history-2003…
compilation will fail if only 2 arguments are provided:
1>: error C4996: 'wcstok': wcstok has been changed to conform with the ISO C standard, adding an extra context parameter. To use the legacy Microsoft wcstok, define _CRT_NON_CONFORMING_WCSTOK.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_wstring.h(261): message : see declaration of 'wcstok'
---
dlls/msvcrt/wcs.c | 9 +++++++++
dlls/ucrtbase/tests/string.c | 30 ++++++++++++++++++++++++++++++
dlls/ucrtbase/ucrtbase.spec | 2 +-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 1ae292423c0..a7bfb4ba2db 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -1707,10 +1707,19 @@ MSVCRT_wchar_t * CDECL MSVCRT_wcstok_s( MSVCRT_wchar_t *str, const MSVCRT_wchar_
/*********************************************************************
* wcstok (MSVCRT.@)
*/
+#if _MSVCR_VER>=140
+MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim, MSVCRT_wchar_t **ctx )
+{
+ if (!ctx)
+ ctx = &msvcrt_get_thread_data()->wcstok_next;
+ return MSVCRT_wcstok_s(str, delim, ctx);
+}
+#else
MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim )
{
return MSVCRT_wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next);
}
+#endif
/*********************************************************************
* _wctomb_s_l (MSVCRT.@)
diff --git a/dlls/ucrtbase/tests/string.c b/dlls/ucrtbase/tests/string.c
index bfa602c5387..5ef638e44ac 100644
--- a/dlls/ucrtbase/tests/string.c
+++ b/dlls/ucrtbase/tests/string.c
@@ -83,6 +83,7 @@ static void (__cdecl *p__free_locale)(_locale_t);
static int (__cdecl *p__getmbcp)(void);
static int (__cdecl *p__setmbcp)(int);
static size_t (__cdecl *p__mbsspn)(const unsigned char*, const unsigned char*);
+static wchar_t* (__cdecl *p_wcstok)(wchar_t*, const wchar_t*, wchar_t**);
static BOOL init(void)
{
@@ -110,6 +111,7 @@ static BOOL init(void)
p__getmbcp = (void*)GetProcAddress(module, "_getmbcp");
p__setmbcp = (void*)GetProcAddress(module, "_setmbcp");
p__mbsspn = (void*)GetProcAddress(module, "_mbsspn");
+ p_wcstok = (void*)GetProcAddress(module, "wcstok");
return TRUE;
}
@@ -390,6 +392,33 @@ static void test_mbsspn( void)
p__setmbcp(cp);
}
+static void test_wcstok(void)
+{
+ static const wchar_t *input = L"two words";
+ wchar_t buffer[16];
+ wchar_t *token;
+ wchar_t *next;
+
+ next = NULL;
+ wcscpy(buffer, input);
+ token = p_wcstok(buffer, L" ", &next);
+ ok(!wcscmp(L"two", token), "expected \"two\", got \"%ls\"\n", token);
+ ok(next == token + 4, "expected %p, got %p\n", token + 4, next);
+ token = p_wcstok(NULL, L" ", &next);
+ ok(!wcscmp(L"words", token), "expected \"words\", got \"%ls\"\n", token);
+ ok(next == token + 5, "expected %p, got %p\n", token + 5, next);
+ token = p_wcstok(NULL, L" ", &next);
+ ok(!token, "expected NULL, got %p\n", token);
+
+ wcscpy(buffer, input);
+ token = p_wcstok(buffer, L" ", NULL);
+ ok(!wcscmp(L"two", token), "expected \"two\", got \"%ls\"\n", token);
+ token = p_wcstok(NULL, L" ", NULL);
+ ok(!wcscmp(L"words", token), "expected \"words\", got \"%ls\"\n", token);
+ token = p_wcstok(NULL, L" ", NULL);
+ ok(!token, "expected NULL, got %p\n", token);
+}
+
START_TEST(string)
{
if (!init()) return;
@@ -399,4 +428,5 @@ START_TEST(string)
test___strncnt();
test_C_locale();
test_mbsspn();
+ test_wcstok();
}
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index a262cc63459..64102f59cd4 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2579,7 +2579,7 @@
@ cdecl wcstod(wstr ptr) MSVCRT_wcstod
@ cdecl wcstof(ptr ptr) MSVCRT_wcstof
@ stub wcstoimax
-@ cdecl wcstok(wstr wstr) MSVCRT_wcstok
+@ cdecl wcstok(wstr wstr ptr) MSVCRT_wcstok
@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s
@ cdecl wcstol(wstr ptr long) MSVCRT_wcstol
@ stub wcstold
--
2.17.1
Dec. 12, 2019
[PATCH] wine.inf: add powershell location to the path
by Louis Lenders
On win7 the location of powershell is present in the path (could not check on other versions)
---
loader/wine.inf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index d324461c6e..d62fd5065b 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -624,7 +624,7 @@ HKLM,%Control%\Session Manager,HeapDeCommitTotalFreeThreshold,0x00040002,0
HKLM,%Control%\Session Manager,HeapSegmentCommit,0x00040002,0
HKLM,%Control%\Session Manager,HeapSegmentReserve,0x00040002,0
HKLM,%Control%\Session Manager\Environment,"ComSpec",0x00020000,"%11%\cmd.exe"
-HKLM,%Control%\Session Manager\Environment,"PATH",0x00020002,"%11%;%10%;%11%\wbem"
+HKLM,%Control%\Session Manager\Environment,"PATH",0x00020002,"%11%;%10%;%11%\wbem;%11%\WindowsPowershell\v1.0"
HKLM,%Control%\Session Manager\Environment,"PATHEXT",,".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"
HKLM,%Control%\Session Manager\Environment,"SystemDrive",2,"c:"
HKLM,%Control%\Session Manager\Environment,"SYSTEMROOT",,"%10%"
--
2.24.0
Dec. 12, 2019
[PATCH] include: Add cdosys.idl
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
include/Makefile.in | 1 +
include/cdosys.idl | 243 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 244 insertions(+)
create mode 100644 include/cdosys.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index 2e9a921df7..7f73ee9010 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -51,6 +51,7 @@ SOURCES = \
bluetoothapis.h \
bthsdpdef.h \
cderr.h \
+ cdosys.idl \
cfgmgr32.h \
cguid.h \
chprst.idl \
diff --git a/include/cdosys.idl b/include/cdosys.idl
new file mode 100644
index 0000000000..8aee555058
--- /dev/null
+++ b/include/cdosys.idl
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2019 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+import "unknwn.idl";
+import "objidl.idl";
+import "oaidl.idl";
+
+#if !defined(progid) && !defined(__WIDL__)
+#define threading(model)
+#define progid(str)
+#define vi_progid(str)
+#endif
+
+[
+ uuid(cd000000-8b95-11d1-82db-00c04fb1625d),
+ version(1.0)
+]
+library CDO
+{
+ importlib("stdole2.tlb");
+
+ interface _Stream;
+ interface IBodyPart;
+ interface IBodyParts;
+ interface IConfiguration;
+ interface IDataSource;
+ interface Fields;
+
+ typedef enum
+ {
+ cdoDSNDefault = 0,
+ cdoDSNNever = 1,
+ cdoDSNFailure = 2,
+ cdoDSNSuccess = 4,
+ cdoDSNDelay = 8,
+ cdoDSNSuccessFailOrDelay = 14
+ } CdoDSNOptions;
+
+ typedef enum
+ {
+ cdoRefTypeId = 0,
+ cdoRefTypeLocation = 1
+ } CdoReferenceType;
+
+ typedef enum
+ {
+ cdoSuppressNone = 0,
+ cdoSuppressImages = 1,
+ cdoSuppressBGSounds = 2,
+ cdoSuppressFrames = 4,
+ cdoSuppressObjects = 8,
+ cdoSuppressStyleSheets = 16,
+ cdoSuppressAll = 31
+ } CdoMHTMLFlags;
+
+ [
+ odl,
+ uuid(cd000020-8b95-11d1-82db-00c04fb1625d),
+ dual,
+ nonextensible,
+ oleautomation
+ ]
+ interface IMessage : IDispatch
+ {
+ [id(0x00000065), propget]
+ HRESULT BCC([out, retval] BSTR *bcc);
+ [id(0x00000065), propput]
+ HRESULT BCC([in] BSTR bcc);
+
+ [id(0x00000067), propget]
+ HRESULT CC([out, retval] BSTR *cc);
+ [id(0x00000067), propput]
+ HRESULT CC([in] BSTR cc);
+
+ [id(0x00000069), propget]
+ HRESULT FollowUpTo([out, retval] BSTR *follow);
+ [id(0x00000069), propput]
+ HRESULT FollowUpTo([in] BSTR follow);
+
+ [id(0x0000006a), propget]
+ HRESULT From([out, retval] BSTR *from);
+ [id(0x0000006a), propput]
+ HRESULT From([in] BSTR from);
+
+ [id(0x0000006b), propget]
+ HRESULT Keywords([out, retval] BSTR* keywords);
+ [id(0x0000006b), propput]
+ HRESULT Keywords([in] BSTR keywords);
+
+ [id(0x0000006e), propget]
+ HRESULT MimeFormatted([out, retval] VARIANT_BOOL *formatted);
+ [id(0x0000006e), propput]
+ HRESULT MimeFormatted([in] VARIANT_BOOL formatted);
+
+ [id(0x0000006f), propget]
+ HRESULT Newsgroups([out, retval] BSTR *newsgroups);
+ [id(0x0000006f), propput]
+ HRESULT Newsgroups([in] BSTR newsgroups);
+ [id(0x00000070), propget]
+
+ HRESULT Organization([out, retval] BSTR *organization);
+ [id(0x00000070), propput]
+ HRESULT Organization([in] BSTR organization);
+
+ [id(0x00000072), propget]
+ HRESULT ReceivedTime([out, retval] DATE *received);
+
+ [id(0x00000073), propget]
+ HRESULT ReplyTo([out, retval] BSTR *reply);
+ [id(0x00000073), propput]
+ HRESULT ReplyTo([in] BSTR reply);
+
+ [id(0x00000074), propget]
+ HRESULT DSNOptions([out, retval] CdoDSNOptions *options);
+ [id(0x00000074), propput]
+ HRESULT DSNOptions([in] CdoDSNOptions options);
+
+ [id(0x00000077), propget]
+ HRESULT SentOn([out, retval] DATE *sent);
+
+ [id(0x00000078), propget]
+ HRESULT Subject([out, retval] BSTR *subject);
+ [id(0x00000078), propput]
+ HRESULT Subject([in] BSTR subject);
+
+ [id(0x00000079), propget]
+ HRESULT To([out, retval] BSTR *to);
+ [id(0x00000079), propput]
+ HRESULT To([in] BSTR to);
+
+ [id(0x0000007b), propget]
+ HRESULT TextBody([out, retval] BSTR *body);
+ [id(0x0000007b), propput]
+ HRESULT TextBody([in] BSTR body);
+
+ [id(0x0000007c)]
+ HRESULT HTMLBody([out, retval] BSTR* body);
+ [id(0x0000007c), propput]
+ HRESULT HTMLBody([in] BSTR body);
+
+ [id(0x0000007d), propget]
+ HRESULT Attachments([out, retval] IBodyParts **attachments);
+
+ [id(0x0000007e), propget]
+ HRESULT Sender([out, retval] BSTR *sender);
+ [id(0x0000007e), propput]
+ HRESULT Sender([in] BSTR sender);
+
+ [id(0x0000007f), propget]
+ HRESULT Configuration([out, retval] IConfiguration **config);
+ [id(0x0000007f), propput]
+ HRESULT Configuration([in] IConfiguration *config);
+ [id(0x0000007f), propputref]
+ HRESULT Configuration([in] IConfiguration *config);
+
+ [id(0x00000080), propget]
+ HRESULT AutoGenerateTextBody([out, retval] VARIANT_BOOL *body);
+ [id(0x00000080), propput]
+ HRESULT AutoGenerateTextBody([in] VARIANT_BOOL body);
+
+ [id(0x00000081), propget]
+ HRESULT EnvelopeFields([out, retval] Fields **fields);
+
+ [id(0x00000082), propget]
+ HRESULT TextBodyPart([out, retval] IBodyPart **body);
+ [id(0x00000083), propget]
+ HRESULT HTMLBodyPart([out, retval] IBodyPart **body);
+
+ [id(0x00000084), propget]
+ HRESULT BodyPart([out, retval] IBodyPart ** part);
+
+ [id(0x00000085), propget]
+ HRESULT DataSource([out, retval] IDataSource **datasource);
+
+ [id(0x00000086), propget]
+ HRESULT Fields([out, retval] Fields **fields);
+
+ [id(0x00000087), propget]
+ HRESULT MDNRequested([out, retval] VARIANT_BOOL* requested);
+ [id(0x00000087), propput]
+ HRESULT MDNRequested([in] VARIANT_BOOL requested);
+
+ [id(0x00000096)]
+ HRESULT AddRelatedBodyPart([in] BSTR url, [in] BSTR Reference, [in] CdoReferenceType ReferenceType,
+ [in, optional] BSTR username, [in, optional] BSTR password, [out, retval] IBodyPart **body);
+ [id(0x00000097)]
+ HRESULT AddAttachment([in] BSTR url, [in, optional] BSTR username,
+ [in, optional] BSTR password, [out, retval] IBodyPart **body);
+
+ [id(0x00000098)]
+ HRESULT CreateMHTMLBody([in] BSTR url, [in, optional, defaultvalue(0)] CdoMHTMLFlags flags,
+ [in, optional] BSTR username, [in, optional] BSTR password);
+
+ [id(0x00000099)]
+ HRESULT Forward([out, retval] IMessage **msg);
+
+ [id(0x0000009a)]
+ HRESULT Post();
+
+ [id(0x0000009b)]
+ HRESULT PostReply([out, retval] IMessage **msg);
+
+ [id(0x0000009c)]
+ HRESULT Reply([out, retval] IMessage **msg);
+
+ [id(0x0000009d)]
+ HRESULT ReplyAll([out, retval] IMessage **msg);
+
+ [id(0x0000009e)]
+ HRESULT Send();
+
+ [id(0x0000009f)]
+ HRESULT GetStream([out, retval] _Stream **stream);
+
+ [id(0x000000a0)]
+ HRESULT GetInterface([in] BSTR name, [out, retval] IDispatch **unknown);
+ };
+
+ [
+ uuid(cd000001-8b95-11d1-82db-00c04fb1625d)
+ ]
+ coclass Message
+ {
+ [default] interface IMessage;
+ interface IDataSource;
+ interface IBodyPart;
+ };
+}
+
--
2.17.1
Dec. 12, 2019
[PATCH vkd3d v2 5/5] vkd3d: Add cubic null resource.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index cd181bc..62e8c44 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2589,33 +2589,51 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
case D3D12_SRV_DIMENSION_TEXTURE1D:
vk_image = null_resources->vk_1d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE1DARRAY:
vk_image = null_resources->vk_1d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DARRAY:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DMS:
vk_image = null_resources->vk_2dms_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY:
vk_image = null_resources->vk_2dms_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ vkd3d_desc.layer_count = 1;
break;
case D3D12_SRV_DIMENSION_TEXTURE3D:
vk_image = null_resources->vk_3d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ vkd3d_desc.layer_count = 1;
+ break;
+
+ case D3D12_SRV_DIMENSION_TEXTURECUBE:
+ vk_image = null_resources->vk_2d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_CUBE;
+ vkd3d_desc.layer_count = 6;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY:
+ vk_image = null_resources->vk_2d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY;
+ vkd3d_desc.layer_count = 6;
break;
default:
@@ -2629,7 +2647,6 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.miplevel_idx = 0;
vkd3d_desc.miplevel_count = 1;
vkd3d_desc.layer_idx = 0;
- vkd3d_desc.layer_count = 1;
vkd3d_desc.components.r = VK_COMPONENT_SWIZZLE_ZERO;
vkd3d_desc.components.g = VK_COMPONENT_SWIZZLE_ZERO;
vkd3d_desc.components.b = VK_COMPONENT_SWIZZLE_ZERO;
@@ -4134,7 +4151,7 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
goto fail;
/* 2D SRV */
- if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 6, false,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 4/5] vkd3d: Add 3D null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 36 ++++++++++++++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 6 ++++++
2 files changed, 42 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 3ca29a2..cd181bc 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2613,6 +2613,11 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_SRV_DIMENSION_TEXTURE3D:
+ vk_image = null_resources->vk_3d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -2829,6 +2834,11 @@ static void vkd3d_create_null_uav(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_UAV_DIMENSION_TEXTURE3D:
+ vk_image = null_resources->vk_3d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_3D;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -3950,6 +3960,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2dms_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+ /* transition 3D SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_3d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
WARN("Failed to end command buffer, vr %d.\n", vr);
@@ -4134,6 +4148,16 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
goto fail;
+ /* 3D SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE3D, 1, false,
+ &null_resources->vk_3d_image, &null_resources->vk_3d_image_memory)))
+ goto fail;
+
+ /* 3D UAV */
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE3D,
+ &null_resources->vk_3d_storage_image, &null_resources->vk_3d_storage_image_memory)))
+ goto fail;
+
/* set Vulkan object names */
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_buffer,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "NULL buffer");
@@ -4157,6 +4181,12 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2DMS SRV memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_storage_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D UAV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 3D SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 3D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_3d_storage_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 3D UAV image");
if (!use_sparse_resources)
{
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_storage_buffer_memory,
@@ -4199,5 +4229,11 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_storage_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_storage_image_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_3d_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_3d_image_memory, NULL));
+
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_3d_storage_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_3d_storage_image_memory, NULL));
+
memset(null_resources, 0, sizeof(*null_resources));
}
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 58a9ce0..5b44a49 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1071,6 +1071,12 @@ struct vkd3d_null_resources
VkImage vk_2dms_image;
VkDeviceMemory vk_2dms_image_memory;
+
+ VkImage vk_3d_image;
+ VkDeviceMemory vk_3d_image_memory;
+
+ VkImage vk_3d_storage_image;
+ VkDeviceMemory vk_3d_storage_image_memory;
};
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 3/5] vkd3d: Add 2D multisampled null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 25 +++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 3 +++
2 files changed, 28 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index 271b881..3ca29a2 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2604,6 +2604,15 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
break;
+ case D3D12_SRV_DIMENSION_TEXTURE2DMS:
+ vk_image = null_resources->vk_2dms_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY:
+ vk_image = null_resources->vk_2dms_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D_ARRAY;
+ break;
+
default:
FIXME("Unhandled view dimension %#x.\n", desc->ViewDimension);
return;
@@ -3937,6 +3946,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+ /* transition 2DMS SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2dms_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
WARN("Failed to end command buffer, vr %d.\n", vr);
@@ -4111,6 +4124,11 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
+ /* 2DMS SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, true,
+ &null_resources->vk_2dms_image, &null_resources->vk_2dms_image_memory)))
+ goto fail;
+
/* 2D UAV */
if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
&null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
@@ -4133,6 +4151,10 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D SRV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image_memory,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2dms_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2DMS SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2dms_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 2DMS SRV memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_storage_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D UAV image");
if (!use_sparse_resources)
@@ -4171,6 +4193,9 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_image_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2dms_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2dms_image_memory, NULL));
+
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_storage_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_storage_image_memory, NULL));
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index c23667d..58a9ce0 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1068,6 +1068,9 @@ struct vkd3d_null_resources
VkImage vk_2d_storage_image;
VkDeviceMemory vk_2d_storage_image_memory;
+
+ VkImage vk_2dms_image;
+ VkDeviceMemory vk_2dms_image_memory;
};
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 2/5] vkd3d: Add 1D null resources.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/resource.c | 51 ++++++++++++++++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 6 +++++
2 files changed, 57 insertions(+)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index ab4df8e..271b881 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -2586,6 +2586,15 @@ static void vkd3d_create_null_srv(struct d3d12_desc *descriptor,
}
return;
+ case D3D12_SRV_DIMENSION_TEXTURE1D:
+ vk_image = null_resources->vk_1d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ break;
+ case D3D12_SRV_DIMENSION_TEXTURE1DARRAY:
+ vk_image = null_resources->vk_1d_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ break;
+
case D3D12_SRV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
@@ -2793,6 +2802,15 @@ static void vkd3d_create_null_uav(struct d3d12_desc *descriptor,
}
return;
+ case D3D12_UAV_DIMENSION_TEXTURE1D:
+ vk_image = null_resources->vk_1d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D;
+ break;
+ case D3D12_UAV_DIMENSION_TEXTURE1DARRAY:
+ vk_image = null_resources->vk_1d_storage_image;
+ vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
+ break;
+
case D3D12_UAV_DIMENSION_TEXTURE2D:
vk_image = null_resources->vk_2d_storage_image;
vkd3d_desc.view_type = VK_IMAGE_VIEW_TYPE_2D;
@@ -3890,6 +3908,10 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
if (use_sparse_resources)
{
+ /* transition 1D UAV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_1d_storage_image,
+ VK_IMAGE_LAYOUT_GENERAL, vk_procs);
+
/* transition 2D UAV image */
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_storage_image,
VK_IMAGE_LAYOUT_GENERAL, vk_procs);
@@ -3900,10 +3922,17 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
VK_CALL(vkCmdFillBuffer(vk_command_buffer,
null_resource->vk_storage_buffer, 0, VK_WHOLE_SIZE, 0x00000000));
+ /* clear 1D UAV image */
+ vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_1d_storage_image, vk_procs);
+
/* clear 2D UAV image */
vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_2d_storage_image, vk_procs);
}
+ /* transition 1D SRV image */
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_1d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
+
/* transition 2D SRV image */
vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
@@ -4067,6 +4096,16 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
&heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_storage_buffer_memory, NULL, NULL)))
goto fail;
+ /* 1D SRV */
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE1D, 1, false,
+ &null_resources->vk_1d_image, &null_resources->vk_1d_image_memory)))
+ goto fail;
+
+ /* 1D UAV */
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE1D,
+ &null_resources->vk_1d_storage_image, &null_resources->vk_1d_storage_image_memory)))
+ goto fail;
+
/* 2D SRV */
if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
&null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
@@ -4084,6 +4123,12 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL memory");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_storage_buffer,
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, "NULL UAV buffer");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 1D SRV image");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_image_memory,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, "NULL 1D SRV memory");
+ vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_1d_storage_image,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 1D UAV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image,
VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, "NULL 2D SRV image");
vkd3d_set_vk_object_name_utf8(device, (uint64_t)null_resources->vk_2d_image_memory,
@@ -4117,6 +4162,12 @@ void vkd3d_destroy_null_resources(struct vkd3d_null_resources *null_resources,
VK_CALL(vkDestroyBuffer(device->vk_device, null_resources->vk_storage_buffer, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_storage_buffer_memory, NULL));
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_1d_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_1d_image_memory, NULL));
+
+ VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_1d_storage_image, NULL));
+ VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_1d_storage_image_memory, NULL));
+
VK_CALL(vkDestroyImage(device->vk_device, null_resources->vk_2d_image, NULL));
VK_CALL(vkFreeMemory(device->vk_device, null_resources->vk_2d_image_memory, NULL));
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 0c031d2..c23667d 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1057,6 +1057,12 @@ struct vkd3d_null_resources
VkBuffer vk_storage_buffer;
VkDeviceMemory vk_storage_buffer_memory;
+ VkImage vk_1d_image;
+ VkDeviceMemory vk_1d_image_memory;
+
+ VkImage vk_1d_storage_image;
+ VkDeviceMemory vk_1d_storage_image_memory;
+
VkImage vk_2d_image;
VkDeviceMemory vk_2d_image_memory;
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 1/5] vkd3d: Use helper functions for null resource initialisation.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
v2: Don't use sparse binding for the 1D texture.
---
libs/vkd3d/resource.c | 240 ++++++++++++++++++++++++------------------
1 file changed, 139 insertions(+), 101 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index f40d986..ab4df8e 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -3770,12 +3770,72 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, const D3D12_QUERY_H
return S_OK;
}
+static void vkd3d_transition_null_image(VkCommandBuffer vk_command_buffer, VkImage vk_image,
+ VkImageLayout new_layout, const struct vkd3d_vk_device_procs *vk_procs)
+{
+ VkImageMemoryBarrier barrier;
+
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.pNext = NULL;
+ barrier.srcAccessMask = 0;
+ barrier.dstAccessMask = 0;
+ barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ barrier.newLayout = new_layout;
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = vk_image;
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+
+ VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
+ 0, NULL, 0, NULL, 1, &barrier));
+}
+
+static void vkd3d_clear_null_ua_image(VkCommandBuffer vk_command_buffer, VkImage vk_image,
+ const struct vkd3d_vk_device_procs *vk_procs)
+{
+ static const VkClearColorValue clear_color = {{0}};
+ VkImageSubresourceRange range;
+ VkImageMemoryBarrier barrier;
+
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.pNext = NULL;
+ barrier.srcAccessMask = 0;
+ barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
+ barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = vk_image;
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+
+ VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
+ 0, NULL, 0, NULL, 1, &barrier));
+
+ range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ range.baseMipLevel = 0;
+ range.levelCount = 1;
+ range.baseArrayLayer = 0;
+ range.layerCount = 1;
+
+ VK_CALL(vkCmdClearColorImage(vk_command_buffer, vk_image,
+ VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range));
+}
+
static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_resource,
struct d3d12_device *device)
{
const bool use_sparse_resources = device->vk_info.sparse_properties.residencyNonResidentStrict;
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
- static const VkClearColorValue clear_color = {{0}};
VkCommandBufferAllocateInfo command_buffer_info;
VkCommandPool vk_command_pool = VK_NULL_HANDLE;
VkCommandPoolCreateInfo command_pool_info;
@@ -3783,8 +3843,6 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
VkCommandBufferBeginInfo begin_info;
VkCommandBuffer vk_command_buffer;
VkFence vk_fence = VK_NULL_HANDLE;
- VkImageSubresourceRange range;
- VkImageMemoryBarrier barrier;
VkFenceCreateInfo fence_info;
struct vkd3d_queue *queue;
VkSubmitInfo submit_info;
@@ -3833,24 +3891,8 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
if (use_sparse_resources)
{
/* transition 2D UAV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = 0;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_storage_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_storage_image,
+ VK_IMAGE_LAYOUT_GENERAL, vk_procs);
}
else
{
@@ -3859,54 +3901,12 @@ static HRESULT vkd3d_init_null_resources_data(struct vkd3d_null_resources *null_
null_resource->vk_storage_buffer, 0, VK_WHOLE_SIZE, 0x00000000));
/* clear 2D UAV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_storage_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
-
- range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- range.baseMipLevel = 0;
- range.levelCount = 1;
- range.baseArrayLayer = 0;
- range.layerCount = 1;
-
- VK_CALL(vkCmdClearColorImage(vk_command_buffer,
- null_resource->vk_2d_storage_image, VK_IMAGE_LAYOUT_GENERAL, &clear_color, 1, &range));
+ vkd3d_clear_null_ua_image(vk_command_buffer, null_resource->vk_2d_storage_image, vk_procs);
}
/* transition 2D SRV image */
- barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
- barrier.pNext = NULL;
- barrier.srcAccessMask = 0;
- barrier.dstAccessMask = 0;
- barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
- barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- barrier.image = null_resource->vk_2d_image;
- barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- barrier.subresourceRange.baseMipLevel = 0;
- barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
- barrier.subresourceRange.baseArrayLayer = 0;
- barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
-
- VK_CALL(vkCmdPipelineBarrier(vk_command_buffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0,
- 0, NULL, 0, NULL, 1, &barrier));
+ vkd3d_transition_null_image(vk_command_buffer, null_resource->vk_2d_image,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, vk_procs);
if ((vr = VK_CALL(vkEndCommandBuffer(vk_command_buffer))) < 0)
{
@@ -3956,6 +3956,75 @@ done:
return hresult_from_vk_result(vr);
}
+static HRESULT vkd3d_create_null_sr_texture(struct d3d12_device *device, D3D12_RESOURCE_DIMENSION dimension,
+ unsigned int array_size, bool is_multisampled, VkImage *vk_image, VkDeviceMemory *vk_memory)
+{
+ D3D12_HEAP_PROPERTIES heap_properties;
+ D3D12_RESOURCE_DESC resource_desc;
+ HRESULT hr;
+
+ memset(&heap_properties, 0, sizeof(heap_properties));
+ heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
+
+ resource_desc.Dimension = dimension;
+ resource_desc.Alignment = 0;
+ resource_desc.Width = 1;
+ resource_desc.Height = 1;
+ resource_desc.DepthOrArraySize = array_size;
+ resource_desc.MipLevels = 1;
+ resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
+ resource_desc.SampleDesc.Count = is_multisampled ? 4 : 1;
+ resource_desc.SampleDesc.Quality = 0;
+ resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resource_desc.Flags = is_multisampled ? D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET : D3D12_RESOURCE_FLAG_NONE;
+
+ if (FAILED(hr = vkd3d_create_image(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, NULL, vk_image)))
+ return hr;
+ if (FAILED(hr = vkd3d_allocate_image_memory(device, *vk_image,
+ &heap_properties, D3D12_HEAP_FLAG_NONE, vk_memory, NULL, NULL)))
+ return hr;
+
+ return S_OK;
+}
+
+static HRESULT vkd3d_create_null_ua_texture(struct d3d12_device *device, D3D12_RESOURCE_DIMENSION dimension,
+ VkImage *vk_image, VkDeviceMemory *vk_memory)
+{
+ bool use_sparse_resources;
+ D3D12_HEAP_PROPERTIES heap_properties;
+ D3D12_RESOURCE_DESC resource_desc;
+ HRESULT hr;
+
+ use_sparse_resources = device->vk_info.sparse_properties.residencyNonResidentStrict
+ && dimension != D3D12_RESOURCE_DIMENSION_TEXTURE1D;
+
+ memset(&heap_properties, 0, sizeof(heap_properties));
+ heap_properties.Type = D3D12_HEAP_TYPE_DEFAULT;
+
+ resource_desc.Dimension = dimension;
+ resource_desc.Alignment = 0;
+ resource_desc.Width = 1;
+ resource_desc.Height = 1;
+ resource_desc.DepthOrArraySize = 1;
+ resource_desc.MipLevels = 1;
+ resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
+ resource_desc.SampleDesc.Count = 1;
+ resource_desc.SampleDesc.Quality = 0;
+ resource_desc.Layout = use_sparse_resources
+ ? D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE : D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
+
+ if (FAILED(hr = vkd3d_create_image(device, use_sparse_resources ? NULL : &heap_properties, D3D12_HEAP_FLAG_NONE,
+ &resource_desc, NULL, vk_image)))
+ return hr;
+ if (!use_sparse_resources && FAILED(hr = vkd3d_allocate_image_memory(device, *vk_image,
+ &heap_properties, D3D12_HEAP_FLAG_NONE, vk_memory, NULL, NULL)))
+ return hr;
+
+ return S_OK;
+}
+
HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
struct d3d12_device *device)
{
@@ -4002,44 +4068,13 @@ HRESULT vkd3d_init_null_resources(struct vkd3d_null_resources *null_resources,
goto fail;
/* 2D SRV */
- resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
- resource_desc.Alignment = 0;
- resource_desc.Width = 1;
- resource_desc.Height = 1;
- resource_desc.DepthOrArraySize = 1;
- resource_desc.MipLevels = 1;
- resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
- resource_desc.SampleDesc.Count = 1;
- resource_desc.SampleDesc.Quality = 0;
- resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
- resource_desc.Flags = D3D12_RESOURCE_FLAG_NONE;
-
- if (FAILED(hr = vkd3d_create_image(device, &heap_properties, D3D12_HEAP_FLAG_NONE,
- &resource_desc, NULL, &null_resources->vk_2d_image)))
- goto fail;
- if (FAILED(hr = vkd3d_allocate_image_memory(device, null_resources->vk_2d_image,
- &heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_2d_image_memory, NULL, NULL)))
+ if (FAILED(hr = vkd3d_create_null_sr_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D, 1, false,
+ &null_resources->vk_2d_image, &null_resources->vk_2d_image_memory)))
goto fail;
/* 2D UAV */
- resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
- resource_desc.Alignment = 0;
- resource_desc.Width = 1;
- resource_desc.Height = 1;
- resource_desc.DepthOrArraySize = 1;
- resource_desc.MipLevels = 1;
- resource_desc.Format = VKD3D_NULL_VIEW_FORMAT;
- resource_desc.SampleDesc.Count = 1;
- resource_desc.SampleDesc.Quality = 0;
- resource_desc.Layout = use_sparse_resources
- ? D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE : D3D12_TEXTURE_LAYOUT_UNKNOWN;
- resource_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
-
- if (FAILED(hr = vkd3d_create_image(device, use_sparse_resources ? NULL : &heap_properties, D3D12_HEAP_FLAG_NONE,
- &resource_desc, NULL, &null_resources->vk_2d_storage_image)))
- goto fail;
- if (!use_sparse_resources && FAILED(hr = vkd3d_allocate_image_memory(device, null_resources->vk_2d_storage_image,
- &heap_properties, D3D12_HEAP_FLAG_NONE, &null_resources->vk_2d_storage_image_memory, NULL, NULL)))
+ if (FAILED(hr = vkd3d_create_null_ua_texture(device, D3D12_RESOURCE_DIMENSION_TEXTURE2D,
+ &null_resources->vk_2d_storage_image, &null_resources->vk_2d_storage_image_memory)))
goto fail;
/* set Vulkan object names */
--
2.24.0
Dec. 12, 2019
[PATCH vkd3d v2 0/5] vkd3d: Add more null resources.
by Conor McCarthy
An attempt to create a null resource view of an unsupported type leaves
the descriptor uninitialised without having any means of indicating
that an error occurred. Hitman 2 uses all of these view types.
Conor McCarthy (5):
vkd3d: Use helper functions for null resource initialisation.
vkd3d: Add 1D null resources.
vkd3d: Add 2D multisampled null resources.
vkd3d: Add 3D null resources.
vkd3d: Add cubic null resource.
libs/vkd3d/resource.c | 363 +++++++++++++++++++++++++++----------
libs/vkd3d/vkd3d_private.h | 15 ++
2 files changed, 280 insertions(+), 98 deletions(-)
--
2.24.0
Dec. 12, 2019
Re: [PATCH 8/8] strmbase: Get rid of the "vtbl" parameter to strmbase_sink_init().
by Marvin
Hi,
While running your changed tests, 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=61993
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
error: patch failed: dlls/qcap/avico.c:272
error: patch failed: dlls/qcap/avimux.c:1500
error: patch failed: dlls/qedit/samplegrabber.c:473
error: patch failed: dlls/winegstreamer/gstdemux.c:1502
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
error: patch failed: dlls/qcap/avico.c:272
error: patch failed: dlls/qcap/avimux.c:1500
error: patch failed: dlls/qedit/samplegrabber.c:473
error: patch failed: dlls/winegstreamer/gstdemux.c:1502
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 7/8] wineqtdecoder: Use base sink streaming methods.
by Marvin
Hi,
While running your changed tests, 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=61992
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 6/8] winegstreamer: Use base sink streaming methods.
by Marvin
Hi,
While running your changed tests, 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=61991
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/winegstreamer/gstdemux.c:1967
Task: Patch failed to apply
Dec. 12, 2019
[PATCH 8/8] strmbase: Get rid of the "vtbl" parameter to strmbase_sink_init().
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/qcap/avico.c | 24 +-------
dlls/qcap/avimux.c | 23 +-------
dlls/qcap/smartteefilter.c | 23 +-------
dlls/qedit/samplegrabber.c | 24 +-------
dlls/strmbase/pin.c | 101 +++++++++++++++++++-------------
dlls/strmbase/renderer.c | 25 +-------
dlls/strmbase/transform.c | 27 +--------
dlls/winegstreamer/gstdemux.c | 34 ++---------
dlls/wineqtdecoder/qtsplitter.c | 25 +-------
include/wine/strmbase.h | 25 +-------
10 files changed, 73 insertions(+), 258 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index ecda162be86..53b8526f449 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -272,27 +272,6 @@ static const IPersistPropertyBagVtbl PersistPropertyBagVtbl = {
AVICompressorPropertyBag_Save
};
-static const IPinVtbl AVICompressorInputPinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
AVICompressor *This = impl_from_strmbase_pin(base);
@@ -517,8 +496,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
compressor->IPersistPropertyBag_iface.lpVtbl = &PersistPropertyBagVtbl;
- strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl,
- &compressor->filter, sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&compressor->sink, &compressor->filter, sink_name, &sink_ops, NULL);
strmbase_source_init(&compressor->source, &compressor->filter, source_name, &source_ops);
*phr = S_OK;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index c17d91322bf..e402479fb17 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1500,27 +1500,6 @@ static inline AviMux* impl_from_in_IPin(IPin *iface)
return impl_from_strmbase_filter(pin->filter);
}
-static const IPinVtbl AviMuxIn_PinVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BasePinImpl_NewSegment
-};
-
static inline AviMuxIn* AviMuxIn_from_IAMStreamControl(IAMStreamControl *iface)
{
return CONTAINING_RECORD(iface, AviMuxIn, IAMStreamControl_iface);
@@ -1825,7 +1804,7 @@ static HRESULT create_input_pin(AviMux *avimux)
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
- strmbase_sink_init(&object->pin, &AviMuxIn_PinVtbl, &avimux->filter, name, &sink_ops, NULL);
+ strmbase_sink_init(&object->pin, &avimux->filter, name, &sink_ops, NULL);
object->pin.IMemInputPin_iface.lpVtbl = &AviMuxIn_MemInputPinVtbl;
object->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl;
object->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl;
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index e1fcea55f91..5339cb5134f 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -81,27 +81,6 @@ static const struct strmbase_filter_ops filter_ops =
.filter_destroy = smart_tee_destroy,
};
-static const IPinVtbl SmartTeeFilterInputVtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
{
SmartTeeFilter *This = impl_from_strmbase_pin(base);
@@ -358,7 +337,7 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
memset(object, 0, sizeof(*object));
strmbase_filter_init(&object->filter, outer, &CLSID_SmartTee, &filter_ops);
- strmbase_sink_init(&object->sink, &SmartTeeFilterInputVtbl, &object->filter, inputW, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, inputW, &sink_ops, NULL);
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void **)&object->sink.pAllocator);
if (FAILED(hr))
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c
index 91b8d9dce64..bbd43e79bfd 100644
--- a/dlls/qedit/samplegrabber.c
+++ b/dlls/qedit/samplegrabber.c
@@ -473,28 +473,6 @@ static const IMemInputPinVtbl IMemInputPin_VTable =
SampleGrabber_IMemInputPin_ReceiveCanBlock,
};
-static const IPinVtbl sink_vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline SG_Impl *impl_from_sink_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, SG_Impl, sink.pin);
@@ -663,7 +641,7 @@ HRESULT SampleGrabber_create(IUnknown *outer, void **out)
obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable;
obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable;
- strmbase_sink_init(&obj->sink, &sink_vtbl, &obj->filter, L"In", &sink_ops, NULL);
+ strmbase_sink_init(&obj->sink, &obj->filter, L"In", &sink_ops, NULL);
strmbase_source_init(&obj->source, &obj->filter, L"Out", &source_ops);
obj->mtype.majortype = GUID_NULL;
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index f36e147b849..42d86eae170 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -82,7 +82,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind
return VFW_S_NO_MORE_ITEMS;
}
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
+static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
HRESULT hr;
@@ -107,19 +107,19 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out)
return S_OK;
}
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface)
+static ULONG WINAPI pin_AddRef(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_AddRef(&pin->filter->IBaseFilter_iface);
}
-ULONG WINAPI BasePinImpl_Release(IPin *iface)
+static ULONG WINAPI pin_Release(IPin *iface)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
return IBaseFilter_Release(&pin->filter->IBaseFilter_iface);
}
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
+static HRESULT WINAPI pin_ConnectedTo(IPin * iface, IPin ** ppPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -145,7 +145,7 @@ HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin)
return hr;
}
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
HRESULT hr;
@@ -171,7 +171,7 @@ HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt
return hr;
}
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
+static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -184,7 +184,7 @@ HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin *iface, PIN_INFO *info)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
+static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -195,7 +195,7 @@ HRESULT WINAPI BasePinImpl_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
+static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
@@ -209,7 +209,7 @@ HRESULT WINAPI BasePinImpl_QueryId(IPin *iface, WCHAR **id)
return S_OK;
}
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -219,7 +219,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE);
}
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
+static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)
{
struct strmbase_pin *pin = impl_from_IPin(iface);
AM_MEDIA_TYPE mt;
@@ -235,7 +235,7 @@ HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_me
return enum_media_types_create(pin, enum_media_types);
}
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin)
+static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **apPin, ULONG *cPin)
{
struct strmbase_pin *This = impl_from_IPin(iface);
@@ -244,14 +244,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin,
return E_NOTIMPL; /* to tell caller that all input pins connected to all output pins */
}
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
-{
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(start), debugstr_time(stop), rate);
-
- return S_OK;
-}
-
/*** OutputPin implementation ***/
static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
@@ -420,26 +412,33 @@ static HRESULT WINAPI source_EndFlush(IPin *iface)
return E_UNEXPECTED;
}
+static HRESULT WINAPI source_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
+ iface, debugstr_time(start), debugstr_time(stop), rate);
+ return S_OK;
+}
+
static const IPinVtbl source_vtbl =
{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
source_Connect,
source_ReceiveConnection,
source_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
source_EndOfStream,
source_BeginFlush,
source_EndFlush,
- BasePinImpl_NewSegment,
+ source_NewSegment,
};
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *This,
@@ -617,14 +616,14 @@ static struct strmbase_sink *impl_sink_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface);
}
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
+static HRESULT WINAPI sink_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
{
ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt);
return E_UNEXPECTED;
}
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
+static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
PIN_DIRECTION pindirReceive;
@@ -678,7 +677,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP
return hr;
}
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin *iface)
+static HRESULT WINAPI sink_Disconnect(IPin *iface)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -711,7 +710,7 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
return IPin_EndOfStream( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
+static HRESULT WINAPI sink_EndOfStream(IPin *iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr = S_OK;
@@ -736,7 +735,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
return IPin_BeginFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
+static HRESULT WINAPI sink_BeginFlush(IPin *iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -759,7 +758,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
return IPin_EndFlush( pin );
}
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
+static HRESULT WINAPI sink_EndFlush(IPin * iface)
{
struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
@@ -789,7 +788,7 @@ static HRESULT deliver_newsegment(IPin *pin, LPVOID data)
return IPin_NewSegment(pin, args->tStart, args->tStop, args->rate);
}
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+static HRESULT WINAPI sink_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
{
struct strmbase_sink *pin = impl_sink_from_IPin(iface);
newsegmentargs args;
@@ -807,6 +806,28 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
return SendFurther(pin, deliver_newsegment, &args);
}
+static const IPinVtbl sink_vtbl =
+{
+ pin_QueryInterface,
+ pin_AddRef,
+ pin_Release,
+ sink_Connect,
+ sink_ReceiveConnection,
+ sink_Disconnect,
+ pin_ConnectedTo,
+ pin_ConnectionMediaType,
+ pin_QueryPinInfo,
+ pin_QueryDirection,
+ pin_QueryId,
+ pin_QueryAccept,
+ pin_EnumMediaTypes,
+ pin_QueryInternalConnections,
+ sink_EndOfStream,
+ sink_BeginFlush,
+ sink_EndFlush,
+ sink_NewSegment,
+};
+
/*** IMemInputPin implementation ***/
static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface)
@@ -938,11 +959,11 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock
};
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *func_table, IMemAllocator *allocator)
{
memset(pin, 0, sizeof(*pin));
- pin->pin.IPin_iface.lpVtbl = vtbl;
+ pin->pin.IPin_iface.lpVtbl = &sink_vtbl;
pin->pin.filter = filter;
pin->pin.dir = PINDIR_INPUT;
lstrcpyW(pin->pin.name, name);
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 3c9692029dd..3fd8af2c1c2 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,28 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static const IPinVtbl BaseRenderer_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
{
struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
@@ -441,8 +419,7 @@ HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown
filter->pFuncsTable = ops;
- strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter,
- sink_name, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, sink_name, &sink_ops, NULL);
hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface,
TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition);
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 13e7be21789..6082a142dc9 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -26,8 +26,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
static const WCHAR wcsInputPinName[] = {'I','n',0};
static const WCHAR wcsOutputPinName[] = {'O','u','t',0};
-static const IPinVtbl TransformFilter_InputPin_Vtbl;
-
static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
return CONTAINING_RECORD(iface, TransformFilter, filter);
@@ -407,8 +405,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
filter->pFuncsTable = func_table;
ZeroMemory(&filter->pmt, sizeof(filter->pmt));
- strmbase_sink_init(&filter->sink, &TransformFilter_InputPin_Vtbl, &filter->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&filter->sink, &filter->filter, wcsInputPinName, &sink_ops, NULL);
strmbase_source_init(&filter->source, &filter->filter, wcsOutputPinName, &source_ops);
filter->source_IQualityControl_iface.lpVtbl = &source_qc_vtbl;
@@ -458,25 +455,3 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
CoTaskMemFree(pTf);
return E_FAIL;
}
-
-static const IPinVtbl TransformFilter_InputPin_Vtbl =
-{
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 1eae0dae9af..3945d9da8fa 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -97,7 +97,6 @@ const char* media_quark_string = "media-sample";
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl GST_Seeking_Vtbl;
-static const IPinVtbl GST_InputPin_Vtbl;
static const IQualityControlVtbl GSTOutPin_QualityControl_Vtbl;
static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name);
@@ -1502,8 +1501,7 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, wcsInputPinName, &sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = gstdecoder_init_gst;
@@ -1967,27 +1965,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static const IPinVtbl GST_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cb_list_cond = PTHREAD_COND_INITIALIZER;
struct list cb_list = LIST_INIT(cb_list);
@@ -2235,8 +2212,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &wave_parser_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &wave_parser_sink_ops, NULL);
object->init_gst = wave_parser_init_gst;
*phr = S_OK;
@@ -2339,8 +2315,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &avi_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &avi_splitter_sink_ops, NULL);
object->no_more_pads_event = CreateEventW(NULL, FALSE, FALSE, NULL);
object->init_gst = avi_splitter_init_gst;
*phr = S_OK;
@@ -2475,8 +2450,7 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
}
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
- strmbase_sink_init(&object->sink, &GST_InputPin_Vtbl, &object->filter,
- sink_name, &mpeg_splitter_sink_ops, NULL);
+ strmbase_sink_init(&object->sink, &object->filter, sink_name, &mpeg_splitter_sink_ops, NULL);
object->IAMStreamSelect_iface.lpVtbl = &stream_select_vtbl;
object->duration_event = CreateEventW(NULL, FALSE, FALSE, NULL);
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 4bb99a0305a..4c5dee89d8d 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -171,7 +171,6 @@ typedef struct QTSplitter {
HANDLE splitterThread;
} QTSplitter;
-static const IPinVtbl QT_InputPin_Vtbl;
static const IBaseFilterVtbl QT_Vtbl;
static const IMediaSeekingVtbl QT_Seeking_Vtbl;
@@ -418,8 +417,7 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
- strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
- wcsInputPinName, &sink_ops, NULL);
+ strmbase_sink_init(&This->pInputPin.pin, &This->filter, wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -1027,27 +1025,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static const IPinVtbl QT_InputPin_Vtbl = {
- BasePinImpl_QueryInterface,
- BasePinImpl_AddRef,
- BasePinImpl_Release,
- BaseInputPinImpl_Connect,
- BaseInputPinImpl_ReceiveConnection,
- BaseInputPinImpl_Disconnect,
- BasePinImpl_ConnectedTo,
- BasePinImpl_ConnectionMediaType,
- BasePinImpl_QueryPinInfo,
- BasePinImpl_QueryDirection,
- BasePinImpl_QueryId,
- BasePinImpl_QueryAccept,
- BasePinImpl_EnumMediaTypes,
- BasePinImpl_QueryInternalConnections,
- BaseInputPinImpl_EndOfStream,
- BaseInputPinImpl_BeginFlush,
- BaseInputPinImpl_EndFlush,
- BaseInputPinImpl_NewSegment
-};
-
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
{
return CONTAINING_RECORD(iface, QTOutPin, pin.pin);
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index c01ef6133f4..48d7638ae16 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -103,20 +103,6 @@ struct strmbase_sink_ops
/* Base Pin */
HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt);
-LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin);
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out);
-ULONG WINAPI BasePinImpl_AddRef(IPin *iface);
-ULONG WINAPI BasePinImpl_Release(IPin *iface);
-HRESULT WINAPI BaseInputPinImpl_Disconnect(IPin * iface);
-HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
-HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
-HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
-HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
-HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
-HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
-HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(struct strmbase_source *pin,
IMediaSample **sample, REFERENCE_TIME *start, REFERENCE_TIME *stop, DWORD flags);
@@ -130,16 +116,7 @@ void strmbase_source_cleanup(struct strmbase_source *pin);
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_source_ops *func_table);
-/* Base Input Pin */
-HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
-HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
-HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter,
const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator);
void strmbase_sink_cleanup(struct strmbase_sink *pin);
--
2.24.0
Dec. 12, 2019
[PATCH 7/8] wineqtdecoder: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 33 ++++-----------------------------
1 file changed, 4 insertions(+), 29 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 4d86b951e76..4bb99a0305a 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -1027,31 +1027,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI QTInPin_NewSegment(IPin *iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- BasePinImpl_NewSegment(iface, tStart, tStop, dRate);
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -1067,10 +1042,10 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- QTInPin_EndOfStream,
- QTInPin_BeginFlush,
- QTInPin_EndFlush,
- QTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
static inline QTOutPin *impl_source_from_strmbase_pin(struct strmbase_pin *iface)
--
2.24.0
Dec. 12, 2019
[PATCH 6/8] winegstreamer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/winegstreamer/gstdemux.c | 36 ++++-------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index fb60d69e2ac..1eae0dae9af 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1967,34 +1967,6 @@ static HRESULT GST_RemoveOutputPins(struct gstdemux *This)
return S_OK;
}
-static HRESULT WINAPI GSTInPin_EndOfStream(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_BeginFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_EndFlush(IPin *iface)
-{
- FIXME("iface %p, stub!\n", iface);
- return S_OK;
-}
-
-static HRESULT WINAPI GSTInPin_NewSegment(IPin *iface, REFERENCE_TIME start,
- REFERENCE_TIME stop, double rate)
-{
- FIXME("iface %p, start %s, stop %s, rate %.16e, stub!\n",
- iface, wine_dbgstr_longlong(start), wine_dbgstr_longlong(stop), rate);
-
- BasePinImpl_NewSegment(iface, start, stop, rate);
- return S_OK;
-}
-
static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryInterface,
BasePinImpl_AddRef,
@@ -2010,10 +1982,10 @@ static const IPinVtbl GST_InputPin_Vtbl = {
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- GSTInPin_EndOfStream,
- GSTInPin_BeginFlush,
- GSTInPin_EndFlush,
- GSTInPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
pthread_mutex_t cb_list_lock = PTHREAD_MUTEX_INITIALIZER;
--
2.24.0
Dec. 12, 2019
[PATCH 5/8] strmbase/renderer: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/renderer.c | 142 +++++++++++++++++++--------------------
1 file changed, 68 insertions(+), 74 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 7b9736ccfb2..3c9692029dd 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -40,77 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
}
-static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
-{
- struct strmbase_renderer *filter = impl_from_IPin(iface);
- IFilterGraph *graph = filter->filter.filterInfo.pGraph;
- IMediaEventSink *event_sink;
- HRESULT hr = S_OK;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&filter->csRenderLock);
- filter->eos = TRUE;
-
- if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
- &IID_IMediaEventSink, (void **)&event_sink)))
- {
- IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
- (LONG_PTR)&filter->filter.IBaseFilter_iface);
- IMediaEventSink_Release(event_sink);
- }
- RendererPosPassThru_EOS(filter->pPosition);
- SetEvent(filter->state_event);
-
- if (filter->pFuncsTable->pfnEndOfStream)
- hr = filter->pFuncsTable->pfnEndOfStream(filter);
- LeaveCriticalSection(&filter->csRenderLock);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- hr = BaseInputPinImpl_BeginFlush(iface);
- if (SUCCEEDED(hr))
- {
- BaseRendererImpl_ClearPendingSample(pFilter);
- SetEvent(pFilter->flush_event);
- }
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
-{
- struct strmbase_renderer *pFilter = impl_from_IPin(iface);
- HRESULT hr;
-
- TRACE("iface %p.\n", iface);
-
- EnterCriticalSection(&pFilter->filter.csFilter);
- EnterCriticalSection(&pFilter->csRenderLock);
- pFilter->eos = FALSE;
- hr = BaseInputPinImpl_EndFlush(iface);
- if (SUCCEEDED(hr))
- {
- QualityControlRender_Start(pFilter->qcimpl, pFilter->stream_start);
- RendererPosPassThru_ResetMediaTime(pFilter->pPosition);
- ResetEvent(pFilter->flush_event);
-
- if (pFilter->pFuncsTable->pfnEndFlush)
- hr = pFilter->pFuncsTable->pfnEndFlush(pFilter);
- }
- LeaveCriticalSection(&pFilter->csRenderLock);
- LeaveCriticalSection(&pFilter->filter.csFilter);
- return hr;
-}
-
static const IPinVtbl BaseRenderer_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -127,9 +56,9 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- BaseRenderer_InputPin_EndOfStream,
- BaseRenderer_InputPin_BeginFlush,
- BaseRenderer_InputPin_EndFlush,
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
BaseInputPinImpl_NewSegment
};
@@ -289,6 +218,68 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ IFilterGraph *graph = filter->filter.filterInfo.pGraph;
+ IMediaEventSink *event_sink;
+ HRESULT hr;
+
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = TRUE;
+
+ if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
+ &IID_IMediaEventSink, (void **)&event_sink)))
+ {
+ IMediaEventSink_Notify(event_sink, EC_COMPLETE, S_OK,
+ (LONG_PTR)&filter->filter.IBaseFilter_iface);
+ IMediaEventSink_Release(event_sink);
+ }
+ RendererPosPassThru_EOS(filter->pPosition);
+ SetEvent(filter->state_event);
+
+ if (filter->pFuncsTable->pfnEndOfStream)
+ hr = filter->pFuncsTable->pfnEndOfStream(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ return hr;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+
+ EnterCriticalSection(&filter->filter.csFilter);
+
+ BaseRendererImpl_ClearPendingSample(filter);
+ SetEvent(filter->flush_event);
+
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return S_OK;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ EnterCriticalSection(&filter->csRenderLock);
+
+ filter->eos = FALSE;
+ QualityControlRender_Start(filter->qcimpl, filter->stream_start);
+ RendererPosPassThru_ResetMediaTime(filter->pPosition);
+ ResetEvent(filter->flush_event);
+
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+
+ LeaveCriticalSection(&filter->csRenderLock);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -297,6 +288,9 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = BaseRenderer_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
};
void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
--
2.24.0
Dec. 12, 2019
[PATCH 4/8] strmbase/transform: Use base sink streaming methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/transform.c | 120 ++++++++++++++++++--------------------
1 file changed, 58 insertions(+), 62 deletions(-)
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index 993e30202bc..13e7be21789 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -229,6 +229,56 @@ static void sink_disconnect(struct strmbase_sink *iface)
filter->pFuncsTable->pfnBreakConnect(filter, PINDIR_INPUT);
}
+static HRESULT sink_eos(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+
+ if (filter->source.pin.peer)
+ return IPin_EndOfStream(filter->source.pin.peer);
+ return VFW_E_NOT_CONNECTED;
+}
+
+static HRESULT sink_begin_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ if (filter->pFuncsTable->pfnBeginFlush)
+ hr = filter->pFuncsTable->pfnBeginFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_BeginFlush(filter->source.pin.peer);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
+static HRESULT sink_end_flush(struct strmbase_sink *iface)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ EnterCriticalSection(&filter->filter.csFilter);
+ if (filter->pFuncsTable->pfnEndFlush)
+ hr = filter->pFuncsTable->pfnEndFlush(filter);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_EndFlush(filter->source.pin.peer);
+ LeaveCriticalSection(&filter->filter.csFilter);
+ return hr;
+}
+
+static HRESULT sink_new_segment(struct strmbase_sink *iface,
+ REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
+{
+ TransformFilter *filter = impl_from_sink_IPin(&iface->pin.IPin_iface);
+ HRESULT hr = S_OK;
+
+ if (filter->pFuncsTable->pfnNewSegment)
+ hr = filter->pFuncsTable->pfnNewSegment(filter, start, stop, rate);
+ if (SUCCEEDED(hr) && filter->source.pin.peer)
+ hr = IPin_NewSegment(filter->source.pin.peer, start, stop, rate);
+ return hr;
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
@@ -237,6 +287,10 @@ static const struct strmbase_sink_ops sink_ops =
.pfnReceive = TransformFilter_Input_Receive,
.sink_connect = sink_connect,
.sink_disconnect = sink_disconnect,
+ .sink_eos = sink_eos,
+ .sink_begin_flush = sink_begin_flush,
+ .sink_end_flush = sink_end_flush,
+ .sink_new_segment = sink_new_segment,
};
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
@@ -405,64 +459,6 @@ HRESULT strmbase_transform_create(LONG filter_size, IUnknown *outer, const CLSID
return E_FAIL;
}
-static HRESULT WINAPI TransformFilter_InputPin_EndOfStream(IPin * iface)
-{
- TransformFilter *filter = impl_from_sink_IPin(iface);
-
- TRACE("iface %p.\n", iface);
-
- if (filter->source.pin.peer)
- return IPin_EndOfStream(filter->source.pin.peer);
- return VFW_E_NOT_CONNECTED;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_BeginFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnBeginFlush)
- hr = pTransform->pFuncsTable->pfnBeginFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_BeginFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_EndFlush(IPin * iface)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("(%p)->()\n", iface);
-
- EnterCriticalSection(&pTransform->filter.csFilter);
- if (pTransform->pFuncsTable->pfnEndFlush)
- hr = pTransform->pFuncsTable->pfnEndFlush(pTransform);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_EndFlush(iface);
- LeaveCriticalSection(&pTransform->filter.csFilter);
- return hr;
-}
-
-static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- TransformFilter *pTransform = impl_from_sink_IPin(iface);
- HRESULT hr = S_OK;
-
- TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
- iface, debugstr_time(tStart), debugstr_time(tStop), dRate);
-
- if (pTransform->pFuncsTable->pfnNewSegment)
- hr = pTransform->pFuncsTable->pfnNewSegment(pTransform, tStart, tStop, dRate);
- if (SUCCEEDED(hr))
- hr = BaseInputPinImpl_NewSegment(iface, tStart, tStop, dRate);
- return hr;
-}
-
static const IPinVtbl TransformFilter_InputPin_Vtbl =
{
BasePinImpl_QueryInterface,
@@ -479,8 +475,8 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl =
BasePinImpl_QueryAccept,
BasePinImpl_EnumMediaTypes,
BasePinImpl_QueryInternalConnections,
- TransformFilter_InputPin_EndOfStream,
- TransformFilter_InputPin_BeginFlush,
- TransformFilter_InputPin_EndFlush,
- TransformFilter_InputPin_NewSegment
+ BaseInputPinImpl_EndOfStream,
+ BaseInputPinImpl_BeginFlush,
+ BaseInputPinImpl_EndFlush,
+ BaseInputPinImpl_NewSegment
};
--
2.24.0
Dec. 12, 2019
[PATCH 3/8] strmbase: Introduce callbacks for streaming events.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/strmbase/pin.c | 12 ++++++++++++
include/wine/strmbase.h | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 3dd00b27ccc..f36e147b849 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -718,6 +718,9 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
TRACE("(%p)->()\n", This);
+ if (This->pFuncsTable->sink_eos)
+ return This->pFuncsTable->sink_eos(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
if (This->flushing)
hr = S_FALSE;
@@ -739,6 +742,9 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
HRESULT hr;
TRACE("(%p) semi-stub\n", This);
+ if (This->pFuncsTable->sink_begin_flush)
+ return This->pFuncsTable->sink_begin_flush(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
This->flushing = TRUE;
@@ -759,6 +765,9 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
HRESULT hr;
TRACE("(%p)->()\n", This);
+ if (This->pFuncsTable->sink_begin_flush)
+ return This->pFuncsTable->sink_end_flush(This);
+
EnterCriticalSection(&This->pin.filter->csFilter);
This->flushing = FALSE;
@@ -788,6 +797,9 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
TRACE("iface %p, start %s, stop %s, rate %.16e.\n",
iface, debugstr_time(start), debugstr_time(stop), rate);
+ if (pin->pFuncsTable->sink_new_segment)
+ return pin->pFuncsTable->sink_new_segment(pin, start, stop, rate);
+
args.tStart = start;
args.tStop = stop;
args.rate = rate;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index 83ad2e0bd6e..c01ef6133f4 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -95,6 +95,10 @@ struct strmbase_sink_ops
BaseInputPin_Receive pfnReceive;
HRESULT (*sink_connect)(struct strmbase_sink *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
void (*sink_disconnect)(struct strmbase_sink *pin);
+ HRESULT (*sink_eos)(struct strmbase_sink *pin);
+ HRESULT (*sink_begin_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_end_flush)(struct strmbase_sink *pin);
+ HRESULT (*sink_new_segment)(struct strmbase_sink *pin, REFERENCE_TIME start, REFERENCE_TIME stop, double rate);
};
/* Base Pin */
--
2.24.0
Dec. 12, 2019
[PATCH 2/8] wineqtdecoder: Use base sink connection methods.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 189 +++++++++++---------------------
1 file changed, 65 insertions(+), 124 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index c8a34cbf95e..4d86b951e76 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -331,10 +331,73 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
+static HRESULT qt_splitter_sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+ ALLOCATOR_PROPERTIES props;
+ IMemAllocator *allocator;
+ HRESULT hr = S_OK;
+
+ filter->pInputPin.pReader = NULL;
+
+ if (FAILED(hr = IPin_QueryInterface(peer, &IID_IAsyncReader, (void **)&filter->pInputPin.pReader)))
+ return hr;
+
+ if (FAILED(hr = QT_Process_Movie(filter)))
+ {
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ filter->pInputPin.pReader = NULL;
+ return hr;
+ }
+
+ filter->pInputPin.pAlloc = NULL;
+ props.cBuffers = 8;
+ props.cbAlign = 1;
+ props.cbBuffer = filter->outputSize + props.cbAlign;
+ props.cbPrefix = 0;
+
+ /* Some applications depend on IAsyncReader::RequestAllocator() passing a
+ * non-NULL preferred allocator. */
+ hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
+ &IID_IMemAllocator, (void **)&allocator);
+ if (FAILED(hr))
+ goto err;
+
+ hr = IAsyncReader_RequestAllocator(filter->reader, allocator, &props, &filter->alloc);
+ IMemAllocator_Release(allocator);
+ if (FAILED(hr))
+ {
+ WARN("Failed to get allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ if (FAILED(hr = IMemAllocator_Commit(filter->alloc)))
+ {
+ WARN("Failed to commit allocator, hr %#x.\n", hr);
+ goto err;
+ }
+
+ return S_OK;
+err:
+ QT_RemoveOutputPins(filter);
+ IAsyncReader_Release(filter->pInputPin.pReader);
+ return hr;
+}
+
+static HRESULT qt_splitter_sink_disconnect(struct strmbase_sink *iface)
+{
+ QTSplitter *filter = impl_from_strmbase_filter(iface->pin.filter);
+
+ IMemAllocator_Decommit(filter->alloc);
+ GST_RemoveOutputPins(filter);
+}
+
static const struct strmbase_sink_ops sink_ops =
{
.base.pin_query_accept = sink_query_accept,
.base.pin_get_media_type = strmbase_pin_get_media_type,
+ .sink_connect = qt_splitter_sink_connect,
+ .sink_disconnect = qt_splitter_sink_disconnect,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -964,128 +1027,6 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
return hr;
}
-static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
-{
- HRESULT hr = S_OK;
- ALLOCATOR_PROPERTIES props;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
- IMemAllocator *pAlloc;
-
- TRACE("(%p/%p)->(%p, %p)\n", This, iface, pReceivePin, pmt);
-
- EnterCriticalSection(&filter->filter.csFilter);
- This->pReader = NULL;
-
- if (This->pin.pin.peer)
- hr = VFW_E_ALREADY_CONNECTED;
- else if (IPin_QueryAccept(iface, pmt) != S_OK)
- hr = VFW_E_TYPE_NOT_ACCEPTED;
- else
- {
- PIN_DIRECTION pindirReceive;
- IPin_QueryDirection(pReceivePin, &pindirReceive);
- if (pindirReceive != PINDIR_OUTPUT)
- hr = VFW_E_INVALID_DIRECTION;
- }
-
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
- }
-
- hr = IPin_QueryInterface(pReceivePin, &IID_IAsyncReader, (LPVOID *)&This->pReader);
- if (FAILED(hr))
- {
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Input source is not an AsyncReader\n");
- return hr;
- }
-
- LeaveCriticalSection(&filter->filter.csFilter);
- EnterCriticalSection(&filter->filter.csFilter);
- hr = QT_Process_Movie(filter);
- if (FAILED(hr))
- {
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- LeaveCriticalSection(&filter->filter.csFilter);
- TRACE("Unable to process movie\n");
- return hr;
- }
-
- This->pAlloc = NULL;
- props.cBuffers = 8;
- props.cbAlign = 1;
- props.cbBuffer = filter->outputSize + props.cbAlign;
- props.cbPrefix = 0;
- hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC,
- &IID_IMemAllocator, (LPVOID *)&pAlloc);
- if (SUCCEEDED(hr))
- {
- /* A certain IAsyncReader::RequestAllocator expects to be passed
- non-NULL preferred allocator */
- hr = IAsyncReader_RequestAllocator(This->pReader, pAlloc, &props, &This->pAlloc);
- if (FAILED(hr))
- WARN("Can't get an allocator, got %08x\n", hr);
- IMemAllocator_Release(pAlloc);
- }
-
- if (SUCCEEDED(hr))
- {
- CopyMediaType(&This->pin.mt, pmt);
- This->pin.peer = pReceivePin;
- IPin_AddRef(pReceivePin);
- hr = IMemAllocator_Commit(This->pAlloc);
- }
- else
- {
- QT_RemoveOutputPins(filter);
- if (This->pReader)
- IAsyncReader_Release(This->pReader);
- This->pReader = NULL;
- if (This->pAlloc)
- IMemAllocator_Release(This->pAlloc);
- This->pAlloc = NULL;
- }
- TRACE("Size: %i\n", props.cbBuffer);
- LeaveCriticalSection(&filter->filter.csFilter);
-
- return hr;
-}
-
-static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
-{
- HRESULT hr;
- QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
- FILTER_STATE state;
- TRACE("()\n");
-
- hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
- EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.pin.peer)
- {
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
-
- if (SUCCEEDED(hr) && state == State_Stopped)
- {
- IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.pin.peer);
- IPin_Release(This->pin.pin.peer);
- This->pin.pin.peer = NULL;
- hr = QT_RemoveOutputPins(Parser);
- }
- else
- hr = VFW_E_NOT_STOPPED;
- }
- else
- hr = S_FALSE;
- LeaveCriticalSection(&filter->filter.csFilter);
- return hr;
-}
-
static HRESULT WINAPI QTInPin_EndOfStream(IPin *iface)
{
FIXME("iface %p, stub!\n", iface);
@@ -1116,8 +1057,8 @@ static const IPinVtbl QT_InputPin_Vtbl = {
BasePinImpl_AddRef,
BasePinImpl_Release,
BaseInputPinImpl_Connect,
- QTInPin_ReceiveConnection,
- QTInPin_Disconnect,
+ BaseInputPinImpl_ReceiveConnection,
+ BaseInputPinImpl_Disconnect,
BasePinImpl_ConnectedTo,
BasePinImpl_ConnectionMediaType,
BasePinImpl_QueryPinInfo,
--
2.24.0
Dec. 12, 2019
[PATCH 1/8] wineqtdecoder: Store the sink as a strmbase_sink structure.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/wineqtdecoder/qtsplitter.c | 43 ++++++++++++++-------------------
1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index d861110f5f1..c8a34cbf95e 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -138,7 +138,7 @@ typedef struct QTOutPin {
} QTOutPin;
typedef struct QTInPin {
- struct strmbase_pin pin;
+ struct strmbase_sink pin;
GUID subType;
IAsyncReader *pReader;
@@ -199,7 +199,7 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface )
static inline QTInPin *impl_from_IPin(IPin *iface)
{
- return CONTAINING_RECORD(iface, QTInPin, pin.IPin_iface);
+ return CONTAINING_RECORD(iface, QTInPin, pin.pin.IPin_iface);
}
/*
@@ -211,7 +211,7 @@ static struct strmbase_pin *qt_splitter_get_pin(struct strmbase_filter *base, un
QTSplitter *filter = impl_from_strmbase_filter(base);
if (index == 0)
- return &filter->pInputPin.pin;
+ return &filter->pInputPin.pin.pin;
else if (index == 1)
{
if (filter->pVideo_Pin)
@@ -232,18 +232,15 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
EnterCriticalSection(&filter->csReceive);
/* Don't need to clean up output pins, disconnecting input pin will do that */
+ if (filter->pInputPin.pin.pin.peer)
+ IPin_Disconnect(filter->pInputPin.pin.pin.peer);
- if (filter->pInputPin.pin.peer)
- IPin_Disconnect(filter->pInputPin.pin.peer);
-
- FreeMediaType(&filter->pInputPin.pin.mt);
if (filter->pInputPin.pAlloc)
IMemAllocator_Release(filter->pInputPin.pAlloc);
filter->pInputPin.pAlloc = NULL;
if (filter->pInputPin.pReader)
IAsyncReader_Release(filter->pInputPin.pReader);
filter->pInputPin.pReader = NULL;
- filter->pInputPin.pin.IPin_iface.lpVtbl = NULL;
if (filter->pQTMovie)
{
@@ -274,6 +271,7 @@ static void qt_splitter_destroy(struct strmbase_filter *iface)
filter->csReceive.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->csReceive);
+ strmbase_sink_cleanup(&filter->pInputPin.pin);
strmbase_filter_cleanup(&filter->filter);
CoTaskMemFree(filter);
@@ -333,10 +331,10 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_FALSE;
}
-static const BasePinFuncTable sink_ops =
+static const struct strmbase_sink_ops sink_ops =
{
- .pin_query_accept = sink_query_accept,
- .pin_get_media_type = strmbase_pin_get_media_type,
+ .base.pin_query_accept = sink_query_accept,
+ .base.pin_get_media_type = strmbase_pin_get_media_type,
};
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
@@ -357,6 +355,8 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
ZeroMemory(This,sizeof(*This));
strmbase_filter_init(&This->filter, outer, &CLSID_QTSplitter, &filter_ops);
+ strmbase_sink_init(&This->pInputPin.pin, &QT_InputPin_Vtbl, &This->filter,
+ wcsInputPinName, &sink_ops, NULL);
InitializeCriticalSection(&This->csReceive);
This->csReceive.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": QTSplitter.csReceive");
@@ -366,13 +366,6 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
This->aSession = NULL;
This->runEvent = CreateEventW(NULL, 0, 0, NULL);
- This->pInputPin.pin.dir = PINDIR_INPUT;
- This->pInputPin.pin.filter = &This->filter;
- lstrcpynW(This->pInputPin.pin.name, wcsInputPinName, ARRAY_SIZE(This->pInputPin.pin.name));
- This->pInputPin.pin.IPin_iface.lpVtbl = &QT_InputPin_Vtbl;
- This->pInputPin.pin.peer = NULL;
- This->pInputPin.pin.pFuncsTable = &sink_ops;
-
*phr = S_OK;
return &This->filter.IUnknown_inner;
}
@@ -984,7 +977,7 @@ static HRESULT WINAPI QTInPin_ReceiveConnection(IPin *iface, IPin *pReceivePin,
EnterCriticalSection(&filter->filter.csFilter);
This->pReader = NULL;
- if (This->pin.peer)
+ if (This->pin.pin.peer)
hr = VFW_E_ALREADY_CONNECTED;
else if (IPin_QueryAccept(iface, pmt) != S_OK)
hr = VFW_E_TYPE_NOT_ACCEPTED;
@@ -1066,22 +1059,22 @@ static HRESULT WINAPI QTInPin_Disconnect(IPin *iface)
{
HRESULT hr;
QTInPin *This = impl_from_IPin(iface);
- QTSplitter *filter = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *filter = impl_from_strmbase_filter(This->pin.pin.filter);
FILTER_STATE state;
TRACE("()\n");
hr = IBaseFilter_GetState(&filter->filter.IBaseFilter_iface, INFINITE, &state);
EnterCriticalSection(&filter->filter.csFilter);
- if (This->pin.peer)
+ if (This->pin.pin.peer)
{
- QTSplitter *Parser = impl_from_strmbase_filter(This->pin.filter);
+ QTSplitter *Parser = impl_from_strmbase_filter(This->pin.pin.filter);
if (SUCCEEDED(hr) && state == State_Stopped)
{
IMemAllocator_Decommit(This->pAlloc);
- IPin_Disconnect(This->pin.peer);
- IPin_Release(This->pin.peer);
- This->pin.peer = NULL;
+ IPin_Disconnect(This->pin.pin.peer);
+ IPin_Release(This->pin.pin.peer);
+ This->pin.pin.peer = NULL;
hr = QT_RemoveOutputPins(Parser);
}
else
--
2.24.0
Dec. 12, 2019
Re: [PATCH 2/2] msado15: Add _Command stub interface
by Marvin
Hi,
While running your changed tests, 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=61985
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
error: patch failed: dlls/msado15/tests/msado15.c:444
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
error: patch failed: dlls/msado15/tests/msado15.c:444
Task: Patch failed to apply
Dec. 12, 2019
Re: [PATCH 1/2] msado15: Add ISupportErrorInfo support to _Connection
by Marvin
Hi,
While running your changed tests, 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=61984
Your paranoid android.
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/msado15/connection.c:33
error: patch failed: dlls/msado15/tests/msado15.c:414
Task: Patch failed to apply
Dec. 12, 2019
[PATCH 2/2] msado15: Add _Command stub interface
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/Makefile.in | 1 +
dlls/msado15/command.c | 388 +++++++++++++++++++++++++++++++
dlls/msado15/main.c | 5 +
dlls/msado15/msado15_classes.idl | 8 +
dlls/msado15/msado15_private.h | 1 +
dlls/msado15/tests/msado15.c | 28 +++
6 files changed, 431 insertions(+)
create mode 100644 dlls/msado15/command.c
diff --git a/dlls/msado15/Makefile.in b/dlls/msado15/Makefile.in
index 604f9ff018..9852e0863d 100644
--- a/dlls/msado15/Makefile.in
+++ b/dlls/msado15/Makefile.in
@@ -4,6 +4,7 @@ IMPORTS = oleaut32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
+ command.c \
connection.c \
main.c \
recordset.c \
diff --git a/dlls/msado15/command.c b/dlls/msado15/command.c
new file mode 100644
index 0000000000..9856b52e91
--- /dev/null
+++ b/dlls/msado15/command.c
@@ -0,0 +1,388 @@
+/*
+ * Copyright 2019 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#define COBJMACROS
+#include "objbase.h"
+#include "msado15_backcompat.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+#include "msado15_private.h"
+#include "msado15_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(msado);
+
+struct command
+{
+ _Command Command_iface;
+
+ LONG ref;
+};
+
+
+static inline struct command *impl_from_Command(_Command *iface)
+{
+ return CONTAINING_RECORD(iface, struct command, Command_iface);
+}
+
+static HRESULT WINAPI command_QueryInterface(_Command *iface, REFIID riid, void **out)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)->(%s, %p)\n", command, debugstr_guid(riid), out);
+
+ *out = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) ||
+ IsEqualIID(riid, &IID_IDispatch) ||
+ IsEqualIID(riid, &IID__ADO) ||
+ IsEqualIID(riid, &IID_Command15) ||
+ IsEqualIID(riid, &IID_Command25) ||
+ IsEqualIID(riid, &IID__Command))
+ {
+ *out = iface;
+ }
+ else
+ {
+ FIXME("interface %s not implemented\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+ }
+
+ _Command_AddRef(iface);
+ return S_OK;
+}
+
+static ULONG WINAPI command_AddRef(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)\n", command);
+
+ return InterlockedIncrement(&command->ref);
+}
+
+static ULONG WINAPI command_Release(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ LONG ref;
+
+ TRACE("(%p)\n", command);
+
+ ref = InterlockedDecrement(&command->ref);
+ if (!ref)
+ heap_free(command);
+
+ return ref;
+}
+
+static HRESULT WINAPI command_GetTypeInfoCount(_Command *iface, UINT *pctinfo)
+{
+ struct command *command = impl_from_Command(iface);
+ TRACE("(%p)->()\n", command);
+
+ *pctinfo = 1;
+ return S_OK;
+}
+
+static HRESULT WINAPI command_GetTypeInfo(_Command *iface, UINT iTInfo, LCID lcid, ITypeInfo **typeinfo)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%u %u %p)\n", command, iTInfo, lcid, typeinfo);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_GetIDsOfNames(_Command *iface, REFIID riid, LPOLESTR *rgszNames,
+ UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s %p %u %u %p)\n", command, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Invoke(_Command *iface, DISPID dispIdMember, REFIID riid,
+ LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
+ UINT *puArgErr)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", command, dispIdMember, debugstr_guid(riid),
+ lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Properties(_Command *iface, Properties **props)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, props);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_ActiveConnection(_Command *iface, _Connection **connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, connection);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_putref_ActiveConnection(_Command *iface, _Connection *connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, connection);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_ActiveConnection(_Command *iface, VARIANT connection)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->()\n", command);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandText(_Command *iface, BSTR *text)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, text);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandText(_Command *iface, BSTR text)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(text));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandTimeout(_Command *iface, LONG *timeout)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandTimeout(_Command *iface, LONG timeout)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, timeout);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Prepared(_Command *iface, VARIANT_BOOL *prepared)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, prepared);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Prepared(_Command *iface, VARIANT_BOOL prepared)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, prepared);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Execute(_Command *iface, VARIANT *recordsaffected, VARIANT *parameters,
+ LONG options, _Recordset **recordset)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p %p %d %p)\n", command, recordsaffected, parameters, options, recordset);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_CreateParameter(_Command *iface, BSTR name, DataTypeEnum type,
+ ParameterDirectionEnum direction, LONG size, VARIANT value, _Parameter **parameter)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s %d %d %d %p)\n", command, debugstr_w(name), type, direction, size,
+ parameter);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Parameters(_Command *iface, Parameters **parameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, parameters);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_CommandType(_Command *iface, CommandTypeEnum cmdtype)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, cmdtype);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandType(_Command *iface, CommandTypeEnum *cmdtype)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, cmdtype);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Name(_Command *iface, BSTR *name)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, name);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Name(_Command *iface, BSTR name)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(name));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_State(_Command *iface, LONG *state)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, state);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_Cancel(_Command *iface)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->()\n", command);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_putref_CommandStream(_Command *iface, IUnknown *stream)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, stream);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_CommandStream(_Command *iface, VARIANT *stream)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, stream);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_Dialect(_Command *iface, BSTR dialect)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%s)\n", command, debugstr_w(dialect));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_Dialect(_Command *iface, BSTR *dialect)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, dialect);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_put_NamedParameters(_Command *iface, VARIANT_BOOL namedparameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%d)\n", command, namedparameters);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI command_get_NamedParameters(_Command *iface, VARIANT_BOOL *namedparameters)
+{
+ struct command *command = impl_from_Command(iface);
+ FIXME("(%p)->(%p)\n", command, namedparameters);
+
+ return E_NOTIMPL;
+}
+
+static const struct _CommandVtbl command_vtbl =
+{
+ command_QueryInterface,
+ command_AddRef,
+ command_Release,
+ command_GetTypeInfoCount,
+ command_GetTypeInfo,
+ command_GetIDsOfNames,
+ command_Invoke,
+ command_get_Properties,
+ command_get_ActiveConnection,
+ command_putref_ActiveConnection,
+ command_put_ActiveConnection,
+ command_get_CommandText,
+ command_put_CommandText,
+ command_get_CommandTimeout,
+ command_put_CommandTimeout,
+ command_get_Prepared,
+ command_put_Prepared,
+ command_Execute,
+ command_CreateParameter,
+ command_get_Parameters,
+ command_put_CommandType,
+ command_get_CommandType,
+ command_get_Name,
+ command_put_Name,
+ command_get_State,
+ command_Cancel,
+ command_putref_CommandStream,
+ command_get_CommandStream,
+ command_put_Dialect,
+ command_get_Dialect,
+ command_put_NamedParameters,
+ command_get_NamedParameters
+};
+
+HRESULT Command_create( void **out )
+{
+ struct command *command;
+
+ TRACE("(%p)\n", out);
+
+ *out = NULL;
+
+ command = heap_alloc(sizeof(*command));
+ if (!command)
+ return E_OUTOFMEMORY;
+
+ command->Command_iface.lpVtbl = &command_vtbl;
+ command->ref = 1;
+
+ *out = &command->Command_iface;
+
+ return S_OK;
+}
diff --git a/dlls/msado15/main.c b/dlls/msado15/main.c
index 32ae252337..3115474b84 100644
--- a/dlls/msado15/main.c
+++ b/dlls/msado15/main.c
@@ -117,6 +117,7 @@ static const struct IClassFactoryVtbl msadocf_vtbl =
msadocf_LockServer
};
+static struct msadocf command_cf = { { &msadocf_vtbl }, Command_create };
static struct msadocf connection_cf = { { &msadocf_vtbl }, Connection_create };
static struct msadocf recordset_cf = { { &msadocf_vtbl }, Recordset_create };
static struct msadocf stream_cf = { { &msadocf_vtbl }, Stream_create };
@@ -142,6 +143,10 @@ HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID iid, void **obj )
{
cf = &stream_cf.IClassFactory_iface;
}
+ else if (IsEqualGUID( clsid, &CLSID_Command ))
+ {
+ cf = &command_cf.IClassFactory_iface;
+ }
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, obj );
}
diff --git a/dlls/msado15/msado15_classes.idl b/dlls/msado15/msado15_classes.idl
index 5ede180240..51f8bd77db 100644
--- a/dlls/msado15/msado15_classes.idl
+++ b/dlls/msado15/msado15_classes.idl
@@ -18,6 +18,14 @@
#pragma makedep register
+[
+ threading(apartment),
+ progid("ADODB.Command.6.0"),
+ vi_progid("ADODB.Command"),
+ uuid(00000507-0000-0010-8000-00aa006d2ea4)
+]
+coclass Command { interface _Command; }
+
[
threading(apartment),
progid("ADODB.Connection.6.0"),
diff --git a/dlls/msado15/msado15_private.h b/dlls/msado15/msado15_private.h
index 7239e48b53..f6c60f0304 100644
--- a/dlls/msado15/msado15_private.h
+++ b/dlls/msado15/msado15_private.h
@@ -21,6 +21,7 @@
#define MAKE_ADO_HRESULT( err ) MAKE_HRESULT( SEVERITY_ERROR, FACILITY_CONTROL, err )
+HRESULT Command_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Connection_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Recordset_create( void ** ) DECLSPEC_HIDDEN;
HRESULT Stream_create( void ** ) DECLSPEC_HIDDEN;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 5a1813694b..7850c45231 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -444,6 +444,33 @@ if (0) /* Crashes on windows */
_Connection_Release(connection);
}
+static void test_Command(void)
+{
+ HRESULT hr;
+ _Command *command;
+ _ADO *ado;
+ Command15 *command15;
+ Command25 *command25;
+
+ hr = CoCreateInstance(&CLSID_Command, NULL, CLSCTX_INPROC_SERVER,
+ &IID__Command, (void**)&command);
+ ok( hr == S_OK, "got %08x\n", hr );
+
+ hr = _Command_QueryInterface(command, &IID__ADO, (void**)&ado);
+ ok( hr == S_OK, "got %08x\n", hr );
+ _ADO_Release(ado);
+
+ hr = _Command_QueryInterface(command, &IID_Command15, (void**)&command15);
+ ok( hr == S_OK, "got %08x\n", hr );
+ Command15_Release(command15);
+
+ hr = _Command_QueryInterface(command, &IID_Command25, (void**)&command25);
+ ok( hr == S_OK, "got %08x\n", hr );
+ Command25_Release(command25);
+
+ _Command_Release(command);
+}
+
START_TEST(msado15)
{
CoInitialize( NULL );
@@ -451,5 +478,6 @@ START_TEST(msado15)
test_Fields();
test_Recordset();
test_Stream();
+ test_Command();
CoUninitialize();
}
--
2.17.1
Dec. 12, 2019
[PATCH 1/2] msado15: Add ISupportErrorInfo support to _Connection
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/connection.c | 46 +++++++++++++++++++++++++++++++++++-
dlls/msado15/tests/msado15.c | 5 ++--
2 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c
index 037ab52199..80d921d091 100644
--- a/dlls/msado15/connection.c
+++ b/dlls/msado15/connection.c
@@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct connection
{
_Connection Connection_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
LONG refs;
ObjectStateEnum state;
@@ -44,6 +45,11 @@ static inline struct connection *impl_from_Connection( _Connection *iface )
return CONTAINING_RECORD( iface, struct connection, Connection_iface );
}
+static inline struct connection *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
+{
+ return CONTAINING_RECORD(iface, struct connection, ISupportErrorInfo_iface);
+}
+
static ULONG WINAPI connection_AddRef( _Connection *iface )
{
struct connection *connection = impl_from_Connection( iface );
@@ -64,13 +70,18 @@ static ULONG WINAPI connection_Release( _Connection *iface )
static HRESULT WINAPI connection_QueryInterface( _Connection *iface, REFIID riid, void **obj )
{
- TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
+ struct connection *connection = impl_from_Connection( iface );
+ TRACE( "%p, %s, %p\n", connection, debugstr_guid(riid), obj );
if (IsEqualGUID( riid, &IID__Connection ) || IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ))
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &connection->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -339,12 +350,45 @@ static const struct _ConnectionVtbl connection_vtbl =
connection_Cancel
};
+static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **obj)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_QueryInterface(&connection->Connection_iface, riid, obj);
+}
+
+static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_AddRef(&connection->Connection_iface);
+}
+
+static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_Release(&connection->Connection_iface);
+}
+
+static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ FIXME("(%p)->(%s)\n", connection, debugstr_guid(riid));
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl = {
+ SupportErrorInfo_QueryInterface,
+ SupportErrorInfo_AddRef,
+ SupportErrorInfo_Release,
+ SupportErrorInfo_InterfaceSupportsErrorInfo
+};
+
HRESULT Connection_create( void **obj )
{
struct connection *connection;
if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY;
connection->Connection_iface.lpVtbl = &connection_vtbl;
+ connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
connection->refs = 1;
connection->state = adStateClosed;
connection->timeout = 30;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 4ef4762ac6..5a1813694b 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -414,9 +414,8 @@ static void test_Connection(void)
ok(hr == E_NOINTERFACE, "Unexpected IRunnableObject interface\n");
hr = _Connection_QueryInterface(connection, &IID_ISupportErrorInfo, (void**)&errorinfo);
- todo_wine ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
- if (hr == S_OK)
- ISupportErrorInfo_Release(errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
if (0) /* Crashes on windows */
{
--
2.17.1
Dec. 12, 2019
Re: win32 on macOS
by Ken Thomases
Hi Fabian,
On Dec 11, 2019, at 12:51 PM, Fabian Maurer <dark.shadow4(a)web.de> wrote:
>
> is there any documentation on how the CodeWeavers solution for 32bit
> Applications on Catalina works?
> I'm interested in the technical details of this miracle, but there don't seem
> to be many details out there. What I found was either on the superficial
> level, or a bunch of speculation.
Our solution involves a custom version of the Clang compiler as well as modifications to Wine. It also relies on a new feature of macOS Catalina to allow the creation of 32-bit code segments in a 64-bit process. Our modified versions of Wine and Clang/LLVM are included in our source tarball at <https://www.codeweavers.com/products/more-information/source>. We hope to have a more convenient approach to sharing and collaborating on this in the future.
The custom compiler has a number of features that support building 32-on-64-bit Wine. These features are enabled when you compile with the "-mwine32" architecture option (as opposed to -m32 or -m64). "-mwine32" is a variant of -m64 with additional functionality:
* It knows about both 32- and 64-bit pointers.
* It knows about 32-bit Microsoft calling conventions (cdecl32, stdcall32, thiscall32, fastcall32).
* It will automatically generate 32-to-64-bit thunks for functions with such 32-bit calling conventions.
* A function pointer whose pointee type has a 32-bit calling convention is assumed to point to 32-bit code. When calling through such a pointer, the compiler automatically generates the appropriate 64-to-32-bit thunk. Taking the address of a function with a 32-bit calling convention will yield a pointer to the 32-to-64-bit thunk the compiler generated. As an optimization, the compiler-generated 32-to-64-bit thunks have a recognizable signature and the call-site code can check that to skip the 64-to-32-to-64-bit thunking that would otherwise occur.
* It has a notion of "local" include paths and thus local (Wine) headers vs. external/system headers. It uses this to apply certain defaults to types from external/system headers.
* It defines the macro __i386_on_x86_64__.
Now for some of the nitty-gritty details:
The compiler has a concept of "address spaces", the normal 64-bit one (called, somewhat confusingly, "default" and a 32-bit one (called "ptr32"). It maintains a current implicit stack address space, a current implicit storage address space, and a current implicit pointer address space.
The implicit stack address space tells the compiler where a stack variable lives. The type of the address-of operator applied to a stack variable is a pointer of the appropriate size. If the variable is in the 32-bit address space, then the resulting pointer is 32 bits in size. If it's in the 64-bit address space, the address is a 64-bit pointer. The same thing happens when an array on the stack decays to a pointer.
By default, when compiling with -mwine32, the implicit stack address space is the 32-bit address space. There's a command-line option, -mstack64, to override that.
The compiler does not control where the stack actually is at runtime. So, it's Wine's responsibility to make sure that threads which run code compiled with the 32-bit stack address space actually have their stack in the low 4GB of the process's virtual memory.
The implicit storage address space tells the compiler where static data and code live. So, if you take the address of a static variable or a function, you get a pointer type of the appropriate size. Similarly for string literals.
By default, when compiling with -mwine32, the implicit storage address space is the 32-bit address space. That can be overridden with the command-line option -mstorage-address-space={default | ptr32}. Furthermore, it can be altered in code using:
#pragma clang storage_addr_space({default | ptr32})
#pragma clang storage_addr_space(push, {default | ptr32})
#pragma clang storage_addr_space(pop)
When an external/system header is #include'd, it's as though the content were surrounded by
#pragma clang storage_addr_space(push, default)
…
#pragma clang storage_addr_space(pop)
So, all of the declarations and definitions in such headers are in the default (64-bit) address space.
Again, the compiler does not actually control where in the process's virtual memory a module gets loaded. It's Wine's responsibility to ensure that modules with code compiled with the 32-bit storage address space is actually loaded in the low 4GB.
The implicit pointer address space governs the size of declared pointers.
When a typedef, struct, or union is defined, the pointer address space that's current at the time is remembered. Later, if a pointer to such a type is declared, the pointer is in that remembered address space. So, for example, a Win32 type such as CREATESTRUCTW will be defined in the ptr32 pointer address space, therefore "CREATESTRUCTW *cs" will be a 32-bit pointer. A system type such as struct stat will be defined in the default (64-bit) pointer address space, so "struct stat *st" will be a 64-bit pointer.
A pointer type can be decorated with the __ptr32 or __ptr64 keyword to explicitly declare its size, overriding the logic above. For example, "CREATESTRUCTW * __ptr64 cs" will be a 64-bit pointer.
If neither of the above apply, the pointer's size is dictated by the current implicit pointer address space. So, for "int *foo", foo is a 32-bit pointer if the implicit pointer address space is ptr32, or a 64-bit pointer if it's default.
The implicit pointer address space is "default" (64-bit), by default. This can be overridden with the command-line option "-mdefault-address-space={default | ptr32}". Furthermore, it can be altered in code using:
#pragma clang default_addr_space({default | ptr32})
#pragma clang default_addr_space(push, {default | ptr32})
#pragma clang default_addr_space(pop)
And, again, external/system headers are processed as though their content were surrounded by:
#pragma clang default_addr_space(push, default)
…
#pragma clang default_addr_space(pop)
A big potential source of problems with 32- and 64-bit pointers is accidental truncation by assigning a 64-bit pointer to a 32-bit pointer. So, such assignment is prohibited. Even a normal cast is not enough to allow it. Only a special cast syntax can enable shortening a pointer: foo = (__addrspace Type)bar.
Another potential source of problems is when casting a pointer type to a smaller integer type or casting an integer type to a smaller pointer type. There's a new set of warnings for that (which 32-on-64-bit Wine promotes to errors). There's another special cast syntax to suppress the warning for a specific conversion: foo = (__truncate Type)bar.
The 32-bit calling conventions can be applied to a function type using __attribute__(({cdecl32 | stdcall32 | thiscall32 | fastcall32})). These calling conventions are slightly tweaked for 64-bit code. None of them are callee-pop; they assume the caller will clean up the arguments pushed to the stack. Since 32-bit callers of stdcall32, thiscall32, or fastcall32 functions will have assumed the callee cleans up, that job falls to the 32-to-64-bit thunks the compiler generates. Also, the generated 64-bit code expects 12 extra bytes on the stack between the return address and the stack arguments. (This makes the thunks simpler and more efficient.)
The name of the 32-to-64-bit thunk generated for such a function is <prefix>_thunk_<function name>. The prefix defaults to "__i386_on_x86_64" but that can be overridden with the command-line option "-minterop64-32-thunk-prefix=<whatever>". Wine sets that to "wine", so the thunk name is wine_thunk_<function_name>.
If the code already supplies a definition of a symbol with that name, the compiler treats that as a custom thunk (or alternative 32-bit implementation) and doesn't auto-generate a thunk of its own.
The generated thunks (both 32-to-64-bit and 64-to-32-bit) need to know the code segment selector to use. The compiler assumes two unsigned short variables are defined whose values are those selectors. By default, the variable names are __i386_on_x86_64_cs32 and __i386_on_x86_64_cs64, but those can be overridden with "-minterop64-32-cs32-name=<name>" and "-minterop64-32-cs64-name=<name>". Wine uses "wine_32on64_cs32" and "wine_32on64_cs64". Those variables are defined and initialized in libwine.
Speaking of code segments, the big thing that Catalina provides that enables this all to work is the ability to create 32-bit code segments in a 64-bit process. For that, they enabled the use of i386_set_ldt() in 64-bit processes. The big caveat though, is that this functionality is restricted by System Integrity Protection (SIP). For now, your best bet to get this working for yourself is to disable SIP. (CrossOver doesn't require that, but the mechanism by which we accomplish that is in flux internally to Apple. When it settles down, I'll update this thread.)
All of that in place, the rest of the work was modifying Wine to use this compiler and OS functionality. That largely consisted of fixing the compilation errors resulting from the interfacing of system libraries (using 64-bit pointers) and Win32 APIs (using 32-bit pointers). Also, everywhere there was an architecture dependency had to be reviewed and possibly altered. That, of course, includes all assembly language code.
As long as this email is, I'm sure I've forgotten or glossed over some stuff. Feel free to ask questions.
Cheers,
Ken
Dec. 12, 2019
[PATCH 9/9] dmcompos: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmcompos/chordmap.c | 4 +-
dlls/dmcompos/composer.c | 1 +
dlls/dmcompos/dmcompos_main.c | 265 +------------------------------
dlls/dmcompos/dmcompos_private.h | 22 ---
dlls/dmcompos/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmcompos/dmobject.h | 14 +-
6 files changed, 258 insertions(+), 295 deletions(-)
diff --git a/dlls/dmcompos/chordmap.c b/dlls/dmcompos/chordmap.c
index 5296970b56..c58857e04c 100644
--- a/dlls/dmcompos/chordmap.c
+++ b/dlls/dmcompos/chordmap.c
@@ -129,7 +129,9 @@ static HRESULT WINAPI chord_IDirectMusicObject_ParseDescriptor(IDirectMusicObjec
desc->guidClass = CLSID_DirectMusicChordMap;
desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc));
+ TRACE("returning descriptor:\n");
+ dump_DMUS_OBJECTDESC(desc);
+
return S_OK;
}
diff --git a/dlls/dmcompos/composer.c b/dlls/dmcompos/composer.c
index f2d826020d..9fbe1689c6 100644
--- a/dlls/dmcompos/composer.c
+++ b/dlls/dmcompos/composer.c
@@ -18,6 +18,7 @@
*/
#include "dmcompos_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c
index 3428a58b91..b8b3c5d6d2 100644
--- a/dlls/dmcompos/dmcompos_main.c
+++ b/dlls/dmcompos/dmcompos_main.c
@@ -33,6 +33,7 @@
#include "dmusici.h"
#include "dmcompos_private.h"
+#include "dmobject.h"
#include "rpcproxy.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@@ -213,267 +214,3 @@ HRESULT WINAPI DllUnregisterServer(void)
*
*
*/
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++)
- {
- if ((flags & names[i].val) || /* standard flag*/
- ((!flags) && (!names[i].val))) { /* zero value only */
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- return wine_dbg_sprintf("%s", buffer);
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* dump whole DMUS_OBJECTDESC struct */
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- char buffer[1024] = "", *ptr = &buffer[0];
-
- ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
- ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
- ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n");
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
-
- return wine_dbg_sprintf("%s", buffer);
- } else {
- return wine_dbg_sprintf("(NULL)");
- }
-}
diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h
index 1958c27378..98796875b8 100644
--- a/dlls/dmcompos/dmcompos_private.h
+++ b/dlls/dmcompos/dmcompos_private.h
@@ -65,26 +65,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMCOMPOS_PRIVATE_H */
diff --git a/dlls/dmcompos/dmobject.c b/dlls/dmcompos/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmcompos/dmobject.c
+++ b/dlls/dmcompos/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmcompos/dmobject.h b/dlls/dmcompos/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmcompos/dmobject.h
+++ b/dlls/dmcompos/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
Dec. 12, 2019
[PATCH 8/9] dmime: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmime/dmime_main.c | 1 +
dlls/dmime/dmobject.c | 247 ++++++++++++++++++++++++++++++-
dlls/dmime/dmobject.h | 14 +-
dlls/dmime/dmutils.c | 302 +-------------------------------------
dlls/dmime/dmutils.h | 26 ----
dlls/dmime/performance.c | 1 +
dlls/dmime/segmentstate.c | 1 +
7 files changed, 257 insertions(+), 335 deletions(-)
diff --git a/dlls/dmime/dmime_main.c b/dlls/dmime/dmime_main.c
index 37302ff0eb..1749bbe69d 100644
--- a/dlls/dmime/dmime_main.c
+++ b/dlls/dmime/dmime_main.c
@@ -34,6 +34,7 @@
#include "dmusici.h"
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/dmobject.c b/dlls/dmime/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmime/dmobject.c
+++ b/dlls/dmime/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmime/dmobject.h b/dlls/dmime/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmime/dmobject.h
+++ b/dlls/dmime/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c
index cd955fd8a5..a61fd5a463 100644
--- a/dlls/dmime/dmutils.c
+++ b/dlls/dmime/dmutils.c
@@ -39,9 +39,9 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
-WINE_DECLARE_DEBUG_CHANNEL(dmime);
static HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
@@ -161,303 +161,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc)
-{
- if (!TRACE_ON(dmime))
- return;
-
- if (pDesc) {
- TRACE_(dmime)("DMUS_OBJECTDESC (%p):", pDesc);
- TRACE_(dmime)(" - dwSize = 0x%08X\n", pDesc->dwSize);
- TRACE_(dmime)(" - dwValidData = 0x%08X ( %s)\n", pDesc->dwValidData, debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS)
- TRACE_(dmime)(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
- TRACE_(dmime)(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE)
- TRACE_(dmime)(" - ftDate = %s\n", debugstr_filetime (&pDesc->ftDate));
- if (pDesc->dwValidData & DMUS_OBJ_VERSION)
- TRACE_(dmime)(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_NAME)
- TRACE_(dmime)(" - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
- TRACE_(dmime)(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
- TRACE_(dmime)(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY)
- TRACE_(dmime)(" - llMemLength = 0x%s - pbMemData = %p\n", wine_dbgstr_longlong(pDesc->llMemLength),
- pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM)
- TRACE_(dmime)(" - pStream = %p\n", pDesc->pStream);
- }
-}
diff --git a/dlls/dmime/dmutils.h b/dlls/dmime/dmutils.h
index 7242746031..913bccfabd 100644
--- a/dlls/dmime/dmutils.h
+++ b/dlls/dmime/dmutils.h
@@ -32,30 +32,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
*/
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-
-/* dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
index 399b9b9919..615a3f8b14 100644
--- a/dlls/dmime/performance.c
+++ b/dlls/dmime/performance.c
@@ -19,6 +19,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c
index b1b176ca5c..edd7ed70f0 100644
--- a/dlls/dmime/segmentstate.c
+++ b/dlls/dmime/segmentstate.c
@@ -18,6 +18,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
--
2.23.0
Dec. 12, 2019
[PATCH 7/9] dmloader: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 1 -
dlls/dmloader/debug.c | 270 -------------------------------
dlls/dmloader/debug.h | 16 --
dlls/dmloader/dmloader_private.h | 1 +
dlls/dmloader/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmloader/dmobject.h | 14 +-
6 files changed, 254 insertions(+), 295 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index 075843ad32..005f0d7e9e 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -18,7 +18,6 @@
*/
#include "dmloader_private.h"
-#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 10ba0bce93..0d274394aa 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -20,8 +20,6 @@
#include "dmloader_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
-
/* figures out whether given FOURCC is valid DirectMusic form ID */
BOOL IS_VALID_DMFORM (FOURCC chunkID) {
if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM)
@@ -45,237 +43,6 @@ const char *resolve_STREAM_SEEK (DWORD flag) {
}
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
/* returns name of given error code */
const char *debugstr_dmreturn (DWORD code) {
static const flag_info codes[] = {
@@ -443,25 +210,6 @@ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t n
return ptr;
}
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
/* dump DMUS_CONTAINER flags */
static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
@@ -478,24 +226,6 @@ static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
}
-/* Dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc)
-{
- TRACE("DMUS_OBJECTDESC (%p):\n", desc);
- TRACE(" - dwSize = %d\n", desc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (desc->dwValidData));
- if (desc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
- if (desc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
- if (desc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = %s\n", debugstr_filetime (&desc->ftDate));
- if (desc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&desc->vVersion));
- if (desc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(desc->wszName));
- if (desc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
- if (desc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
- if (desc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
- if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream);
-}
-
const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) {
if (pHeader) {
char buffer[1024], *ptr = buffer;
diff --git a/dlls/dmloader/debug.h b/dlls/dmloader/debug.h
index 40af340ccf..fec35cfbff 100644
--- a/dlls/dmloader/debug.h
+++ b/dlls/dmloader/debug.h
@@ -26,11 +26,6 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
/* used for initialising structs */
#define DM_STRUCT_INIT(x) \
do { \
@@ -39,25 +34,14 @@ typedef struct {
} while (0)
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
/* check whether chunkID is valid dmobject form chunk */
extern BOOL IS_VALID_DMFORM (FOURCC chunkID) DECLSPEC_HIDDEN;
/* translate STREAM_SEEK flag to string */
extern const char *resolve_STREAM_SEEK (DWORD flag) DECLSPEC_HIDDEN;
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* DMUS_VERSION struct to string conversion for debug messages */
-extern const char *debugstr_dmversion (const DMUS_VERSION *version) DECLSPEC_HIDDEN;
-/* FILETIME struct to string conversion for debug messages */
-extern const char *debugstr_filetime (const FILETIME *time) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
/* returns name of given error code */
extern const char *debugstr_dmreturn (DWORD code) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) DECLSPEC_HIDDEN;
diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h
index a8505003c7..94bb9ddf1b 100644
--- a/dlls/dmloader/dmloader_private.h
+++ b/dlls/dmloader/dmloader_private.h
@@ -40,6 +40,7 @@
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
+#include "dmobject.h"
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
diff --git a/dlls/dmloader/dmobject.c b/dlls/dmloader/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmloader/dmobject.c
+++ b/dlls/dmloader/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmloader/dmobject.h b/dlls/dmloader/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmloader/dmobject.h
+++ b/dlls/dmloader/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
Dec. 12, 2019