You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
73 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c3138a19dc | ||
|
5af9636365 | ||
|
fd175dc863 | ||
|
2b119ef030 | ||
|
c4b73e1752 | ||
|
424cc0395c | ||
|
298af8f9fe | ||
|
416f7f3bb5 | ||
|
8321c62f24 | ||
|
d452acf61b | ||
|
663c3ba497 | ||
|
4242749b5b | ||
|
7d08bb86e1 | ||
|
28fad42582 | ||
|
68c50a8fb4 | ||
|
47035cfbf5 | ||
|
8e20899551 | ||
|
03290f8a41 | ||
|
c811ed7bd9 | ||
|
d9eb78e597 | ||
|
150ce22fa2 | ||
|
eae4093bf8 | ||
|
621cf69c80 | ||
|
bc6c681225 | ||
|
46420edcd0 | ||
|
af56d3821a | ||
|
32082f4d6f | ||
|
59e6a606b9 | ||
|
bf043458ba | ||
|
7c1249e5c0 | ||
|
3b24c1cf1d | ||
|
eb32fd78ae | ||
|
e4a11b1663 | ||
|
90d57326b5 | ||
|
b71d588d78 | ||
|
bafd1bfc74 | ||
|
23ae4e6c7a | ||
|
6ecb8df033 | ||
|
364ce82bd1 | ||
|
261a981d77 | ||
|
f7013bb1b4 | ||
|
99c296e10c | ||
|
02be23fa52 | ||
|
352d5a391b | ||
|
4373a1011e | ||
|
26d3815d8c | ||
|
54ae005107 | ||
|
0e493bcef1 | ||
|
ee89d77f18 | ||
|
4ffe305c90 | ||
|
1a87edb76b | ||
|
914f67c020 | ||
|
c3c5d48b18 | ||
|
884f646404 | ||
|
5c4729e4ce | ||
|
103195f07d | ||
|
3acacd0ee1 | ||
|
d2d0366ce5 | ||
|
913b39b117 | ||
|
4d315a6098 | ||
|
5e5dafe07a | ||
|
bb79717d86 | ||
|
b1219b7fae | ||
|
046f6604b7 | ||
|
f6954e6e77 | ||
|
553c1cff5a | ||
|
4ef21bcf82 | ||
|
ebbd01086e | ||
|
b1765ff74e | ||
|
21a97e1f88 | ||
|
4f13965432 | ||
|
3dd8d0e647 | ||
|
3f3a05f91c |
30
README.md
30
README.md
@@ -79,4 +79,32 @@ Contributing
|
||||
|
||||
For information on contributing to Wine-Staging, please see
|
||||
<https://wiki.winehq.org/Wine-Staging_Contributing>. Note that GitHub pull
|
||||
requests are strongly dispreferred, especially for patches.
|
||||
requests are strongly dispreferred, especially for patches.
|
||||
|
||||
Donations
|
||||
---------
|
||||
|
||||
wine-staging is a large set of experimental patches which provide various
|
||||
improvements to WINE, but are not quite suitable for upstreaming. This set of
|
||||
patches has been continuously managed for many years by a small group of
|
||||
volunteers. The way this works is that we often review patches attached to
|
||||
various bug reports found at https://bugs.winehq.org/ which may fix bugs, but
|
||||
may not be quite suitable to be upstreamed due to needing some cleanup or more
|
||||
proper implementation. In the event that this happens, we add the patches to
|
||||
wine-staging instead, and keep them updated and maintained as well as attempt to
|
||||
clean them up to be upstreamed. We also both write and verify patches which fix
|
||||
various bugs that may not have patches, and in turn allow them run better using
|
||||
WINE. This includes testing on various hardware, games, and applications.
|
||||
|
||||
Any expenses for applications, games, or hardware which we do not own comes out
|
||||
of pocket. In order to alleviate these expenses, we are now accepting donations.
|
||||
This in turn allows us to continue to perform testing, provide fixes, and get
|
||||
them upstreamed, ultimately aiming to provide a better experience for all WINE
|
||||
users. All of our work is provided publicly for free and can be found at
|
||||
<https://github.com/wine-staging/wine-staging>. We do not expect to be paid for
|
||||
any of the work provided, nor will donators receive any special benefits or
|
||||
compensation.
|
||||
|
||||
Donations are recieved through Patreon. Anyone interested may donate here:
|
||||
|
||||
https://www.patreon.com/winestaging
|
@@ -1,4 +1,4 @@
|
||||
From 599c50c9e339fe04e96fdb665b3d7ccb1a7708b7 Mon Sep 17 00:00:00 2001
|
||||
From eea7dea0e9488f8afc56b880d3d5f67d0b3d9f5c Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 29 May 2014 23:43:45 +0200
|
||||
Subject: [PATCH] loader: Add commandline option --patches to show the patch
|
||||
@@ -12,17 +12,17 @@ Subject: [PATCH] loader: Add commandline option --patches to show the patch
|
||||
4 files changed, 49 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/wine/library.h b/include/wine/library.h
|
||||
index 090b8349559..b8a4a2df576 100644
|
||||
index 405ce0d9da3..eecb770b455 100644
|
||||
--- a/include/wine/library.h
|
||||
+++ b/include/wine/library.h
|
||||
@@ -42,6 +42,7 @@ extern "C" {
|
||||
@@ -41,6 +41,7 @@ extern "C" {
|
||||
|
||||
/* configuration */
|
||||
|
||||
extern const char *wine_get_version(void);
|
||||
+extern const void *wine_get_patches(void);
|
||||
extern const char *wine_get_build_id(void);
|
||||
extern void wine_init_argv0_path( const char *argv0 );
|
||||
extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var );
|
||||
|
||||
diff --git a/libs/wine/config.c b/libs/wine/config.c
|
||||
index f5b4c0de9af..e52739d55ad 100644
|
||||
--- a/libs/wine/config.c
|
||||
@@ -53,10 +53,10 @@ index 1143b129734..55f874d3e74 100644
|
||||
wine_init_argv0_path;
|
||||
wine_mmap_add_reserved_area;
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index 0e6b6f66b50..24bcfff8c4c 100644
|
||||
index a92276fa412..00b02e23c26 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -55,7 +55,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -57,7 +57,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
static const char usage[] =
|
||||
"Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n"
|
||||
" wine --help Display this help and exit\n"
|
||||
@@ -66,7 +66,7 @@ index 0e6b6f66b50..24bcfff8c4c 100644
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -72,6 +73,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -74,6 +75,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
printf( "%s\n", wine_get_build_id() );
|
||||
exit(0);
|
||||
}
|
||||
@@ -113,5 +113,5 @@ index 0e6b6f66b50..24bcfff8c4c 100644
|
||||
|
||||
|
||||
--
|
||||
2.26.2
|
||||
2.28.0
|
||||
|
||||
|
@@ -1,29 +1,43 @@
|
||||
From 1eb8acd819f9eee8fdf154d0ef43881008265916 Mon Sep 17 00:00:00 2001
|
||||
From 1b222275e7faf71ae1e5c94e297004055ec6f82f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Aug 2017 02:33:14 +0200
|
||||
Subject: ntdll: Implement NtFilterToken.
|
||||
Subject: [PATCH] ntdll: Implement NtFilterToken.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 59 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/ntdll.spec | 2 +-
|
||||
include/winnt.h | 5 +++
|
||||
include/winternl.h | 1 +
|
||||
server/process.c | 2 +-
|
||||
server/protocol.def | 10 ++++++
|
||||
server/security.h | 4 ++-
|
||||
server/token.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
8 files changed, 162 insertions(+), 5 deletions(-)
|
||||
dlls/ntdll/ntdll.spec | 2 +-
|
||||
dlls/ntdll/unix/security.c | 64 +++++++++++++++++++++++++++++
|
||||
include/winnt.h | 5 +++
|
||||
include/winternl.h | 1 +
|
||||
server/named_pipe.c | 2 +-
|
||||
server/process.c | 2 +-
|
||||
server/protocol.def | 10 +++++
|
||||
server/security.h | 4 +-
|
||||
server/token.c | 84 +++++++++++++++++++++++++++++++++++++-
|
||||
9 files changed, 168 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index c3f5df3..59a08de 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -119,6 +119,65 @@ NTSTATUS WINAPI NtDuplicateToken(
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index a3bc57716da..f604c8a3c35 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -208,7 +208,7 @@
|
||||
# @ stub NtEnumerateSystemEnvironmentValuesEx
|
||||
@ stdcall -syscall NtEnumerateValueKey(long long long ptr long ptr)
|
||||
@ stub NtExtendSection
|
||||
-# @ stub NtFilterToken
|
||||
+@ stdcall -syscall NtFilterToken(long long ptr ptr ptr ptr)
|
||||
@ stdcall -syscall NtFindAtom(ptr long ptr)
|
||||
@ stdcall -syscall NtFlushBuffersFile(long ptr)
|
||||
@ stdcall -syscall NtFlushInstructionCache(long ptr long)
|
||||
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
|
||||
index daecc5e0591..d063d43d6d4 100644
|
||||
--- a/dlls/ntdll/unix/security.c
|
||||
+++ b/dlls/ntdll/unix/security.c
|
||||
@@ -604,6 +604,70 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( HANDLE token, BOOLEAN disable, TOKEN_PR
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
+ * NtFilterToken [NTDLL.@]
|
||||
+ * ZwFilterToken [NTDLL.@]
|
||||
|
||||
+/***********************************************************************
|
||||
+ * NtFilterToken (NTDLL.@)
|
||||
+ */
|
||||
+NTSTATUS WINAPI NtFilterToken( HANDLE token, ULONG flags, TOKEN_GROUPS *disable_sids,
|
||||
+ TOKEN_PRIVILEGES *privileges, TOKEN_GROUPS *restrict_sids,
|
||||
@@ -52,14 +66,18 @@ index c3f5df3..59a08de 100644
|
||||
+ BYTE *tmp;
|
||||
+
|
||||
+ for (i = 0; i < disable_sids->GroupCount; i++)
|
||||
+ sids_len += RtlLengthSid( disable_sids->Groups[i].Sid );
|
||||
+ {
|
||||
+ SID *sid = disable_sids->Groups[i].Sid;
|
||||
+ sids_len += offsetof( SID, SubAuthority[sid->SubAuthorityCount] );
|
||||
+ }
|
||||
+
|
||||
+ sids = RtlAllocateHeap( GetProcessHeap(), 0, sids_len );
|
||||
+ sids = malloc( sids_len );
|
||||
+ if (!sids) return STATUS_NO_MEMORY;
|
||||
+
|
||||
+ for (i = 0, tmp = (BYTE *)sids; i < disable_sids->GroupCount; i++, tmp += len)
|
||||
+ {
|
||||
+ len = RtlLengthSid( disable_sids->Groups[i].Sid );
|
||||
+ SID *sid = disable_sids->Groups[i].Sid;
|
||||
+ len = offsetof( SID, SubAuthority[sid->SubAuthorityCount] );
|
||||
+ memcpy( tmp, disable_sids->Groups[i].Sid, len );
|
||||
+ }
|
||||
+ }
|
||||
@@ -76,32 +94,20 @@ index c3f5df3..59a08de 100644
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+
|
||||
+ RtlFreeHeap( GetProcessHeap(), 0, sids );
|
||||
+ free( sids );
|
||||
+ return status;
|
||||
+}
|
||||
+
|
||||
+/******************************************************************************
|
||||
* NtOpenProcessToken [NTDLL.@]
|
||||
* ZwOpenProcessToken [NTDLL.@]
|
||||
+
|
||||
+
|
||||
/***********************************************************************
|
||||
* NtPrivilegeCheck (NTDLL.@)
|
||||
*/
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index c260b0d..3c5e69c 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -176,7 +176,7 @@
|
||||
# @ stub NtEnumerateSystemEnvironmentValuesEx
|
||||
@ stdcall NtEnumerateValueKey(long long long ptr long ptr)
|
||||
@ stub NtExtendSection
|
||||
-# @ stub NtFilterToken
|
||||
+@ stdcall NtFilterToken(long long ptr ptr ptr ptr)
|
||||
@ stdcall NtFindAtom(ptr long ptr)
|
||||
@ stdcall NtFlushBuffersFile(long ptr)
|
||||
@ stdcall NtFlushInstructionCache(long ptr long)
|
||||
diff --git a/include/winnt.h b/include/winnt.h
|
||||
index 16d96d8..4e238f9 100644
|
||||
index e1cf78420a6..da17fe3e330 100644
|
||||
--- a/include/winnt.h
|
||||
+++ b/include/winnt.h
|
||||
@@ -3904,6 +3904,11 @@ typedef enum _TOKEN_INFORMATION_CLASS {
|
||||
@@ -4221,6 +4221,11 @@ typedef enum _TOKEN_INFORMATION_CLASS {
|
||||
TOKEN_ADJUST_SESSIONID | \
|
||||
TOKEN_ADJUST_DEFAULT )
|
||||
|
||||
@@ -114,10 +120,10 @@ index 16d96d8..4e238f9 100644
|
||||
#define _SECURITY_DEFINED
|
||||
|
||||
diff --git a/include/winternl.h b/include/winternl.h
|
||||
index c84e6d7..288f93e 100644
|
||||
index b3fbb90feff..4687a410ca4 100644
|
||||
--- a/include/winternl.h
|
||||
+++ b/include/winternl.h
|
||||
@@ -2303,6 +2303,7 @@ NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES
|
||||
@@ -2749,6 +2749,7 @@ NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES
|
||||
NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
|
||||
NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
|
||||
NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
|
||||
@@ -125,11 +131,24 @@ index c84e6d7..288f93e 100644
|
||||
NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
|
||||
NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
|
||||
NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
|
||||
diff --git a/server/named_pipe.c b/server/named_pipe.c
|
||||
index b259abb8de4..4cd4d7dc4a8 100644
|
||||
--- a/server/named_pipe.c
|
||||
+++ b/server/named_pipe.c
|
||||
@@ -1142,7 +1142,7 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
|
||||
if (current->process->token) /* FIXME: use the client token */
|
||||
{
|
||||
struct token *token;
|
||||
- if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL )))
|
||||
+ if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL, NULL, 0, NULL, 0 )))
|
||||
return 0;
|
||||
if (current->token) release_object( current->token );
|
||||
current->token = token;
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index f8739d0..71d9d6d 100644
|
||||
index 5e587b28cbe..406167e825b 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -566,7 +566,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
|
||||
@@ -577,7 +577,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
: alloc_handle_table( process, 0 );
|
||||
/* Note: for security reasons, starting a new process does not attempt
|
||||
* to use the current impersonation token for the new process */
|
||||
@@ -139,10 +158,10 @@ index f8739d0..71d9d6d 100644
|
||||
}
|
||||
if (!process->handles || !process->token) goto error;
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 35824ae..6ee6d28 100644
|
||||
index a121c371c19..ee07b1eca14 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3356,6 +3356,16 @@ enum caret_state
|
||||
@@ -3263,6 +3263,16 @@ enum caret_state
|
||||
obj_handle_t new_handle; /* duplicated handle */
|
||||
@END
|
||||
|
||||
@@ -160,10 +179,10 @@ index 35824ae..6ee6d28 100644
|
||||
obj_handle_t handle; /* handle to the token */
|
||||
unsigned int desired_access; /* desired access to the object */
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 873bbc6..bc4a8f6 100644
|
||||
index 606dbb2ab2c..6c337143c3d 100644
|
||||
--- a/server/security.h
|
||||
+++ b/server/security.h
|
||||
@@ -55,7 +55,9 @@ extern const PSID security_high_label_sid;
|
||||
@@ -56,7 +56,9 @@ extern const PSID security_high_label_sid;
|
||||
extern struct token *token_create_admin(void);
|
||||
extern int token_assign_label( struct token *token, PSID label );
|
||||
extern struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -175,10 +194,10 @@ index 873bbc6..bc4a8f6 100644
|
||||
const LUID_AND_ATTRIBUTES *reqprivs,
|
||||
unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 0810a61..2f6a467 100644
|
||||
index 2fa95e17aaf..38a4c203d54 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -276,6 +276,19 @@ static int acl_is_valid( const ACL *acl, data_size_t size )
|
||||
@@ -285,6 +285,19 @@ static int acl_is_valid( const ACL *acl, data_size_t size )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -198,7 +217,7 @@ index 0810a61..2f6a467 100644
|
||||
/* checks whether all members of a security descriptor fit inside the size
|
||||
* of memory specified */
|
||||
int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
|
||||
@@ -619,8 +632,36 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -626,8 +639,36 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -236,7 +255,7 @@ index 0810a61..2f6a467 100644
|
||||
{
|
||||
const luid_t *modified_id =
|
||||
primary || (impersonation_level == src_token->impersonation_level) ?
|
||||
@@ -656,6 +697,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -663,6 +704,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
return NULL;
|
||||
}
|
||||
memcpy( newgroup, group, size );
|
||||
@@ -249,7 +268,7 @@ index 0810a61..2f6a467 100644
|
||||
list_add_tail( &token->groups, &newgroup->entry );
|
||||
if (src_token->primary_group == &group->sid)
|
||||
{
|
||||
@@ -667,11 +714,14 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -674,11 +721,14 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
|
||||
/* copy privileges */
|
||||
LIST_FOR_EACH_ENTRY( privilege, &src_token->privileges, struct privilege, entry )
|
||||
@@ -264,7 +283,7 @@ index 0810a61..2f6a467 100644
|
||||
|
||||
if (sd) default_set_sd( &token->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
|
||||
@@ -1304,7 +1354,7 @@ DECL_HANDLER(duplicate_token)
|
||||
@@ -1311,7 +1361,7 @@ DECL_HANDLER(duplicate_token)
|
||||
TOKEN_DUPLICATE,
|
||||
&token_ops )))
|
||||
{
|
||||
@@ -273,7 +292,7 @@ index 0810a61..2f6a467 100644
|
||||
if (token)
|
||||
{
|
||||
reply->new_handle = alloc_handle_no_access_check( current->process, token, req->access, objattr->attributes );
|
||||
@@ -1314,6 +1364,36 @@ DECL_HANDLER(duplicate_token)
|
||||
@@ -1321,6 +1371,36 @@ DECL_HANDLER(duplicate_token)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,5 +330,5 @@ index 0810a61..2f6a467 100644
|
||||
DECL_HANDLER(check_token_privileges)
|
||||
{
|
||||
--
|
||||
2.7.4
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,38 +1,39 @@
|
||||
From c8dc0ec6406e8449b59c219ede2e9bd88d8a56fa Mon Sep 17 00:00:00 2001
|
||||
From d2e98b2054a5af671fd81ded32f2cf60a062312c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 00:26:03 +0200
|
||||
Subject: [PATCH] server: Implement token elevation information.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 16 ++++++++++++----
|
||||
server/protocol.def | 8 ++++++++
|
||||
server/token.c | 22 +++++++++++++++++++---
|
||||
dlls/ntdll/unix/security.c | 16 ++++++++++++----
|
||||
server/protocol.def | 8 ++++++++
|
||||
server/token.c | 22 +++++++++++++++++++---
|
||||
3 files changed, 39 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index cd271fde9c..b1dd999cf5 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -625,18 +625,26 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
SERVER_END_REQ;
|
||||
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
|
||||
index d063d43d6d4..03a81afa46e 100644
|
||||
--- a/dlls/ntdll/unix/security.c
|
||||
+++ b/dlls/ntdll/unix/security.c
|
||||
@@ -390,19 +390,27 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
|
||||
break;
|
||||
|
||||
case TokenElevationType:
|
||||
+ SERVER_START_REQ( get_token_elevation_type )
|
||||
{
|
||||
TOKEN_ELEVATION_TYPE *elevation_type = tokeninfo;
|
||||
TOKEN_ELEVATION_TYPE *type = info;
|
||||
- FIXME("QueryInformationToken( ..., TokenElevationType, ...) semi-stub\n");
|
||||
- *elevation_type = TokenElevationTypeFull;
|
||||
- *type = TokenElevationTypeFull;
|
||||
+ req->handle = wine_server_obj_handle( token );
|
||||
+ status = wine_server_call( req );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ *elevation_type = reply->elevation;
|
||||
+ *type = reply->elevation;
|
||||
}
|
||||
+ SERVER_END_REQ;
|
||||
break;
|
||||
|
||||
case TokenElevation:
|
||||
+ SERVER_START_REQ( get_token_elevation_type )
|
||||
{
|
||||
TOKEN_ELEVATION *elevation = tokeninfo;
|
||||
TOKEN_ELEVATION *elevation = info;
|
||||
- FIXME("QueryInformationToken( ..., TokenElevation, ...) semi-stub\n");
|
||||
- elevation->TokenIsElevated = TRUE;
|
||||
+ req->handle = wine_server_obj_handle( token );
|
||||
@@ -42,13 +43,13 @@ index cd271fde9c..b1dd999cf5 100644
|
||||
}
|
||||
+ SERVER_END_REQ;
|
||||
break;
|
||||
|
||||
case TokenSessionId:
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 90af9df7f4..93afaabca1 100644
|
||||
index ee07b1eca14..84f0b577d72 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3643,6 +3643,14 @@ struct handle_info
|
||||
@@ -3566,6 +3566,14 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -64,10 +65,10 @@ index 90af9df7f4..93afaabca1 100644
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 6d193603b4..64f20e1b57 100644
|
||||
index 38a4c203d54..14343637af5 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -112,6 +112,7 @@ struct token
|
||||
@@ -110,6 +110,7 @@ struct token
|
||||
ACL *default_dacl; /* the default DACL to assign to objects created by this user */
|
||||
TOKEN_SOURCE source; /* source of the token */
|
||||
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
|
||||
@@ -75,7 +76,7 @@ index 6d193603b4..64f20e1b57 100644
|
||||
};
|
||||
|
||||
struct privilege
|
||||
@@ -545,7 +546,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -552,7 +553,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
|
||||
const ACL *default_dacl, TOKEN_SOURCE source,
|
||||
const luid_t *modified_id,
|
||||
@@ -84,7 +85,7 @@ index 6d193603b4..64f20e1b57 100644
|
||||
{
|
||||
struct token *token = alloc_object( &token_ops );
|
||||
if (token)
|
||||
@@ -567,6 +568,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -574,6 +575,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
token->impersonation_level = impersonation_level;
|
||||
token->default_dacl = NULL;
|
||||
token->primary_group = NULL;
|
||||
@@ -92,7 +93,7 @@ index 6d193603b4..64f20e1b57 100644
|
||||
|
||||
/* copy user */
|
||||
token->user = memdup( user, security_sid_len( user ));
|
||||
@@ -682,7 +684,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -689,7 +691,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
token = create_token( primary, src_token->user, NULL, 0,
|
||||
NULL, 0, src_token->default_dacl,
|
||||
src_token->source, modified_id,
|
||||
@@ -102,7 +103,7 @@ index 6d193603b4..64f20e1b57 100644
|
||||
if (!token) return token;
|
||||
|
||||
/* copy groups */
|
||||
@@ -888,7 +891,7 @@ struct token *token_create_admin( void )
|
||||
@@ -895,7 +898,7 @@ struct token *token_create_admin( void )
|
||||
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
|
||||
token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ),
|
||||
admin_privs, ARRAY_SIZE( admin_privs ), default_dacl,
|
||||
@@ -111,7 +112,7 @@ index 6d193603b4..64f20e1b57 100644
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
}
|
||||
@@ -1627,6 +1630,19 @@ DECL_HANDLER(get_token_statistics)
|
||||
@@ -1634,6 +1637,19 @@ DECL_HANDLER(get_token_statistics)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,5 +133,5 @@ index 6d193603b4..64f20e1b57 100644
|
||||
{
|
||||
struct token *token;
|
||||
--
|
||||
2.19.1
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,19 +1,19 @@
|
||||
From ae503e8e7eb8f4fcb9bf3e642458c2a1bba6ccaa Mon Sep 17 00:00:00 2001
|
||||
From 6dc1b7d9e533379133857629bb9c09e1045a9020 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 02:28:35 +0200
|
||||
Subject: [PATCH] server: Implement token integrity level.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 23 ++++++++++++++---------
|
||||
server/protocol.def | 7 +++++++
|
||||
server/token.c | 30 +++++++++++++++++++++++++++---
|
||||
dlls/ntdll/unix/security.c | 23 ++++++++++++++---------
|
||||
server/protocol.def | 7 +++++++
|
||||
server/token.c | 30 +++++++++++++++++++++++++++---
|
||||
3 files changed, 48 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index ca26ab15..8aab0a48 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -400,7 +400,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
|
||||
index 03a81afa46e..f0057116dee 100644
|
||||
--- a/dlls/ntdll/unix/security.c
|
||||
+++ b/dlls/ntdll/unix/security.c
|
||||
@@ -172,7 +172,7 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
|
||||
0, /* TokenAccessInformation */
|
||||
0, /* TokenVirtualizationAllowed */
|
||||
sizeof(DWORD), /* TokenVirtualizationEnabled */
|
||||
@@ -22,9 +22,9 @@ index ca26ab15..8aab0a48 100644
|
||||
0, /* TokenUIAccess */
|
||||
0, /* TokenMandatoryPolicy */
|
||||
0, /* TokenLogonSid */
|
||||
@@ -659,18 +659,23 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
}
|
||||
@@ -428,18 +428,23 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
|
||||
break;
|
||||
|
||||
case TokenIntegrityLevel:
|
||||
+ SERVER_START_REQ( get_token_integrity )
|
||||
{
|
||||
@@ -32,14 +32,14 @@ index ca26ab15..8aab0a48 100644
|
||||
- static const SID high_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
|
||||
- {SECURITY_MANDATORY_HIGH_RID}};
|
||||
-
|
||||
TOKEN_MANDATORY_LABEL *tml = tokeninfo;
|
||||
TOKEN_MANDATORY_LABEL *tml = info;
|
||||
- PSID psid = tml + 1;
|
||||
+ PSID sid = tml + 1;
|
||||
+ DWORD sid_len = tokeninfolength < sizeof(*tml) ? 0 : tokeninfolength - sizeof(*tml);
|
||||
+ DWORD sid_len = length < sizeof(*tml) ? 0 : length - sizeof(*tml);
|
||||
|
||||
- tml->Label.Sid = psid;
|
||||
- tml->Label.Attributes = SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED;
|
||||
- memcpy(psid, &high_level, sizeof(SID));
|
||||
- memcpy( psid, &high_level, sizeof(SID) );
|
||||
+ req->handle = wine_server_obj_handle( token );
|
||||
+ wine_server_set_reply( req, sid, sid_len );
|
||||
+ status = wine_server_call( req );
|
||||
@@ -52,13 +52,13 @@ index ca26ab15..8aab0a48 100644
|
||||
}
|
||||
+ SERVER_END_REQ;
|
||||
break;
|
||||
|
||||
case TokenAppContainerSid:
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 11221d7d..1bfe3234 100644
|
||||
index 84f0b577d72..4d37a0df348 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3405,6 +3405,13 @@ enum caret_state
|
||||
@@ -3296,6 +3296,13 @@ enum caret_state
|
||||
VARARG(sid,SID); /* the sid specified by which_sid from the token */
|
||||
@END
|
||||
|
||||
@@ -73,10 +73,10 @@ index 11221d7d..1bfe3234 100644
|
||||
obj_handle_t handle; /* handle to the token */
|
||||
@REPLY
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index ccde0c2d..2d81118a 100644
|
||||
index 7c510fbdad9..d267991f751 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -113,6 +113,7 @@ struct token
|
||||
@@ -111,6 +111,7 @@ struct token
|
||||
TOKEN_SOURCE source; /* source of the token */
|
||||
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
|
||||
TOKEN_ELEVATION_TYPE elevation; /* elevation level */
|
||||
@@ -84,7 +84,7 @@ index ccde0c2d..2d81118a 100644
|
||||
};
|
||||
|
||||
struct privilege
|
||||
@@ -546,7 +547,8 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -553,7 +554,8 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
|
||||
const ACL *default_dacl, TOKEN_SOURCE source,
|
||||
const luid_t *modified_id,
|
||||
@@ -94,7 +94,7 @@ index ccde0c2d..2d81118a 100644
|
||||
{
|
||||
struct token *token = alloc_object( &token_ops );
|
||||
if (token)
|
||||
@@ -630,6 +632,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -637,6 +639,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
}
|
||||
|
||||
token->source = source;
|
||||
@@ -102,7 +102,7 @@ index ccde0c2d..2d81118a 100644
|
||||
}
|
||||
return token;
|
||||
}
|
||||
@@ -685,7 +688,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -692,7 +695,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
NULL, 0, src_token->default_dacl,
|
||||
src_token->source, modified_id,
|
||||
impersonation_level,
|
||||
@@ -112,7 +112,7 @@ index ccde0c2d..2d81118a 100644
|
||||
if (!token) return token;
|
||||
|
||||
/* copy groups */
|
||||
@@ -890,7 +894,7 @@ struct token *token_create_admin( void )
|
||||
@@ -898,7 +902,7 @@ struct token *token_create_admin( void )
|
||||
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
|
||||
token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ),
|
||||
admin_privs, ARRAY_SIZE( admin_privs ), default_dacl,
|
||||
@@ -121,7 +121,7 @@ index ccde0c2d..2d81118a 100644
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
}
|
||||
@@ -1524,6 +1528,26 @@ DECL_HANDLER(get_token_sid)
|
||||
@@ -1532,6 +1536,26 @@ DECL_HANDLER(get_token_sid)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,5 @@ index ccde0c2d..2d81118a 100644
|
||||
DECL_HANDLER(get_token_groups)
|
||||
{
|
||||
--
|
||||
2.19.1
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 2588eb4eb5fe56aca7d229ea42b0eaa3786ff600 Mon Sep 17 00:00:00 2001
|
||||
From c47977a8bbd739483589d1f01cfece435be1c100 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 01:45:29 +0200
|
||||
Subject: [PATCH] ntdll: Add function to create new tokens for elevation
|
||||
@@ -14,10 +14,10 @@ Subject: [PATCH] ntdll: Add function to create new tokens for elevation
|
||||
6 files changed, 117 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index e5db07f0a4e..d52f6b76aa4 100644
|
||||
index 0997c310110..8e3786e1972 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1594,6 +1594,9 @@
|
||||
@@ -1600,6 +1600,9 @@
|
||||
# Virtual memory
|
||||
@ cdecl __wine_locked_recvmsg(long ptr long)
|
||||
|
||||
@@ -28,24 +28,24 @@ index e5db07f0a4e..d52f6b76aa4 100644
|
||||
@ cdecl wine_get_version()
|
||||
@ cdecl wine_get_build_id()
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 92fcde95a8a..80be882e76d 100644
|
||||
index 63ceac42e94..5a98501381b 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -69,6 +69,9 @@ extern void init_locale( HMODULE module ) DECLSPEC_HIDDEN;
|
||||
extern void init_user_process_params(void) DECLSPEC_HIDDEN;
|
||||
@@ -67,6 +67,9 @@ extern void init_user_process_params(void) DECLSPEC_HIDDEN;
|
||||
extern NTSTATUS restart_process( RTL_USER_PROCESS_PARAMETERS *params, NTSTATUS status ) DECLSPEC_HIDDEN;
|
||||
extern void CDECL DECLSPEC_NORETURN signal_start_thread( CONTEXT *ctx ) DECLSPEC_HIDDEN;
|
||||
|
||||
+/* token */
|
||||
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
|
||||
+
|
||||
/* server support */
|
||||
extern BOOL is_wow64 DECLSPEC_HIDDEN;
|
||||
extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret,
|
||||
|
||||
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
|
||||
index 992721d133f..24cb8f53de2 100644
|
||||
index 77ba5b371e2..3e91a1fa9c4 100644
|
||||
--- a/dlls/ntdll/process.c
|
||||
+++ b/dlls/ntdll/process.c
|
||||
@@ -82,6 +82,24 @@ HANDLE CDECL __wine_make_process_system(void)
|
||||
@@ -72,6 +72,24 @@ HANDLE CDECL __wine_make_process_system(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -67,14 +67,14 @@ index 992721d133f..24cb8f53de2 100644
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* NtQueryInformationProcess [NTDLL.@]
|
||||
* ZwQueryInformationProcess [NTDLL.@]
|
||||
/***********************************************************************
|
||||
* restart_process
|
||||
*/
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 96bc9250ab0..14b811684d8 100644
|
||||
index 30a102d7b82..a9308904afc 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3759,6 +3759,14 @@ struct handle_info
|
||||
@@ -3481,6 +3481,14 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -215,5 +215,5 @@ index c4f1cd943c2..970ed1838da 100644
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.27.0
|
||||
2.28.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 1f2b1bafabfd457836f18741f178b3745e129c36 Mon Sep 17 00:00:00 2001
|
||||
From 51cde3dff5de27d1aebc964a4802758534d56773 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:55 +0200
|
||||
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
@@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
5 files changed, 67 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 0c8f05285c4..92ae87c6e6d 100644
|
||||
index 6290cbcb4e6..9a8f13901b2 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3898,6 +3898,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
@@ -3489,6 +3489,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ index 0c8f05285c4..92ae87c6e6d 100644
|
||||
/***********************************************************************
|
||||
* load_global_options
|
||||
*/
|
||||
@@ -4359,6 +4385,7 @@ void __wine_process_init(void)
|
||||
@@ -3900,6 +3926,7 @@ void __wine_process_init(void)
|
||||
'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
||||
void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL;
|
||||
RTL_USER_PROCESS_PARAMETERS *params;
|
||||
@@ -56,9 +56,9 @@ index 0c8f05285c4..92ae87c6e6d 100644
|
||||
WINE_MODREF *wm;
|
||||
NTSTATUS status;
|
||||
ANSI_STRING func_name;
|
||||
@@ -4453,6 +4480,16 @@ void __wine_process_init(void)
|
||||
|
||||
unix_funcs->virtual_set_large_address_space();
|
||||
@@ -4021,6 +4048,16 @@ void __wine_process_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ /* elevate process if necessary */
|
||||
+ status = RtlQueryInformationActivationContext( 0, NULL, 0, RunlevelInformationInActivationContext,
|
||||
@@ -74,11 +74,11 @@ index 0c8f05285c4..92ae87c6e6d 100644
|
||||
RemoveEntryList( &wm->ldr.InLoadOrderLinks );
|
||||
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks );
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index ac85cace95d..52604ec4d61 100644
|
||||
index fa8495511e0..df72efdecc8 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1115,6 +1115,14 @@ struct process_snapshot *process_snap( int *count )
|
||||
return snapshot;
|
||||
@@ -1086,6 +1086,14 @@ int set_process_debug_flag( struct process *process, int flag )
|
||||
return write_process_memory( process, process->peb + 2, 1, &data );
|
||||
}
|
||||
|
||||
+/* replace the token of a process */
|
||||
@@ -93,22 +93,22 @@ index ac85cace95d..52604ec4d61 100644
|
||||
DECL_HANDLER(new_process)
|
||||
{
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 5b83e111a6f..dfe5c4e52d8 100644
|
||||
index 0fdf070b78e..43e8cc1ad7e 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -139,6 +139,7 @@ extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
||||
@@ -129,6 +129,7 @@ extern void kill_console_processes( struct thread *renderer, int exit_code );
|
||||
extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
||||
extern void detach_debugged_processes( struct thread *debugger );
|
||||
extern struct process_snapshot *process_snap( int *count );
|
||||
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
|
||||
+extern void replace_process_token( struct process *process, struct token *token );
|
||||
|
||||
/* console functions */
|
||||
extern void inherit_console( struct thread *parent_thread, struct process *parent,
|
||||
extern obj_handle_t inherit_console( struct thread *parent_thread, obj_handle_t handle,
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 7315f8ac4ea..901c380b721 100644
|
||||
index a9308904afc..8c40fba8d0a 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3763,6 +3763,13 @@ struct handle_info
|
||||
@@ -3489,6 +3489,13 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -145,5 +145,5 @@ index 970ed1838da..1c1d49989b3 100644
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.26.2
|
||||
2.28.0
|
||||
|
||||
|
@@ -1,17 +1,25 @@
|
||||
From 6d4621ddba8139747345c05f6251bae9b3c68e39 Mon Sep 17 00:00:00 2001
|
||||
From e34d019222909281390f83149be755a4145024c4 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 15:28:33 +0200
|
||||
Subject: ntdll: Add semi-stub for TokenLinkedToken info class.
|
||||
Subject: [PATCH] ntdll: Add semi-stub for TokenLinkedToken info class.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 28 +++++++++++++++++++++++++++-
|
||||
1 file changed, 27 insertions(+), 1 deletion(-)
|
||||
dlls/ntdll/unix/security.c | 30 +++++++++++++++++++++++++++++-
|
||||
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index 6f2b24e6ba4..99dba58b426 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -366,7 +366,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
|
||||
index f0057116dee..2769e5f6a7b 100644
|
||||
--- a/dlls/ntdll/unix/security.c
|
||||
+++ b/dlls/ntdll/unix/security.c
|
||||
@@ -138,6 +138,7 @@ NTSTATUS WINAPI NtDuplicateToken( HANDLE token, ACCESS_MASK access, OBJECT_ATTRI
|
||||
return status;
|
||||
}
|
||||
|
||||
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
|
||||
|
||||
/***********************************************************************
|
||||
* NtQueryInformationToken (NTDLL.@)
|
||||
@@ -166,7 +167,7 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
|
||||
0, /* TokenAuditPolicy */
|
||||
0, /* TokenOrigin */
|
||||
sizeof(TOKEN_ELEVATION_TYPE), /* TokenElevationType */
|
||||
@@ -20,14 +28,14 @@ index 6f2b24e6ba4..99dba58b426 100644
|
||||
sizeof(TOKEN_ELEVATION), /* TokenElevation */
|
||||
0, /* TokenHasRestrictions */
|
||||
0, /* TokenAccessInformation */
|
||||
@@ -607,6 +607,32 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
}
|
||||
@@ -401,6 +402,33 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
|
||||
SERVER_END_REQ;
|
||||
break;
|
||||
|
||||
+ case TokenLinkedToken:
|
||||
+ SERVER_START_REQ( get_token_elevation_type )
|
||||
+ {
|
||||
+ TOKEN_LINKED_TOKEN *linked_token = tokeninfo;
|
||||
+ TOKEN_LINKED_TOKEN *linked_token = info;
|
||||
+ req->handle = wine_server_obj_handle( token );
|
||||
+ status = wine_server_call( req );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
@@ -50,9 +58,10 @@ index 6f2b24e6ba4..99dba58b426 100644
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ break;
|
||||
+
|
||||
case TokenElevation:
|
||||
SERVER_START_REQ( get_token_elevation_type )
|
||||
{
|
||||
--
|
||||
2.13.1
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,20 +1,21 @@
|
||||
From 6d8fd34cabbcbc64062675be610fb8704fcdc3ec Mon Sep 17 00:00:00 2001
|
||||
From a8915b8ebd4c06b0216fc82d1ba8d958a677eccf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 03:33:26 +0200
|
||||
Subject: [PATCH] server: Correctly assign security labels for tokens.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 21 ++++++++++-----------
|
||||
server/process.c | 8 +-------
|
||||
dlls/advapi32/tests/security.c | 21 +++++++++--------
|
||||
server/named_pipe.c | 2 +-
|
||||
server/process.c | 8 +------
|
||||
server/security.h | 2 +-
|
||||
server/token.c | 41 ++++++++++++++++++++++++-----------------
|
||||
4 files changed, 36 insertions(+), 36 deletions(-)
|
||||
server/token.c | 41 ++++++++++++++++++++--------------
|
||||
5 files changed, 37 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index bf4161c..0610ec7 100644
|
||||
index 94f3ea4601a..ab572421a73 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7186,7 +7186,6 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7105,7 +7105,6 @@ static void test_token_security_descriptor(void)
|
||||
defaulted = TRUE;
|
||||
ret = GetSecurityDescriptorDacl(sd2, &present, &acl2, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorDacl failed with error %u\n", GetLastError());
|
||||
@@ -22,7 +23,7 @@ index bf4161c..0610ec7 100644
|
||||
ok(present, "DACL not present\n");
|
||||
|
||||
if (present)
|
||||
@@ -7307,7 +7306,7 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7226,7 +7225,7 @@ static void test_token_security_descriptor(void)
|
||||
ok(ret, "GetAce failed with error %u\n", GetLastError());
|
||||
ok(ace->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE,
|
||||
"Unexpected ACE type %#x\n", ace->Header.AceType);
|
||||
@@ -31,7 +32,7 @@ index bf4161c..0610ec7 100644
|
||||
"Expected medium integrity level\n");
|
||||
}
|
||||
|
||||
@@ -7360,8 +7359,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7279,8 +7278,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@@ -42,7 +43,7 @@ index bf4161c..0610ec7 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7410,8 +7409,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7329,8 +7328,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@@ -53,7 +54,7 @@ index bf4161c..0610ec7 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7475,8 +7474,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7394,8 +7393,8 @@ static void test_token_security_descriptor(void)
|
||||
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@@ -64,7 +65,7 @@ index bf4161c..0610ec7 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7513,8 +7512,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7432,8 +7431,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@@ -75,7 +76,7 @@ index bf4161c..0610ec7 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7732,7 +7731,7 @@ static void test_child_token_sd_medium(void)
|
||||
@@ -7652,7 +7651,7 @@ static void test_child_token_sd_medium(void)
|
||||
ok(ret, "GetAce failed with error %u\n", GetLastError());
|
||||
ok(ace_label->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE,
|
||||
"Unexpected ACE type %#x\n", ace_label->Header.AceType);
|
||||
@@ -84,11 +85,24 @@ index bf4161c..0610ec7 100644
|
||||
"Expected medium integrity level\n");
|
||||
|
||||
memset(buffer_integrity, 0, sizeof(buffer_integrity));
|
||||
diff --git a/server/named_pipe.c b/server/named_pipe.c
|
||||
index 4cd4d7dc4a8..06bf8402aea 100644
|
||||
--- a/server/named_pipe.c
|
||||
+++ b/server/named_pipe.c
|
||||
@@ -1142,7 +1142,7 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
|
||||
if (current->process->token) /* FIXME: use the client token */
|
||||
{
|
||||
struct token *token;
|
||||
- if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL, NULL, 0, NULL, 0 )))
|
||||
+ if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL, NULL, 0, NULL, 0, NULL )))
|
||||
return 0;
|
||||
if (current->token) release_object( current->token );
|
||||
current->token = token;
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index b7c9da3..250f777 100644
|
||||
index 31d5b96a25d..2c485831e33 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -562,17 +562,11 @@ struct process *create_process( int fd, struct thread *parent_thread, int inheri
|
||||
@@ -577,17 +577,11 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
: alloc_handle_table( process, 0 );
|
||||
/* Note: for security reasons, starting a new process does not attempt
|
||||
* to use the current impersonation token for the new process */
|
||||
@@ -108,7 +122,7 @@ index b7c9da3..250f777 100644
|
||||
return process;
|
||||
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 32dfe5f..87377cc 100644
|
||||
index 32dfe5f8db9..87377ccd673 100644
|
||||
--- a/server/security.h
|
||||
+++ b/server/security.h
|
||||
@@ -59,7 +59,7 @@ extern int token_assign_label( struct token *token, PSID label );
|
||||
@@ -121,10 +135,10 @@ index 32dfe5f..87377cc 100644
|
||||
const LUID_AND_ATTRIBUTES *reqprivs,
|
||||
unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 5db97b4..bd251c7 100644
|
||||
index 2f466aa1b25..23bc1cc13f7 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -668,7 +668,7 @@ static int filter_privilege( struct privilege *privilege, const LUID_AND_ATTRIBU
|
||||
@@ -675,7 +675,7 @@ static int filter_privilege( struct privilege *privilege, const LUID_AND_ATTRIBU
|
||||
struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
int impersonation_level, const struct security_descriptor *sd,
|
||||
const LUID_AND_ATTRIBUTES *filter_privileges, unsigned int priv_count,
|
||||
@@ -133,7 +147,7 @@ index 5db97b4..bd251c7 100644
|
||||
{
|
||||
const luid_t *modified_id =
|
||||
primary || (impersonation_level == src_token->impersonation_level) ?
|
||||
@@ -735,6 +735,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -742,6 +742,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
if (sd) default_set_sd( &token->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
|
||||
|
||||
@@ -146,7 +160,7 @@ index 5db97b4..bd251c7 100644
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -906,6 +912,12 @@ struct token *token_create_admin( void )
|
||||
@@ -913,6 +919,12 @@ struct token *token_create_admin( void )
|
||||
admin_source, NULL, -1, TokenElevationTypeFull, &high_label_sid );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
@@ -159,7 +173,7 @@ index 5db97b4..bd251c7 100644
|
||||
}
|
||||
|
||||
free( logon_sid );
|
||||
@@ -964,6 +976,12 @@ static struct token *token_create_limited( void )
|
||||
@@ -971,6 +983,12 @@ static struct token *token_create_limited( void )
|
||||
admin_source, NULL, -1, TokenElevationTypeLimited, &medium_label_sid );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
@@ -172,7 +186,7 @@ index 5db97b4..bd251c7 100644
|
||||
}
|
||||
|
||||
free( logon_sid );
|
||||
@@ -1432,7 +1450,8 @@ DECL_HANDLER(duplicate_token)
|
||||
@@ -1439,7 +1457,8 @@ DECL_HANDLER(duplicate_token)
|
||||
TOKEN_DUPLICATE,
|
||||
&token_ops )))
|
||||
{
|
||||
@@ -182,7 +196,7 @@ index 5db97b4..bd251c7 100644
|
||||
if (token)
|
||||
{
|
||||
unsigned int access = req->access ? req->access : get_handle_access( current->process, req->handle );
|
||||
@@ -1462,7 +1481,7 @@ DECL_HANDLER(filter_token)
|
||||
@@ -1469,7 +1488,7 @@ DECL_HANDLER(filter_token)
|
||||
group_count = get_sid_count( filter_groups, get_req_data_size() - priv_count * sizeof(LUID_AND_ATTRIBUTES) );
|
||||
|
||||
token = token_duplicate( src_token, src_token->primary, src_token->impersonation_level, NULL,
|
||||
@@ -191,7 +205,7 @@ index 5db97b4..bd251c7 100644
|
||||
if (token)
|
||||
{
|
||||
unsigned int access = get_handle_access( current->process, req->handle );
|
||||
@@ -1788,23 +1807,11 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
@@ -1795,23 +1814,11 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
DECL_HANDLER(create_token)
|
||||
{
|
||||
struct token *token;
|
||||
@@ -218,5 +232,5 @@ index 5db97b4..bd251c7 100644
|
||||
}
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
2.27.0
|
||||
|
@@ -2,3 +2,7 @@ Fixes: [40613] Basic implementation for token integrity levels and UAC handling
|
||||
Fixes: [39262] Run explorer.exe as unevaluated process
|
||||
Depends: advapi32-CreateRestrictedToken
|
||||
Depends: Staging
|
||||
# Broken due to ntdll.so <- ntdll.dll imports. This isn't particularly difficult
|
||||
# to fix, but it was already broken for some more obscure reason, and the whole
|
||||
# patch set needs to be rewritten anyway.
|
||||
Disabled: true
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From a5c9b96c7b517d212260cb8567162425554ff613 Mon Sep 17 00:00:00 2001
|
||||
From 2674bbd626b4a9e46e5ab729cb47c81950efefea Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Tue, 7 Jan 2020 14:22:49 -0600
|
||||
Subject: [PATCH] bcrypt: Implement BCryptSecretAgreement with libgcrypt.
|
||||
@@ -7,17 +7,17 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
---
|
||||
configure.ac | 14 ++
|
||||
dlls/bcrypt/Makefile.in | 1 +
|
||||
dlls/bcrypt/bcrypt_internal.h | 13 ++
|
||||
dlls/bcrypt/bcrypt_main.c | 86 +++++++++--
|
||||
dlls/bcrypt/bcrypt_internal.h | 6 +
|
||||
dlls/bcrypt/bcrypt_main.c | 54 ++++++-
|
||||
dlls/bcrypt/gcrypt.c | 264 ++++++++++++++++++++++++++++++++++
|
||||
dlls/bcrypt/gnutls.c | 9 ++
|
||||
dlls/bcrypt/macos.c | 6 +
|
||||
dlls/bcrypt/tests/bcrypt.c | 2 +-
|
||||
8 files changed, 384 insertions(+), 11 deletions(-)
|
||||
8 files changed, 350 insertions(+), 6 deletions(-)
|
||||
create mode 100644 dlls/bcrypt/gcrypt.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e3d63ed7501..beb86c23b45 100644
|
||||
index 928f8ebd1b1..f9db147e7d5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -47,6 +47,7 @@ AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAu
|
||||
@@ -61,7 +61,7 @@ index dd6d4a76640..ea3486a4002 100644
|
||||
macos.c \
|
||||
md2.c \
|
||||
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
|
||||
index 18343a6c749..27cd4950274 100644
|
||||
index 43be170d77f..6c93ed78389 100644
|
||||
--- a/dlls/bcrypt/bcrypt_internal.h
|
||||
+++ b/dlls/bcrypt/bcrypt_internal.h
|
||||
@@ -25,6 +25,9 @@
|
||||
@@ -74,20 +74,16 @@ index 18343a6c749..27cd4950274 100644
|
||||
#elif HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <CommonCrypto/CommonCryptor.h>
|
||||
@@ -161,6 +164,12 @@ struct algorithm
|
||||
ULONG flags;
|
||||
};
|
||||
|
||||
+struct secret
|
||||
+{
|
||||
@@ -243,6 +246,8 @@ struct key
|
||||
struct secret
|
||||
{
|
||||
struct object hdr;
|
||||
+ UCHAR *data;
|
||||
+ ULONG len;
|
||||
+};
|
||||
+
|
||||
#if defined(HAVE_GNUTLS_CIPHER_INIT)
|
||||
struct key_symmetric
|
||||
{
|
||||
@@ -258,6 +267,7 @@ NTSTATUS key_export_dsa_capi( struct key *, UCHAR *, ULONG, ULONG * ) DECLSPEC_H
|
||||
};
|
||||
|
||||
NTSTATUS get_alg_property( const struct algorithm *, const WCHAR *, UCHAR *, ULONG, ULONG * ) DECLSPEC_HIDDEN;
|
||||
@@ -264,6 +269,7 @@ NTSTATUS key_export_dsa_capi( struct key *, UCHAR *, ULONG, ULONG * ) DECLSPEC_H
|
||||
NTSTATUS key_export_ecc( struct key *, UCHAR *, ULONG, ULONG * ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_import_dsa_capi( struct key *, UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
NTSTATUS key_import_ecc( struct key *, UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
@@ -95,16 +91,8 @@ index 18343a6c749..27cd4950274 100644
|
||||
|
||||
BOOL is_zero_vector( const UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
BOOL is_equal_vector( const UCHAR *, ULONG, const UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
@@ -265,4 +275,7 @@ BOOL is_equal_vector( const UCHAR *, ULONG, const UCHAR *, ULONG ) DECLSPEC_HIDD
|
||||
BOOL gnutls_initialize(void) DECLSPEC_HIDDEN;
|
||||
void gnutls_uninitialize(void) DECLSPEC_HIDDEN;
|
||||
|
||||
+BOOL gcrypt_initialize(void) DECLSPEC_HIDDEN;
|
||||
+void gcrypt_uninitialize(void) DECLSPEC_HIDDEN;
|
||||
+
|
||||
#endif /* __BCRYPT_INTERNAL_H */
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index fee40ebe8d7..f254571bbc2 100644
|
||||
index bea2001a677..65c28ca63e2 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1421,6 +1421,12 @@ NTSTATUS key_import_ecc( struct key *key, UCHAR *input, ULONG len )
|
||||
@@ -120,74 +108,60 @@ index fee40ebe8d7..f254571bbc2 100644
|
||||
#endif
|
||||
|
||||
NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE *handle,
|
||||
@@ -1833,27 +1839,81 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle, UCHAR *pwd, ULO
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE key, BCRYPT_SECRET_HANDLE *secret, ULONG flags)
|
||||
+NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE hPrivKey, BCRYPT_KEY_HANDLE hPubKey, BCRYPT_SECRET_HANDLE *secret_out, ULONG flags)
|
||||
{
|
||||
- FIXME( "%p, %p, %p, %08x\n", handle, key, secret, flags );
|
||||
+ struct key *privkey = hPrivKey;
|
||||
+ struct key *pubkey = hPubKey;
|
||||
+ struct secret *secret;
|
||||
@@ -1838,8 +1844,9 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
struct key *privkey = privatekey;
|
||||
struct key *pubkey = publickey;
|
||||
struct secret *secret;
|
||||
+ NTSTATUS status;
|
||||
|
||||
- if(secret)
|
||||
- *secret = (BCRYPT_SECRET_HANDLE *)0xDEADFEED;
|
||||
+ TRACE( "%p, %p, %p, %08x\n", hPrivKey, hPubKey, secret_out, flags );
|
||||
- FIXME( "%p, %p, %p, %08x\n", privatekey, publickey, handle, flags );
|
||||
+ TRACE( "%p, %p, %p, %08x\n", privatekey, publickey, handle, flags );
|
||||
|
||||
- return STATUS_SUCCESS;
|
||||
+ secret = heap_alloc( sizeof(*secret) );
|
||||
+
|
||||
+ if ((status = compute_secret_ecc(privkey, pubkey, secret)))
|
||||
if (!privkey || privkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
if (!pubkey || pubkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
@@ -1848,7 +1855,16 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
if (!(secret = heap_alloc_zero( sizeof(*secret) ))) return STATUS_NO_MEMORY;
|
||||
secret->hdr.magic = MAGIC_SECRET;
|
||||
|
||||
- *handle = secret;
|
||||
+ if ((status = compute_secret_ecc( privkey, pubkey, secret )))
|
||||
+ {
|
||||
+ heap_free(secret);
|
||||
+ *secret_out = NULL;
|
||||
+ heap_free( secret );
|
||||
+ *handle = NULL;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ *secret_out = secret;
|
||||
+ *handle = secret;
|
||||
+ }
|
||||
+
|
||||
+ return status;
|
||||
}
|
||||
|
||||
-NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
|
||||
+NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE hSecret)
|
||||
{
|
||||
- FIXME( "%p\n", secret );
|
||||
+ struct secret *secret = hSecret;
|
||||
+
|
||||
+ TRACE( "%p\n", hSecret );
|
||||
+
|
||||
+ if (!hSecret)
|
||||
+ {
|
||||
+ return STATUS_INVALID_HANDLE;
|
||||
+ }
|
||||
+
|
||||
+ heap_free(secret->data);
|
||||
+ heap_free(secret);
|
||||
+
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
-NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE secret, LPCWSTR kdf, BCryptBufferDesc *parameter,
|
||||
+NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE hSecret, LPCWSTR deriv_func, BCryptBufferDesc *parameter,
|
||||
PUCHAR derived, ULONG derived_size, ULONG *result, ULONG flags)
|
||||
@@ -1856,10 +1872,11 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE handle)
|
||||
{
|
||||
struct secret *secret = handle;
|
||||
|
||||
- FIXME( "%p\n", handle );
|
||||
+ TRACE( "%p\n", handle );
|
||||
|
||||
if (!secret || secret->hdr.magic != MAGIC_SECRET) return STATUS_INVALID_HANDLE;
|
||||
secret->hdr.magic = 0;
|
||||
+ heap_free( secret->data );
|
||||
heap_free( secret );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1869,12 +1886,33 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
{
|
||||
struct secret *secret = handle;
|
||||
|
||||
- FIXME( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
|
||||
+ TRACE( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
|
||||
|
||||
if (!secret || secret->hdr.magic != MAGIC_SECRET) return STATUS_INVALID_HANDLE;
|
||||
if (!kdf) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
- return STATUS_INTERNAL_ERROR;
|
||||
+ struct secret *secret = hSecret;
|
||||
+
|
||||
+ TRACE( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(deriv_func), parameter, derived, derived_size, result, flags );
|
||||
+
|
||||
+ if (!hSecret)
|
||||
+ {
|
||||
+ return STATUS_INVALID_HANDLE;
|
||||
+ }
|
||||
+
|
||||
+ if (!(strcmpW(deriv_func, BCRYPT_KDF_RAW_SECRET)))
|
||||
+ if (!(strcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
|
||||
+ {
|
||||
+ ULONG n;
|
||||
+ ULONG secret_length = secret->len;
|
||||
@@ -207,12 +181,12 @@ index fee40ebe8d7..f254571bbc2 100644
|
||||
+ *result = n;
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+ FIXME( "Derivation function %s not supported.\n", debugstr_w(deriv_func) );
|
||||
+ FIXME( "Derivation function %s not supported.\n", debugstr_w(kdf) );
|
||||
+ return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1865,6 +1925,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1886,6 +1924,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
DisableThreadLibraryCalls( hinst );
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
gnutls_initialize();
|
||||
@@ -222,7 +196,7 @@ index fee40ebe8d7..f254571bbc2 100644
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -1872,6 +1935,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1893,6 +1934,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
if (reserved) break;
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
gnutls_uninitialize();
|
||||
@@ -503,10 +477,10 @@ index 00000000000..f882d61def8
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index d447e90a11e..7828fa5c792 100644
|
||||
index 19a00e2ee25..1e075fe9994 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -1580,4 +1580,13 @@ NTSTATUS key_destroy( struct key *key )
|
||||
@@ -1585,4 +1585,13 @@ NTSTATUS key_destroy( struct key *key )
|
||||
heap_free( key );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -521,10 +495,10 @@ index d447e90a11e..7828fa5c792 100644
|
||||
+
|
||||
#endif
|
||||
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
|
||||
index f635ba4bc8e..50cd5d83d1f 100644
|
||||
index 7f902535b8f..6c2a41a0725 100644
|
||||
--- a/dlls/bcrypt/macos.c
|
||||
+++ b/dlls/bcrypt/macos.c
|
||||
@@ -267,4 +267,10 @@ NTSTATUS key_destroy( struct key *key )
|
||||
@@ -279,4 +279,10 @@ NTSTATUS key_destroy( struct key *key )
|
||||
heap_free( key );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -536,7 +510,7 @@ index f635ba4bc8e..50cd5d83d1f 100644
|
||||
+}
|
||||
#endif
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index e4a99d63048..6ca26b3d6ba 100644
|
||||
index eb7a72e0ff4..a351aacf1f5 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -2068,7 +2068,7 @@ static void test_ECDH(void)
|
||||
@@ -549,5 +523,5 @@ index e4a99d63048..6ca26b3d6ba 100644
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
--
|
||||
2.26.2
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From d0c4ac467f5e85e29ae407b29b6a93c85f375fd3 Mon Sep 17 00:00:00 2001
|
||||
From d232882c571a14f4da8a134071a2125805ebd41f Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Tue, 7 Jan 2020 14:22:49 -0600
|
||||
Subject: [PATCH] bcrypt: Implement BCRYPT_KDF_HASH.
|
||||
@@ -6,24 +6,22 @@ Subject: [PATCH] bcrypt: Implement BCRYPT_KDF_HASH.
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47699
|
||||
Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
|
||||
---
|
||||
dlls/bcrypt/bcrypt_main.c | 110 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/bcrypt/bcrypt_main.c | 108 ++++++++++++++++++++++++++++++++++++-
|
||||
dlls/bcrypt/tests/bcrypt.c | 2 +-
|
||||
2 files changed, 111 insertions(+), 1 deletion(-)
|
||||
2 files changed, 108 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 15b934247d..57d552a4c0 100644
|
||||
index 65c28ca63e2..6e7b52e93b0 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1773,6 +1773,116 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE hSecret, LPCWSTR deriv_func
|
||||
return STATUS_INVALID_HANDLE;
|
||||
}
|
||||
@@ -1891,7 +1891,113 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
if (!secret || secret->hdr.magic != MAGIC_SECRET) return STATUS_INVALID_HANDLE;
|
||||
if (!kdf) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
+ if (flags)
|
||||
+ {
|
||||
+ FIXME("flags ignored: %08x\n", flags);
|
||||
+ }
|
||||
- if (!(strcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
|
||||
+ if (flags) FIXME("flags ignored: %08x\n", flags);
|
||||
+
|
||||
+ if (!(strcmpW(deriv_func, BCRYPT_KDF_HASH)))
|
||||
+ if (!(strcmpW( kdf, BCRYPT_KDF_HASH )))
|
||||
+ {
|
||||
+ unsigned int i;
|
||||
+ BCryptBuffer *hash_algorithm = NULL;
|
||||
@@ -127,15 +125,15 @@ index 15b934247d..57d552a4c0 100644
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+ }
|
||||
+ else
|
||||
if (!(strcmpW(deriv_func, BCRYPT_KDF_RAW_SECRET)))
|
||||
+ else if (!(strcmpW( kdf, BCRYPT_KDF_RAW_SECRET )))
|
||||
{
|
||||
ULONG n;
|
||||
ULONG secret_length = secret->len;
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index d9509f2c49..edc59a8a97 100644
|
||||
index a351aacf1f5..5333b879817 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -2084,7 +2084,7 @@ static void test_ECDH(void)
|
||||
@@ -2085,7 +2085,7 @@ static void test_ECDH(void)
|
||||
raw_secret_end:
|
||||
|
||||
status = pBCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
|
||||
@@ -145,5 +143,5 @@ index d9509f2c49..edc59a8a97 100644
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
--
|
||||
2.24.1
|
||||
2.27.0
|
||||
|
||||
|
@@ -1,27 +1,26 @@
|
||||
From ddc5f6fd9dde7a5cdde0be59d4a9db9e086400a9 Mon Sep 17 00:00:00 2001
|
||||
From 3497a2faa4ebab67b65bcf99d4ed56baa70ddf96 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 12 Jul 2014 23:58:19 +0200
|
||||
Subject: comctl32: Preserve custom colors between subitems. (v2)
|
||||
Subject: [PATCH] comctl32: Preserve custom colors between subitems. (v2)
|
||||
|
||||
---
|
||||
dlls/comctl32/listview.c | 20 +++++++++-----------
|
||||
dlls/comctl32/tests/listview.c | 23 ++++++++++++++++++++---
|
||||
2 files changed, 29 insertions(+), 14 deletions(-)
|
||||
dlls/comctl32/listview.c | 15 +++++++++------
|
||||
1 file changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
|
||||
index 56e2563..a35f5f2 100644
|
||||
index dba16d13a4c..35cab333b7b 100644
|
||||
--- a/dlls/comctl32/listview.c
|
||||
+++ b/dlls/comctl32/listview.c
|
||||
@@ -1072,7 +1072,7 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRA
|
||||
COLORREF backcolor, textcolor;
|
||||
@@ -1063,7 +1063,7 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, const NMLVCUS
|
||||
textcolor = cd->clrText;
|
||||
|
||||
/* apparently, for selected items, we have to override the returned values */
|
||||
- if (!SubItem)
|
||||
+ if (!SubItem || (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||
{
|
||||
if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
|
||||
if (cd->nmcd.uItemState & CDIS_SELECTED)
|
||||
{
|
||||
@@ -4784,6 +4784,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||
@@ -4786,6 +4786,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||
while (iterator_next(subitems))
|
||||
{
|
||||
DWORD subitemstage = CDRF_DODEFAULT;
|
||||
@@ -29,15 +28,9 @@ index 56e2563..a35f5f2 100644
|
||||
|
||||
/* We need to query for each subitem, item's data (subitem == 0) is already here at this point */
|
||||
if (subitems->nItem)
|
||||
@@ -4810,19 +4811,16 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||
|
||||
@@ -4813,13 +4814,15 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, ITERAT
|
||||
if (cdsubitemmode & CDRF_NOTIFYSUBITEMDRAW)
|
||||
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPREPAINT, &nmlvcd);
|
||||
- else
|
||||
- {
|
||||
- nmlvcd.clrTextBk = infoPtr->clrTextBk;
|
||||
- nmlvcd.clrText = infoPtr->clrText;
|
||||
- }
|
||||
|
||||
- if (subitems->nItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW))
|
||||
- prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE);
|
||||
@@ -57,5 +50,5 @@ index 56e2563..a35f5f2 100644
|
||||
if (subitemstage & CDRF_NOTIFYPOSTPAINT)
|
||||
subitemstage = notify_customdraw(infoPtr, CDDS_SUBITEM | CDDS_ITEMPOSTPAINT, &nmlvcd);
|
||||
--
|
||||
2.9.0
|
||||
2.27.0
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,494 +0,0 @@
|
||||
From 6233bb9da6cf391db945440ed68f089b31b65e04 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 24 Aug 2019 18:23:38 +1000
|
||||
Subject: [PATCH 03/27] dsdmo: Add IDirectSoundFXChorus support
|
||||
|
||||
---
|
||||
dlls/dsdmo/Makefile.in | 1 +
|
||||
dlls/dsdmo/chorus.c | 397 +++++++++++++++++++++++++++++++++++
|
||||
dlls/dsdmo/dsdmo_classes.idl | 10 +
|
||||
dlls/dsdmo/dsdmo_private.h | 1 +
|
||||
dlls/dsdmo/main.c | 14 ++
|
||||
5 files changed, 423 insertions(+)
|
||||
create mode 100644 dlls/dsdmo/chorus.c
|
||||
|
||||
diff --git a/dlls/dsdmo/Makefile.in b/dlls/dsdmo/Makefile.in
|
||||
index cb4f8f8a4b..34d0e89bf1 100644
|
||||
--- a/dlls/dsdmo/Makefile.in
|
||||
+++ b/dlls/dsdmo/Makefile.in
|
||||
@@ -3,6 +3,7 @@ IMPORTS = uuid
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
C_SRCS = \
|
||||
+ chorus.c \
|
||||
echo.c \
|
||||
main.c
|
||||
|
||||
diff --git a/dlls/dsdmo/chorus.c b/dlls/dsdmo/chorus.c
|
||||
new file mode 100644
|
||||
index 0000000000..6d4076bcba
|
||||
--- /dev/null
|
||||
+++ b/dlls/dsdmo/chorus.c
|
||||
@@ -0,0 +1,397 @@
|
||||
+/*
|
||||
+ * 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
|
||||
+ */
|
||||
+#define COBJMACROS
|
||||
+
|
||||
+#include "dsdmo_private.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(dsdmo);
|
||||
+
|
||||
+struct dmo_chorusfx
|
||||
+{
|
||||
+ IDirectSoundFXChorus IDirectSoundFXChorus_iface;
|
||||
+ IMediaObject IMediaObject_iface;
|
||||
+ IMediaObjectInPlace IMediaObjectInPlace_iface;
|
||||
+ LONG ref;
|
||||
+};
|
||||
+
|
||||
+static inline struct dmo_chorusfx *impl_from_IDirectSoundFXChorus(IDirectSoundFXChorus *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_chorusfx, IDirectSoundFXChorus_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_chorusfx *impl_from_IMediaObject(IMediaObject *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_chorusfx, IMediaObject_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_chorusfx *impl_from_IMediaObjectInPlace(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_chorusfx, IMediaObjectInPlace_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_QueryInterface(IMediaObject *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXChorus_QueryInterface(&This->IDirectSoundFXChorus_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chorus_mediaobj_AddRef(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXChorus_AddRef(&This->IDirectSoundFXChorus_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chorus_mediaobj_Release(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXChorus_Release(&This->IDirectSoundFXChorus_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetStreamCount(IMediaObject *iface, DWORD *inputs, DWORD *outputs)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %p, %p\n", This, inputs, outputs);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetOutputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *ahead, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p, %p\n", This, index, size, ahead, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p\n", This, index, size, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %s\n", This, index, wine_dbgstr_longlong(latency));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_Flush(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_Discontinuity(IMediaObject *iface, DWORD index)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, index);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_AllocateStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_FreeStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer,
|
||||
+ DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME length)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x, %s, %s\n", This, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(length));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
|
||||
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %x, %d, %p, %p\n", This, flags, count, buffers, status);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediaobj_Lock(IMediaObject *iface, LONG lock)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, lock);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectVtbl echo_mediaobjectVtbl =
|
||||
+{
|
||||
+ chorus_mediaobj_QueryInterface,
|
||||
+ chorus_mediaobj_AddRef,
|
||||
+ chorus_mediaobj_Release,
|
||||
+ chorus_mediaobj_GetStreamCount,
|
||||
+ chorus_mediaobj_GetInputStreamInfo,
|
||||
+ chorus_mediaobj_GetOutputStreamInfo,
|
||||
+ chorus_mediaobj_GetInputType,
|
||||
+ chorus_mediaobj_GetOutputType,
|
||||
+ chorus_mediaobj_SetInputType,
|
||||
+ chorus_mediaobj_SetOutputType,
|
||||
+ chorus_mediaobj_GetInputCurrentType,
|
||||
+ chorus_mediaobj_GetOutputCurrentType,
|
||||
+ chorus_mediaobj_GetInputSizeInfo,
|
||||
+ chorus_mediaobj_GetOutputSizeInfo,
|
||||
+ chorus_mediaobj_GetInputMaxLatency,
|
||||
+ chorus_mediaobj_SetInputMaxLatency,
|
||||
+ chorus_mediaobj_Flush,
|
||||
+ chorus_mediaobj_Discontinuity,
|
||||
+ chorus_mediaobj_AllocateStreamingResources,
|
||||
+ chorus_mediaobj_FreeStreamingResources,
|
||||
+ chorus_mediaobj_GetInputStatus,
|
||||
+ chorus_mediaobj_ProcessInput,
|
||||
+ chorus_mediaobj_ProcessOutput,
|
||||
+ chorus_mediaobj_Lock
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediainplace_QueryInterface(IMediaObjectInPlace *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXChorus_QueryInterface(&This->IDirectSoundFXChorus_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chorus_mediainplace_AddRef(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXChorus_AddRef(&This->IDirectSoundFXChorus_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chorus_mediainplace_Release(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXChorus_Release(&This->IDirectSoundFXChorus_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediainplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ static BOOL once = 0;
|
||||
+ if(!once++)
|
||||
+ FIXME("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ else
|
||||
+ TRACE("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediainplace_Clone(IMediaObjectInPlace *iface, IMediaObjectInPlace **object)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, object);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chorus_mediainplace_GetLatency(IMediaObjectInPlace *iface, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectInPlaceVtbl echo_mediainplaceVtbl =
|
||||
+{
|
||||
+ chorus_mediainplace_QueryInterface,
|
||||
+ chorus_mediainplace_AddRef,
|
||||
+ chorus_mediainplace_Release,
|
||||
+ chorus_mediainplace_Process,
|
||||
+ chorus_mediainplace_Clone,
|
||||
+ chorus_mediainplace_GetLatency
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI chrousfx_QueryInterface(IDirectSoundFXChorus *iface, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IDirectSoundFXChorus(iface);
|
||||
+
|
||||
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(riid, &IID_IDirectSoundFXChorus))
|
||||
+ {
|
||||
+ *ppv = &This->IDirectSoundFXChorus_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObject))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObject_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObjectInPlace))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObjectInPlace_iface;
|
||||
+ }
|
||||
+
|
||||
+ if(!*ppv)
|
||||
+ {
|
||||
+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ IUnknown_AddRef((IUnknown*)*ppv);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chrousfx_AddRef(IDirectSoundFXChorus *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IDirectSoundFXChorus(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI chrousfx_Release(IDirectSoundFXChorus *iface)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IDirectSoundFXChorus(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ heap_free(This);
|
||||
+ }
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chrousfx_SetAllParameters(IDirectSoundFXChorus *iface, const DSFXChorus *chorus)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IDirectSoundFXChorus(iface);
|
||||
+ FIXME("(%p) %p\n", This, chorus);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI chrousfx_GetAllParameters(IDirectSoundFXChorus *iface, DSFXChorus *chorus)
|
||||
+{
|
||||
+ struct dmo_chorusfx *This = impl_from_IDirectSoundFXChorus(iface);
|
||||
+ FIXME("(%p) %p\n", This, chorus);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IDirectSoundFXChorusVtbl chorusfxVtbl =
|
||||
+{
|
||||
+ chrousfx_QueryInterface,
|
||||
+ chrousfx_AddRef,
|
||||
+ chrousfx_Release,
|
||||
+ chrousfx_SetAllParameters,
|
||||
+ chrousfx_GetAllParameters
|
||||
+};
|
||||
+
|
||||
+HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_chorusfx *object;
|
||||
+ HRESULT ret;
|
||||
+
|
||||
+ TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ *ppv = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->IDirectSoundFXChorus_iface.lpVtbl = &chorusfxVtbl;
|
||||
+ object->IMediaObject_iface.lpVtbl = &echo_mediaobjectVtbl;
|
||||
+ object->IMediaObjectInPlace_iface.lpVtbl = &echo_mediainplaceVtbl;
|
||||
+ object->ref = 1;
|
||||
+
|
||||
+ ret = chrousfx_QueryInterface(&object->IDirectSoundFXChorus_iface, riid, ppv);
|
||||
+ chrousfx_Release(&object->IDirectSoundFXChorus_iface);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_classes.idl b/dlls/dsdmo/dsdmo_classes.idl
|
||||
index 649db8f61b..ba1a8f6ff4 100644
|
||||
--- a/dlls/dsdmo/dsdmo_classes.idl
|
||||
+++ b/dlls/dsdmo/dsdmo_classes.idl
|
||||
@@ -26,3 +26,13 @@
|
||||
coclass DirectSoundEchoDMO
|
||||
{
|
||||
}
|
||||
+
|
||||
+[
|
||||
+ uuid(efe6629c-81f7-4281-bd91-c9d604a95af6),
|
||||
+ threading(both),
|
||||
+ progid("Microsoft.DirectSoundChorusDMO.1"),
|
||||
+ vi_progid("Microsoft.DirectSoundChorusDMO")
|
||||
+]
|
||||
+coclass DirectSoundChorusDMO
|
||||
+{
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_private.h b/dlls/dsdmo/dsdmo_private.h
|
||||
index 4abe5a9f60..cbe906e472 100644
|
||||
--- a/dlls/dsdmo/dsdmo_private.h
|
||||
+++ b/dlls/dsdmo/dsdmo_private.h
|
||||
@@ -28,5 +28,6 @@
|
||||
#include "dsound.h"
|
||||
|
||||
extern HRESULT WINAPI EchoFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
|
||||
index d751f90dc9..5a89eaff39 100644
|
||||
--- a/dlls/dsdmo/main.c
|
||||
+++ b/dlls/dsdmo/main.c
|
||||
@@ -94,7 +94,16 @@ static const IClassFactoryVtbl EchoFactoryVtbl = {
|
||||
ClassFactory_LockServer
|
||||
};
|
||||
|
||||
+static const IClassFactoryVtbl ChrousFactoryVtbl = {
|
||||
+ ClassFactory_QueryInterface,
|
||||
+ ClassFactory_AddRef,
|
||||
+ ClassFactory_Release,
|
||||
+ ChrousFactory_CreateInstance,
|
||||
+ ClassFactory_LockServer
|
||||
+};
|
||||
+
|
||||
static IClassFactory echofx_factory = { &EchoFactoryVtbl };
|
||||
+static IClassFactory chorusfx_factory = { &ChrousFactoryVtbl };
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject
|
||||
@@ -108,6 +117,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
TRACE("GUID_DSFX_STANDARD_ECHO\n");
|
||||
return IClassFactory_QueryInterface(&echofx_factory, riid, ppv);
|
||||
}
|
||||
+ else if(IsEqualGUID(&GUID_DSFX_STANDARD_CHORUS, rclsid))
|
||||
+ {
|
||||
+ TRACE("GUID_DSFX_STANDARD_CHORUS\n");
|
||||
+ return IClassFactory_QueryInterface(&chorusfx_factory, riid, ppv);
|
||||
+ }
|
||||
|
||||
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,495 +0,0 @@
|
||||
From abb55212b7e4ed43526bfc24fa78715f9dafa3e2 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 24 Aug 2019 18:40:39 +1000
|
||||
Subject: [PATCH 04/27] dsdmo: Add IDirectSoundFXCompressor support
|
||||
|
||||
---
|
||||
dlls/dsdmo/Makefile.in | 1 +
|
||||
dlls/dsdmo/compressor.c | 397 +++++++++++++++++++++++++++++++++++
|
||||
dlls/dsdmo/dsdmo_classes.idl | 10 +
|
||||
dlls/dsdmo/dsdmo_private.h | 1 +
|
||||
dlls/dsdmo/main.c | 14 ++
|
||||
5 files changed, 423 insertions(+)
|
||||
create mode 100644 dlls/dsdmo/compressor.c
|
||||
|
||||
diff --git a/dlls/dsdmo/Makefile.in b/dlls/dsdmo/Makefile.in
|
||||
index 34d0e89bf1..d0b10ac4f9 100644
|
||||
--- a/dlls/dsdmo/Makefile.in
|
||||
+++ b/dlls/dsdmo/Makefile.in
|
||||
@@ -4,6 +4,7 @@ EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
C_SRCS = \
|
||||
chorus.c \
|
||||
+ compressor.c \
|
||||
echo.c \
|
||||
main.c
|
||||
|
||||
diff --git a/dlls/dsdmo/compressor.c b/dlls/dsdmo/compressor.c
|
||||
new file mode 100644
|
||||
index 0000000000..1cf26c7437
|
||||
--- /dev/null
|
||||
+++ b/dlls/dsdmo/compressor.c
|
||||
@@ -0,0 +1,397 @@
|
||||
+/*
|
||||
+ * 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
|
||||
+ */
|
||||
+#define COBJMACROS
|
||||
+
|
||||
+#include "dsdmo_private.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(dsdmo);
|
||||
+
|
||||
+struct dmo_compressorfx
|
||||
+{
|
||||
+ IDirectSoundFXCompressor IDirectSoundFXCompressor_iface;
|
||||
+ IMediaObject IMediaObject_iface;
|
||||
+ IMediaObjectInPlace IMediaObjectInPlace_iface;
|
||||
+ LONG ref;
|
||||
+};
|
||||
+
|
||||
+static inline struct dmo_compressorfx *impl_from_IDirectSoundFXCompressor(IDirectSoundFXCompressor *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_compressorfx, IDirectSoundFXCompressor_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_compressorfx *impl_from_IMediaObject(IMediaObject *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_compressorfx, IMediaObject_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_compressorfx *impl_from_IMediaObjectInPlace(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_compressorfx, IMediaObjectInPlace_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_QueryInterface(IMediaObject *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXCompressor_QueryInterface(&This->IDirectSoundFXCompressor_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI compressor_mediaobj_AddRef(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXCompressor_AddRef(&This->IDirectSoundFXCompressor_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI compressor_mediaobj_Release(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXCompressor_Release(&This->IDirectSoundFXCompressor_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetStreamCount(IMediaObject *iface, DWORD *inputs, DWORD *outputs)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %p, %p\n", This, inputs, outputs);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetOutputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *ahead, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p, %p\n", This, index, size, ahead, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p\n", This, index, size, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %s\n", This, index, wine_dbgstr_longlong(latency));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_Flush(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_Discontinuity(IMediaObject *iface, DWORD index)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, index);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_AllocateStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_FreeStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer,
|
||||
+ DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME length)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x, %s, %s\n", This, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(length));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
|
||||
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %x, %d, %p, %p\n", This, flags, count, buffers, status);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressor_mediaobj_Lock(IMediaObject *iface, LONG lock)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, lock);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectVtbl compressor_mediaobjectVtbl =
|
||||
+{
|
||||
+ compressor_mediaobj_QueryInterface,
|
||||
+ compressor_mediaobj_AddRef,
|
||||
+ compressor_mediaobj_Release,
|
||||
+ compressor_mediaobj_GetStreamCount,
|
||||
+ compressor_mediaobj_GetInputStreamInfo,
|
||||
+ compressor_mediaobj_GetOutputStreamInfo,
|
||||
+ compressor_mediaobj_GetInputType,
|
||||
+ compressor_mediaobj_GetOutputType,
|
||||
+ compressor_mediaobj_SetInputType,
|
||||
+ compressor_mediaobj_SetOutputType,
|
||||
+ compressor_mediaobj_GetInputCurrentType,
|
||||
+ compressor_mediaobj_GetOutputCurrentType,
|
||||
+ compressor_mediaobj_GetInputSizeInfo,
|
||||
+ compressor_mediaobj_GetOutputSizeInfo,
|
||||
+ compressor_mediaobj_GetInputMaxLatency,
|
||||
+ compressor_mediaobj_SetInputMaxLatency,
|
||||
+ compressor_mediaobj_Flush,
|
||||
+ compressor_mediaobj_Discontinuity,
|
||||
+ compressor_mediaobj_AllocateStreamingResources,
|
||||
+ compressor_mediaobj_FreeStreamingResources,
|
||||
+ compressor_mediaobj_GetInputStatus,
|
||||
+ compressor_mediaobj_ProcessInput,
|
||||
+ compressor_mediaobj_ProcessOutput,
|
||||
+ compressor_mediaobj_Lock
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI echo_mediainplace_QueryInterface(IMediaObjectInPlace *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXCompressor_QueryInterface(&This->IDirectSoundFXCompressor_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI echo_mediainplace_AddRef(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXCompressor_AddRef(&This->IDirectSoundFXCompressor_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI echo_mediainplace_Release(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXCompressor_Release(&This->IDirectSoundFXCompressor_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI echo_mediainplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ static BOOL once = 0;
|
||||
+ if(!once++)
|
||||
+ FIXME("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ else
|
||||
+ TRACE("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI echo_mediainplace_Clone(IMediaObjectInPlace *iface, IMediaObjectInPlace **object)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, object);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI echo_mediainplace_GetLatency(IMediaObjectInPlace *iface, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectInPlaceVtbl compressor_mediainplaceVtbl =
|
||||
+{
|
||||
+ echo_mediainplace_QueryInterface,
|
||||
+ echo_mediainplace_AddRef,
|
||||
+ echo_mediainplace_Release,
|
||||
+ echo_mediainplace_Process,
|
||||
+ echo_mediainplace_Clone,
|
||||
+ echo_mediainplace_GetLatency
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI compressorfx_QueryInterface(IDirectSoundFXCompressor *iface, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IDirectSoundFXCompressor(iface);
|
||||
+
|
||||
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(riid, &IID_IDirectSoundFXCompressor))
|
||||
+ {
|
||||
+ *ppv = &This->IDirectSoundFXCompressor_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObject))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObject_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObjectInPlace))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObjectInPlace_iface;
|
||||
+ }
|
||||
+
|
||||
+ if(!*ppv)
|
||||
+ {
|
||||
+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ IUnknown_AddRef((IUnknown*)*ppv);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI compressorfx_AddRef(IDirectSoundFXCompressor *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IDirectSoundFXCompressor(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI compressorfx_Release(IDirectSoundFXCompressor *iface)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IDirectSoundFXCompressor(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ heap_free(This);
|
||||
+ }
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressorfx_SetAllParameters(IDirectSoundFXCompressor *iface, const DSFXCompressor *compressor)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IDirectSoundFXCompressor(iface);
|
||||
+ FIXME("(%p) %p\n", This, compressor);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI compressorfx_GetAllParameters(IDirectSoundFXCompressor *iface, DSFXCompressor *compressor)
|
||||
+{
|
||||
+ struct dmo_compressorfx *This = impl_from_IDirectSoundFXCompressor(iface);
|
||||
+ FIXME("(%p) %p\n", This, compressor);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IDirectSoundFXCompressorVtbl echofxVtbl =
|
||||
+{
|
||||
+ compressorfx_QueryInterface,
|
||||
+ compressorfx_AddRef,
|
||||
+ compressorfx_Release,
|
||||
+ compressorfx_SetAllParameters,
|
||||
+ compressorfx_GetAllParameters
|
||||
+};
|
||||
+
|
||||
+HRESULT WINAPI CompressorFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_compressorfx *object;
|
||||
+ HRESULT ret;
|
||||
+
|
||||
+ TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ *ppv = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->IDirectSoundFXCompressor_iface.lpVtbl = &echofxVtbl;
|
||||
+ object->IMediaObject_iface.lpVtbl = &compressor_mediaobjectVtbl;
|
||||
+ object->IMediaObjectInPlace_iface.lpVtbl = &compressor_mediainplaceVtbl;
|
||||
+ object->ref = 1;
|
||||
+
|
||||
+ ret = compressorfx_QueryInterface(&object->IDirectSoundFXCompressor_iface, riid, ppv);
|
||||
+ compressorfx_Release(&object->IDirectSoundFXCompressor_iface);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_classes.idl b/dlls/dsdmo/dsdmo_classes.idl
|
||||
index ba1a8f6ff4..f7f139de30 100644
|
||||
--- a/dlls/dsdmo/dsdmo_classes.idl
|
||||
+++ b/dlls/dsdmo/dsdmo_classes.idl
|
||||
@@ -36,3 +36,13 @@ coclass DirectSoundEchoDMO
|
||||
coclass DirectSoundChorusDMO
|
||||
{
|
||||
}
|
||||
+
|
||||
+[
|
||||
+ uuid(ef011f79-4000-406d-87af-bffb3fc39d57),
|
||||
+ threading(both),
|
||||
+ progid("Microsoft.DirectSoundCompressorDMO.1"),
|
||||
+ vi_progid("Microsoft.DirectSoundCompressorDMO")
|
||||
+]
|
||||
+coclass DirectSoundCompressorDMO
|
||||
+{
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_private.h b/dlls/dsdmo/dsdmo_private.h
|
||||
index cbe906e472..96c0c061ee 100644
|
||||
--- a/dlls/dsdmo/dsdmo_private.h
|
||||
+++ b/dlls/dsdmo/dsdmo_private.h
|
||||
@@ -29,5 +29,6 @@
|
||||
|
||||
extern HRESULT WINAPI EchoFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI CompressorFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
|
||||
index 5a89eaff39..13d4af7adc 100644
|
||||
--- a/dlls/dsdmo/main.c
|
||||
+++ b/dlls/dsdmo/main.c
|
||||
@@ -102,8 +102,17 @@ static const IClassFactoryVtbl ChrousFactoryVtbl = {
|
||||
ClassFactory_LockServer
|
||||
};
|
||||
|
||||
+static const IClassFactoryVtbl CompressorFactoryVtbl = {
|
||||
+ ClassFactory_QueryInterface,
|
||||
+ ClassFactory_AddRef,
|
||||
+ ClassFactory_Release,
|
||||
+ CompressorFactory_CreateInstance,
|
||||
+ ClassFactory_LockServer
|
||||
+};
|
||||
+
|
||||
static IClassFactory echofx_factory = { &EchoFactoryVtbl };
|
||||
static IClassFactory chorusfx_factory = { &ChrousFactoryVtbl };
|
||||
+static IClassFactory compressorfx_factory = { &CompressorFactoryVtbl };
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject
|
||||
@@ -122,6 +131,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
TRACE("GUID_DSFX_STANDARD_CHORUS\n");
|
||||
return IClassFactory_QueryInterface(&chorusfx_factory, riid, ppv);
|
||||
}
|
||||
+ else if(IsEqualGUID(&GUID_DSFX_STANDARD_COMPRESSOR, rclsid))
|
||||
+ {
|
||||
+ TRACE("GUID_DSFX_STANDARD_COMPRESSOR\n");
|
||||
+ return IClassFactory_QueryInterface(&compressorfx_factory, riid, ppv);
|
||||
+ }
|
||||
|
||||
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,496 +0,0 @@
|
||||
From 63f04f4a7272534796dd9b942a6dd0fe874699d2 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sun, 25 Aug 2019 15:00:07 +1000
|
||||
Subject: [PATCH] dsdmo: Add IDirectSoundFXDistortion support
|
||||
|
||||
---
|
||||
dlls/dsdmo/Makefile.in | 1 +
|
||||
dlls/dsdmo/distortion.c | 397 +++++++++++++++++++++++++++++++++++
|
||||
dlls/dsdmo/dsdmo_classes.idl | 10 +
|
||||
dlls/dsdmo/dsdmo_private.h | 1 +
|
||||
dlls/dsdmo/main.c | 14 ++
|
||||
5 files changed, 423 insertions(+)
|
||||
create mode 100644 dlls/dsdmo/distortion.c
|
||||
|
||||
diff --git a/dlls/dsdmo/Makefile.in b/dlls/dsdmo/Makefile.in
|
||||
index d0b10ac4f9..0a1efa0462 100644
|
||||
--- a/dlls/dsdmo/Makefile.in
|
||||
+++ b/dlls/dsdmo/Makefile.in
|
||||
@@ -5,6 +5,7 @@ EXTRADLLFLAGS = -mno-cygwin
|
||||
C_SRCS = \
|
||||
chorus.c \
|
||||
compressor.c \
|
||||
+ distortion.c \
|
||||
echo.c \
|
||||
main.c
|
||||
|
||||
diff --git a/dlls/dsdmo/distortion.c b/dlls/dsdmo/distortion.c
|
||||
new file mode 100644
|
||||
index 0000000000..92e498b6f1
|
||||
--- /dev/null
|
||||
+++ b/dlls/dsdmo/distortion.c
|
||||
@@ -0,0 +1,397 @@
|
||||
+/*
|
||||
+ * 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
|
||||
+ */
|
||||
+#define COBJMACROS
|
||||
+
|
||||
+#include "dsdmo_private.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(dsdmo);
|
||||
+
|
||||
+struct dmo_distortionfx
|
||||
+{
|
||||
+ IDirectSoundFXDistortion IDirectSoundFXDistortion_iface;
|
||||
+ IMediaObject IMediaObject_iface;
|
||||
+ IMediaObjectInPlace IMediaObjectInPlace_iface;
|
||||
+ LONG ref;
|
||||
+};
|
||||
+
|
||||
+static inline struct dmo_distortionfx *impl_from_IDirectSoundFXDistortion(IDirectSoundFXDistortion *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_distortionfx, IDirectSoundFXDistortion_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_distortionfx *impl_from_IMediaObject(IMediaObject *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_distortionfx, IMediaObject_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_distortionfx *impl_from_IMediaObjectInPlace(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_distortionfx, IMediaObjectInPlace_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_QueryInterface(IMediaObject *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXDistortion_QueryInterface(&This->IDirectSoundFXDistortion_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_mediaobj_AddRef(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXDistortion_AddRef(&This->IDirectSoundFXDistortion_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_mediaobj_Release(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXDistortion_Release(&This->IDirectSoundFXDistortion_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetStreamCount(IMediaObject *iface, DWORD *inputs, DWORD *outputs)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %p, %p\n", This, inputs, outputs);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetOutputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *ahead, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p, %p\n", This, index, size, ahead, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p\n", This, index, size, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %s\n", This, index, wine_dbgstr_longlong(latency));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_Flush(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_Discontinuity(IMediaObject *iface, DWORD index)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, index);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_AllocateStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_FreeStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer,
|
||||
+ DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME length)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x, %s, %s\n", This, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(length));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
|
||||
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %x, %d, %p, %p\n", This, flags, count, buffers, status);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediaobj_Lock(IMediaObject *iface, LONG lock)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, lock);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectVtbl distortionfx_mediaobjectVtbl =
|
||||
+{
|
||||
+ distortionfx_mediaobj_QueryInterface,
|
||||
+ distortionfx_mediaobj_AddRef,
|
||||
+ distortionfx_mediaobj_Release,
|
||||
+ distortionfx_mediaobj_GetStreamCount,
|
||||
+ distortionfx_mediaobj_GetInputStreamInfo,
|
||||
+ distortionfx_mediaobj_GetOutputStreamInfo,
|
||||
+ distortionfx_mediaobj_GetInputType,
|
||||
+ distortionfx_mediaobj_GetOutputType,
|
||||
+ distortionfx_mediaobj_SetInputType,
|
||||
+ distortionfx_mediaobj_SetOutputType,
|
||||
+ distortionfx_mediaobj_GetInputCurrentType,
|
||||
+ distortionfx_mediaobj_GetOutputCurrentType,
|
||||
+ distortionfx_mediaobj_GetInputSizeInfo,
|
||||
+ distortionfx_mediaobj_GetOutputSizeInfo,
|
||||
+ distortionfx_mediaobj_GetInputMaxLatency,
|
||||
+ distortionfx_mediaobj_SetInputMaxLatency,
|
||||
+ distortionfx_mediaobj_Flush,
|
||||
+ distortionfx_mediaobj_Discontinuity,
|
||||
+ distortionfx_mediaobj_AllocateStreamingResources,
|
||||
+ distortionfx_mediaobj_FreeStreamingResources,
|
||||
+ distortionfx_mediaobj_GetInputStatus,
|
||||
+ distortionfx_mediaobj_ProcessInput,
|
||||
+ distortionfx_mediaobj_ProcessOutput,
|
||||
+ distortionfx_mediaobj_Lock
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediainplace_QueryInterface(IMediaObjectInPlace *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXDistortion_QueryInterface(&This->IDirectSoundFXDistortion_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_mediainplace_AddRef(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXDistortion_AddRef(&This->IDirectSoundFXDistortion_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_mediainplace_Release(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXDistortion_Release(&This->IDirectSoundFXDistortion_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediainplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ static BOOL once = 0;
|
||||
+ if(!once++)
|
||||
+ FIXME("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ else
|
||||
+ TRACE("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediainplace_Clone(IMediaObjectInPlace *iface, IMediaObjectInPlace **object)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, object);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_mediainplace_GetLatency(IMediaObjectInPlace *iface, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectInPlaceVtbl distortionfx_mediainplaceVtbl =
|
||||
+{
|
||||
+ distortionfx_mediainplace_QueryInterface,
|
||||
+ distortionfx_mediainplace_AddRef,
|
||||
+ distortionfx_mediainplace_Release,
|
||||
+ distortionfx_mediainplace_Process,
|
||||
+ distortionfx_mediainplace_Clone,
|
||||
+ distortionfx_mediainplace_GetLatency
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_QueryInterface(IDirectSoundFXDistortion *iface, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface);
|
||||
+
|
||||
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(riid, &IID_IDirectSoundFXDistortion))
|
||||
+ {
|
||||
+ *ppv = &This->IDirectSoundFXDistortion_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObject))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObject_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObjectInPlace))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObjectInPlace_iface;
|
||||
+ }
|
||||
+
|
||||
+ if(!*ppv)
|
||||
+ {
|
||||
+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ IUnknown_AddRef((IUnknown*)*ppv);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_AddRef(IDirectSoundFXDistortion *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI distortionfx_Release(IDirectSoundFXDistortion *iface)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ heap_free(This);
|
||||
+ }
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_SetAllParameters(IDirectSoundFXDistortion *iface, const DSFXDistortion *distortion)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface);
|
||||
+ FIXME("(%p) %p\n", This, distortion);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI distortionfx_GetAllParameters(IDirectSoundFXDistortion *iface, DSFXDistortion *distortion)
|
||||
+{
|
||||
+ struct dmo_distortionfx *This = impl_from_IDirectSoundFXDistortion(iface);
|
||||
+ FIXME("(%p) %p\n", This, distortion);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IDirectSoundFXDistortionVtbl distortionfxVtbl =
|
||||
+{
|
||||
+ distortionfx_QueryInterface,
|
||||
+ distortionfx_AddRef,
|
||||
+ distortionfx_Release,
|
||||
+ distortionfx_SetAllParameters,
|
||||
+ distortionfx_GetAllParameters
|
||||
+};
|
||||
+
|
||||
+HRESULT WINAPI DistortionFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_distortionfx *object;
|
||||
+ HRESULT ret;
|
||||
+
|
||||
+ TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ *ppv = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->IDirectSoundFXDistortion_iface.lpVtbl = &distortionfxVtbl;
|
||||
+ object->IMediaObject_iface.lpVtbl = &distortionfx_mediaobjectVtbl;
|
||||
+ object->IMediaObjectInPlace_iface.lpVtbl = &distortionfx_mediainplaceVtbl;
|
||||
+ object->ref = 1;
|
||||
+
|
||||
+ ret = distortionfx_QueryInterface(&object->IDirectSoundFXDistortion_iface, riid, ppv);
|
||||
+ distortionfx_Release(&object->IDirectSoundFXDistortion_iface);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_classes.idl b/dlls/dsdmo/dsdmo_classes.idl
|
||||
index f7f139de30..8060d4c2af 100644
|
||||
--- a/dlls/dsdmo/dsdmo_classes.idl
|
||||
+++ b/dlls/dsdmo/dsdmo_classes.idl
|
||||
@@ -46,3 +46,13 @@ coclass DirectSoundChorusDMO
|
||||
coclass DirectSoundCompressorDMO
|
||||
{
|
||||
}
|
||||
+
|
||||
+[
|
||||
+ uuid(ef114c90-cd1d-484e-96e5-09cfaf912a21),
|
||||
+ threading(both),
|
||||
+ progid("Microsoft.DirectSoundDistortionDMO.1"),
|
||||
+ vi_progid("Microsoft.DirectSoundDistortionDMO")
|
||||
+]
|
||||
+coclass DirectSoundDistortionDMO
|
||||
+{
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_private.h b/dlls/dsdmo/dsdmo_private.h
|
||||
index 96c0c061ee..03186366c6 100644
|
||||
--- a/dlls/dsdmo/dsdmo_private.h
|
||||
+++ b/dlls/dsdmo/dsdmo_private.h
|
||||
@@ -30,5 +30,6 @@
|
||||
extern HRESULT WINAPI EchoFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI CompressorFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI DistortionFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
|
||||
index 539626973d..a7671a5095 100644
|
||||
--- a/dlls/dsdmo/main.c
|
||||
+++ b/dlls/dsdmo/main.c
|
||||
@@ -107,9 +107,18 @@ static const IClassFactoryVtbl CompressorFactoryVtbl = {
|
||||
ClassFactory_LockServer
|
||||
};
|
||||
|
||||
+static const IClassFactoryVtbl DistortionFactoryVtbl = {
|
||||
+ ClassFactory_QueryInterface,
|
||||
+ ClassFactory_AddRef,
|
||||
+ ClassFactory_Release,
|
||||
+ DistortionFactory_CreateInstance,
|
||||
+ ClassFactory_LockServer
|
||||
+};
|
||||
+
|
||||
static IClassFactory echofx_factory = { &EchoFactoryVtbl };
|
||||
static IClassFactory chorusfx_factory = { &ChrousFactoryVtbl };
|
||||
static IClassFactory compressorfx_factory = { &CompressorFactoryVtbl };
|
||||
+static IClassFactory distortionfx_factory = { &DistortionFactoryVtbl };
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject
|
||||
@@ -133,6 +142,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
TRACE("GUID_DSFX_STANDARD_COMPRESSOR\n");
|
||||
return IClassFactory_QueryInterface(&compressorfx_factory, riid, ppv);
|
||||
}
|
||||
+ else if(IsEqualGUID(&GUID_DSFX_STANDARD_DISTORTION, rclsid))
|
||||
+ {
|
||||
+ TRACE("GUID_DSFX_STANDARD_DISTORTION\n");
|
||||
+ return IClassFactory_QueryInterface(&distortionfx_factory, riid, ppv);
|
||||
+ }
|
||||
|
||||
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,497 +0,0 @@
|
||||
From aa9c0ccf2a014880c1bf469bf349d8d0e0eba83b Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sun, 25 Aug 2019 16:51:33 +1000
|
||||
Subject: [PATCH] dsdmo: Add IDirectSoundFXFlanger support
|
||||
|
||||
---
|
||||
dlls/dsdmo/Makefile.in | 1 +
|
||||
dlls/dsdmo/dsdmo_classes.idl | 10 +
|
||||
dlls/dsdmo/dsdmo_private.h | 1 +
|
||||
dlls/dsdmo/flanger.c | 397 +++++++++++++++++++++++++++++++++++
|
||||
dlls/dsdmo/main.c | 14 ++
|
||||
5 files changed, 423 insertions(+)
|
||||
create mode 100644 dlls/dsdmo/flanger.c
|
||||
|
||||
diff --git a/dlls/dsdmo/Makefile.in b/dlls/dsdmo/Makefile.in
|
||||
index 0a1efa0462c..2c4a0eabbd9 100644
|
||||
--- a/dlls/dsdmo/Makefile.in
|
||||
+++ b/dlls/dsdmo/Makefile.in
|
||||
@@ -7,6 +7,7 @@ C_SRCS = \
|
||||
compressor.c \
|
||||
distortion.c \
|
||||
echo.c \
|
||||
+ flanger.c \
|
||||
main.c
|
||||
|
||||
IDL_SRCS = dsdmo_classes.idl
|
||||
diff --git a/dlls/dsdmo/dsdmo_classes.idl b/dlls/dsdmo/dsdmo_classes.idl
|
||||
index 8060d4c2af3..48d1f96e888 100644
|
||||
--- a/dlls/dsdmo/dsdmo_classes.idl
|
||||
+++ b/dlls/dsdmo/dsdmo_classes.idl
|
||||
@@ -56,3 +56,13 @@ coclass DirectSoundCompressorDMO
|
||||
coclass DirectSoundDistortionDMO
|
||||
{
|
||||
}
|
||||
+
|
||||
+[
|
||||
+ uuid(efca3d92-dfd8-4672-a603-7420894bad98),
|
||||
+ threading(both),
|
||||
+ progid("Microsoft.DirectSoundFlangerDMO.1"),
|
||||
+ vi_progid("Microsoft.DirectSoundFlangerDMO")
|
||||
+]
|
||||
+coclass DirectSoundFlangerDMO
|
||||
+{
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_private.h b/dlls/dsdmo/dsdmo_private.h
|
||||
index 03186366c64..027fb6e177f 100644
|
||||
--- a/dlls/dsdmo/dsdmo_private.h
|
||||
+++ b/dlls/dsdmo/dsdmo_private.h
|
||||
@@ -31,5 +31,6 @@ extern HRESULT WINAPI EchoFactory_CreateInstance(IClassFactory *iface, IUnknown
|
||||
extern HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI CompressorFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI DistortionFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI FlangerFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/dsdmo/flanger.c b/dlls/dsdmo/flanger.c
|
||||
new file mode 100644
|
||||
index 00000000000..ea70bc929ba
|
||||
--- /dev/null
|
||||
+++ b/dlls/dsdmo/flanger.c
|
||||
@@ -0,0 +1,397 @@
|
||||
+/*
|
||||
+ * 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
|
||||
+ */
|
||||
+#define COBJMACROS
|
||||
+
|
||||
+#include "dsdmo_private.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(dsdmo);
|
||||
+
|
||||
+struct dmo_flangerfx
|
||||
+{
|
||||
+ IDirectSoundFXFlanger IDirectSoundFXFlanger_iface;
|
||||
+ IMediaObject IMediaObject_iface;
|
||||
+ IMediaObjectInPlace IMediaObjectInPlace_iface;
|
||||
+ LONG ref;
|
||||
+};
|
||||
+
|
||||
+static inline struct dmo_flangerfx *impl_from_IDirectSoundFXFlanger(IDirectSoundFXFlanger *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_flangerfx, IDirectSoundFXFlanger_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_flangerfx *impl_from_IMediaObject(IMediaObject *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_flangerfx, IMediaObject_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_flangerfx *impl_from_IMediaObjectInPlace(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_flangerfx, IMediaObjectInPlace_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_QueryInterface(IMediaObject *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXFlanger_QueryInterface(&This->IDirectSoundFXFlanger_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flanger_mediaobj_AddRef(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXFlanger_AddRef(&This->IDirectSoundFXFlanger_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flanger_mediaobj_Release(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXFlanger_Release(&This->IDirectSoundFXFlanger_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetStreamCount(IMediaObject *iface, DWORD *inputs, DWORD *outputs)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %p, %p\n", This, inputs, outputs);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetOutputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *ahead, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p, %p\n", This, index, size, ahead, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p\n", This, index, size, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %s\n", This, index, wine_dbgstr_longlong(latency));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_Flush(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_Discontinuity(IMediaObject *iface, DWORD index)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, index);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_AllocateStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_FreeStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer,
|
||||
+ DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME length)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x, %s, %s\n", This, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(length));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
|
||||
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %x, %d, %p, %p\n", This, flags, count, buffers, status);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediaobj_Lock(IMediaObject *iface, LONG lock)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, lock);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectVtbl flanger_mediaobjectVtbl =
|
||||
+{
|
||||
+ flanger_mediaobj_QueryInterface,
|
||||
+ flanger_mediaobj_AddRef,
|
||||
+ flanger_mediaobj_Release,
|
||||
+ flanger_mediaobj_GetStreamCount,
|
||||
+ flanger_mediaobj_GetInputStreamInfo,
|
||||
+ flanger_mediaobj_GetOutputStreamInfo,
|
||||
+ flanger_mediaobj_GetInputType,
|
||||
+ flanger_mediaobj_GetOutputType,
|
||||
+ flanger_mediaobj_SetInputType,
|
||||
+ flanger_mediaobj_SetOutputType,
|
||||
+ flanger_mediaobj_GetInputCurrentType,
|
||||
+ flanger_mediaobj_GetOutputCurrentType,
|
||||
+ flanger_mediaobj_GetInputSizeInfo,
|
||||
+ flanger_mediaobj_GetOutputSizeInfo,
|
||||
+ flanger_mediaobj_GetInputMaxLatency,
|
||||
+ flanger_mediaobj_SetInputMaxLatency,
|
||||
+ flanger_mediaobj_Flush,
|
||||
+ flanger_mediaobj_Discontinuity,
|
||||
+ flanger_mediaobj_AllocateStreamingResources,
|
||||
+ flanger_mediaobj_FreeStreamingResources,
|
||||
+ flanger_mediaobj_GetInputStatus,
|
||||
+ flanger_mediaobj_ProcessInput,
|
||||
+ flanger_mediaobj_ProcessOutput,
|
||||
+ flanger_mediaobj_Lock
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediainplace_QueryInterface(IMediaObjectInPlace *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXFlanger_QueryInterface(&This->IDirectSoundFXFlanger_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flanger_mediainplace_AddRef(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXFlanger_AddRef(&This->IDirectSoundFXFlanger_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flanger_mediainplace_Release(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXFlanger_Release(&This->IDirectSoundFXFlanger_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediainplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ static BOOL once = 0;
|
||||
+ if(!once++)
|
||||
+ FIXME("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ else
|
||||
+ TRACE("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediainplace_Clone(IMediaObjectInPlace *iface, IMediaObjectInPlace **object)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, object);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flanger_mediainplace_GetLatency(IMediaObjectInPlace *iface, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectInPlaceVtbl flanger_mediainplaceVtbl =
|
||||
+{
|
||||
+ flanger_mediainplace_QueryInterface,
|
||||
+ flanger_mediainplace_AddRef,
|
||||
+ flanger_mediainplace_Release,
|
||||
+ flanger_mediainplace_Process,
|
||||
+ flanger_mediainplace_Clone,
|
||||
+ flanger_mediainplace_GetLatency
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI flangerfx_QueryInterface(IDirectSoundFXFlanger *iface, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IDirectSoundFXFlanger(iface);
|
||||
+
|
||||
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(riid, &IID_IDirectSoundFXFlanger))
|
||||
+ {
|
||||
+ *ppv = &This->IDirectSoundFXFlanger_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObject))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObject_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObjectInPlace))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObjectInPlace_iface;
|
||||
+ }
|
||||
+
|
||||
+ if(!*ppv)
|
||||
+ {
|
||||
+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ IUnknown_AddRef((IUnknown*)*ppv);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flangerfx_AddRef(IDirectSoundFXFlanger *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IDirectSoundFXFlanger(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI flangerfx_Release(IDirectSoundFXFlanger *iface)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IDirectSoundFXFlanger(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ heap_free(This);
|
||||
+ }
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flangerfx_SetAllParameters(IDirectSoundFXFlanger *iface, const DSFXFlanger *flanger)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IDirectSoundFXFlanger(iface);
|
||||
+ FIXME("(%p) %p\n", This, flanger);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI flangerfx_GetAllParameters(IDirectSoundFXFlanger *iface, DSFXFlanger *flanger)
|
||||
+{
|
||||
+ struct dmo_flangerfx *This = impl_from_IDirectSoundFXFlanger(iface);
|
||||
+ FIXME("(%p) %p\n", This, flanger);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IDirectSoundFXFlangerVtbl flangerfxVtbl =
|
||||
+{
|
||||
+ flangerfx_QueryInterface,
|
||||
+ flangerfx_AddRef,
|
||||
+ flangerfx_Release,
|
||||
+ flangerfx_SetAllParameters,
|
||||
+ flangerfx_GetAllParameters
|
||||
+};
|
||||
+
|
||||
+HRESULT WINAPI FlangerFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_flangerfx *object;
|
||||
+ HRESULT ret;
|
||||
+
|
||||
+ TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ *ppv = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->IDirectSoundFXFlanger_iface.lpVtbl = &flangerfxVtbl;
|
||||
+ object->IMediaObject_iface.lpVtbl = &flanger_mediaobjectVtbl;
|
||||
+ object->IMediaObjectInPlace_iface.lpVtbl = &flanger_mediainplaceVtbl;
|
||||
+ object->ref = 1;
|
||||
+
|
||||
+ ret = flangerfx_QueryInterface(&object->IDirectSoundFXFlanger_iface, riid, ppv);
|
||||
+ flangerfx_Release(&object->IDirectSoundFXFlanger_iface);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
|
||||
index a7671a5095c..8ea1b625ea1 100644
|
||||
--- a/dlls/dsdmo/main.c
|
||||
+++ b/dlls/dsdmo/main.c
|
||||
@@ -115,10 +115,19 @@ static const IClassFactoryVtbl DistortionFactoryVtbl = {
|
||||
ClassFactory_LockServer
|
||||
};
|
||||
|
||||
+static const IClassFactoryVtbl FlangerFactoryVtbl = {
|
||||
+ ClassFactory_QueryInterface,
|
||||
+ ClassFactory_AddRef,
|
||||
+ ClassFactory_Release,
|
||||
+ FlangerFactory_CreateInstance,
|
||||
+ ClassFactory_LockServer
|
||||
+};
|
||||
+
|
||||
static IClassFactory echofx_factory = { &EchoFactoryVtbl };
|
||||
static IClassFactory chorusfx_factory = { &ChrousFactoryVtbl };
|
||||
static IClassFactory compressorfx_factory = { &CompressorFactoryVtbl };
|
||||
static IClassFactory distortionfx_factory = { &DistortionFactoryVtbl };
|
||||
+static IClassFactory flangerfx_factory = { &FlangerFactoryVtbl };
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject
|
||||
@@ -147,6 +156,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
TRACE("GUID_DSFX_STANDARD_DISTORTION\n");
|
||||
return IClassFactory_QueryInterface(&distortionfx_factory, riid, ppv);
|
||||
}
|
||||
+ else if(IsEqualGUID(&GUID_DSFX_STANDARD_FLANGER, rclsid))
|
||||
+ {
|
||||
+ TRACE("GUID_DSFX_STANDARD_FLANGER\n");
|
||||
+ return IClassFactory_QueryInterface(&flangerfx_factory, riid, ppv);
|
||||
+ }
|
||||
|
||||
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,498 +0,0 @@
|
||||
From 333193fd90ac8673052b1bb983b656bbfea5c6a8 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Mon, 26 Aug 2019 09:03:54 +1000
|
||||
Subject: [PATCH] dsdmo: Add IDirectSoundFXGargle support.
|
||||
|
||||
---
|
||||
dlls/dsdmo/Makefile.in | 1 +
|
||||
dlls/dsdmo/dsdmo_classes.idl | 10 +
|
||||
dlls/dsdmo/dsdmo_private.h | 1 +
|
||||
dlls/dsdmo/gargle.c | 397 +++++++++++++++++++++++++++++++++++
|
||||
dlls/dsdmo/main.c | 14 ++
|
||||
5 files changed, 423 insertions(+)
|
||||
create mode 100644 dlls/dsdmo/gargle.c
|
||||
|
||||
diff --git a/dlls/dsdmo/Makefile.in b/dlls/dsdmo/Makefile.in
|
||||
index 2c4a0eabbd9..7b021a4c4f9 100644
|
||||
--- a/dlls/dsdmo/Makefile.in
|
||||
+++ b/dlls/dsdmo/Makefile.in
|
||||
@@ -8,6 +8,7 @@ C_SRCS = \
|
||||
distortion.c \
|
||||
echo.c \
|
||||
flanger.c \
|
||||
+ gargle.c \
|
||||
main.c
|
||||
|
||||
IDL_SRCS = dsdmo_classes.idl
|
||||
diff --git a/dlls/dsdmo/dsdmo_classes.idl b/dlls/dsdmo/dsdmo_classes.idl
|
||||
index 48d1f96e888..f114f4831b9 100644
|
||||
--- a/dlls/dsdmo/dsdmo_classes.idl
|
||||
+++ b/dlls/dsdmo/dsdmo_classes.idl
|
||||
@@ -66,3 +66,13 @@ coclass DirectSoundDistortionDMO
|
||||
coclass DirectSoundFlangerDMO
|
||||
{
|
||||
}
|
||||
+
|
||||
+[
|
||||
+ uuid(dafd8210-5711-4b91-9fe3-f75b7ae279bf),
|
||||
+ threading(both),
|
||||
+ progid("Microsoft.DirectSoundGargleDMO.1"),
|
||||
+ vi_progid("Microsoft.DirectSoundGargleDMO")
|
||||
+]
|
||||
+coclass DirectSoundGargleDMO
|
||||
+{
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/dsdmo_private.h b/dlls/dsdmo/dsdmo_private.h
|
||||
index 027fb6e177f..313c66ba3df 100644
|
||||
--- a/dlls/dsdmo/dsdmo_private.h
|
||||
+++ b/dlls/dsdmo/dsdmo_private.h
|
||||
@@ -32,5 +32,6 @@ extern HRESULT WINAPI ChrousFactory_CreateInstance(IClassFactory *iface, IUnknow
|
||||
extern HRESULT WINAPI CompressorFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI DistortionFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
extern HRESULT WINAPI FlangerFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
+extern HRESULT WINAPI GargleFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
|
||||
|
||||
#endif
|
||||
diff --git a/dlls/dsdmo/gargle.c b/dlls/dsdmo/gargle.c
|
||||
new file mode 100644
|
||||
index 00000000000..7ad1e30b67b
|
||||
--- /dev/null
|
||||
+++ b/dlls/dsdmo/gargle.c
|
||||
@@ -0,0 +1,397 @@
|
||||
+/*
|
||||
+ * 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
|
||||
+ */
|
||||
+#define COBJMACROS
|
||||
+
|
||||
+#include "dsdmo_private.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(dsdmo);
|
||||
+
|
||||
+struct dmo_garglefx
|
||||
+{
|
||||
+ IDirectSoundFXGargle IDirectSoundFXGargle_iface;
|
||||
+ IMediaObject IMediaObject_iface;
|
||||
+ IMediaObjectInPlace IMediaObjectInPlace_iface;
|
||||
+ LONG ref;
|
||||
+};
|
||||
+
|
||||
+static inline struct dmo_garglefx *impl_from_IDirectSoundFXGargle(IDirectSoundFXGargle *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_garglefx, IDirectSoundFXGargle_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_garglefx *impl_from_IMediaObject(IMediaObject *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_garglefx, IMediaObject_iface);
|
||||
+}
|
||||
+
|
||||
+static inline struct dmo_garglefx *impl_from_IMediaObjectInPlace(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct dmo_garglefx, IMediaObjectInPlace_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_QueryInterface(IMediaObject *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXGargle_QueryInterface(&This->IDirectSoundFXGargle_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI gargle_mediaobj_AddRef(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXGargle_AddRef(&This->IDirectSoundFXGargle_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI gargle_mediaobj_Release(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ return IDirectSoundFXGargle_Release(&This->IDirectSoundFXGargle_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetStreamCount(IMediaObject *iface, DWORD *inputs, DWORD *outputs)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %p, %p\n", This, inputs, outputs);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetOutputStreamInfo(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetOutputType(IMediaObject *iface, DWORD index, DWORD type, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %d, %p\n", This, index, type, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_SetInputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *pmt, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x\n", This, index, pmt, flags);
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *pmt)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, pmt);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *ahead, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p, %p\n", This, index, size, ahead, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %p\n", This, index, size, alignment);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_SetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME latency)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %s\n", This, index, wine_dbgstr_longlong(latency));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_Flush(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_Discontinuity(IMediaObject *iface, DWORD index)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, index);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_AllocateStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_FreeStreamingResources(IMediaObject *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p\n", This);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_GetInputStatus(IMediaObject *iface, DWORD index, DWORD *flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p\n", This, index, flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer,
|
||||
+ DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME length)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d, %p, %x, %s, %s\n", This, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(length));
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count,
|
||||
+ DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %x, %d, %p, %p\n", This, flags, count, buffers, status);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediaobj_Lock(IMediaObject *iface, LONG lock)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObject(iface);
|
||||
+ FIXME("%p, %d\n", This, lock);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectVtbl gargle_mediaobjectVtbl =
|
||||
+{
|
||||
+ gargle_mediaobj_QueryInterface,
|
||||
+ gargle_mediaobj_AddRef,
|
||||
+ gargle_mediaobj_Release,
|
||||
+ gargle_mediaobj_GetStreamCount,
|
||||
+ gargle_mediaobj_GetInputStreamInfo,
|
||||
+ gargle_mediaobj_GetOutputStreamInfo,
|
||||
+ gargle_mediaobj_GetInputType,
|
||||
+ gargle_mediaobj_GetOutputType,
|
||||
+ gargle_mediaobj_SetInputType,
|
||||
+ gargle_mediaobj_SetOutputType,
|
||||
+ gargle_mediaobj_GetInputCurrentType,
|
||||
+ gargle_mediaobj_GetOutputCurrentType,
|
||||
+ gargle_mediaobj_GetInputSizeInfo,
|
||||
+ gargle_mediaobj_GetOutputSizeInfo,
|
||||
+ gargle_mediaobj_GetInputMaxLatency,
|
||||
+ gargle_mediaobj_SetInputMaxLatency,
|
||||
+ gargle_mediaobj_Flush,
|
||||
+ gargle_mediaobj_Discontinuity,
|
||||
+ gargle_mediaobj_AllocateStreamingResources,
|
||||
+ gargle_mediaobj_FreeStreamingResources,
|
||||
+ gargle_mediaobj_GetInputStatus,
|
||||
+ gargle_mediaobj_ProcessInput,
|
||||
+ gargle_mediaobj_ProcessOutput,
|
||||
+ gargle_mediaobj_Lock
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediainplace_QueryInterface(IMediaObjectInPlace *iface, REFIID riid, void **obj)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXGargle_QueryInterface(&This->IDirectSoundFXGargle_iface, riid, obj);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI gargle_mediainplace_AddRef(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXGargle_AddRef(&This->IDirectSoundFXGargle_iface);
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI gargle_mediainplace_Release(IMediaObjectInPlace *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ return IDirectSoundFXGargle_Release(&This->IDirectSoundFXGargle_iface);
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediainplace_Process(IMediaObjectInPlace *iface, ULONG size, BYTE *data, REFERENCE_TIME start, DWORD flags)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ static BOOL once = 0;
|
||||
+ if(!once++)
|
||||
+ FIXME("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ else
|
||||
+ TRACE("%p, %d, %p, %s, %x\n", This, size, data, wine_dbgstr_longlong(start), flags);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediainplace_Clone(IMediaObjectInPlace *iface, IMediaObjectInPlace **object)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, object);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI gargle_mediainplace_GetLatency(IMediaObjectInPlace *iface, REFERENCE_TIME *latency)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IMediaObjectInPlace(iface);
|
||||
+ FIXME("%p, %p\n", This, latency);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const IMediaObjectInPlaceVtbl gargle_mediainplaceVtbl =
|
||||
+{
|
||||
+ gargle_mediainplace_QueryInterface,
|
||||
+ gargle_mediainplace_AddRef,
|
||||
+ gargle_mediainplace_Release,
|
||||
+ gargle_mediainplace_Process,
|
||||
+ gargle_mediainplace_Clone,
|
||||
+ gargle_mediainplace_GetLatency
|
||||
+};
|
||||
+
|
||||
+static HRESULT WINAPI garglefx_QueryInterface(IDirectSoundFXGargle *iface, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface);
|
||||
+
|
||||
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(riid, &IID_IDirectSoundFXGargle))
|
||||
+ {
|
||||
+ *ppv = &This->IDirectSoundFXGargle_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObject))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObject_iface;
|
||||
+ }
|
||||
+ else if(IsEqualGUID(riid, &IID_IMediaObjectInPlace))
|
||||
+ {
|
||||
+ *ppv = &This->IMediaObjectInPlace_iface;
|
||||
+ }
|
||||
+
|
||||
+ if(!*ppv)
|
||||
+ {
|
||||
+ FIXME("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppv);
|
||||
+ return E_NOINTERFACE;
|
||||
+ }
|
||||
+
|
||||
+ IUnknown_AddRef((IUnknown*)*ppv);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI garglefx_AddRef(IDirectSoundFXGargle *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG WINAPI garglefx_Release(IDirectSoundFXGargle *iface)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
+
|
||||
+ TRACE("(%p) ref=%u\n", This, ref);
|
||||
+
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ heap_free(This);
|
||||
+ }
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI garglefx_SetAllParameters(IDirectSoundFXGargle *iface, const DSFXGargle *gargle)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface);
|
||||
+ FIXME("(%p) %p\n", This, gargle);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT WINAPI garglefx_GetAllParameters(IDirectSoundFXGargle *iface, DSFXGargle *gargle)
|
||||
+{
|
||||
+ struct dmo_garglefx *This = impl_from_IDirectSoundFXGargle(iface);
|
||||
+ FIXME("(%p) %p\n", This, gargle);
|
||||
+
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IDirectSoundFXGargleVtbl garglefxVtbl =
|
||||
+{
|
||||
+ garglefx_QueryInterface,
|
||||
+ garglefx_AddRef,
|
||||
+ garglefx_Release,
|
||||
+ garglefx_SetAllParameters,
|
||||
+ garglefx_GetAllParameters
|
||||
+};
|
||||
+
|
||||
+HRESULT WINAPI GargleFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
|
||||
+{
|
||||
+ struct dmo_garglefx *object;
|
||||
+ HRESULT ret;
|
||||
+
|
||||
+ TRACE("(%p, %s, %p)\n", outer, debugstr_guid(riid), ppv);
|
||||
+
|
||||
+ *ppv = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
+ if (!object)
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->IDirectSoundFXGargle_iface.lpVtbl = &garglefxVtbl;
|
||||
+ object->IMediaObject_iface.lpVtbl = &gargle_mediaobjectVtbl;
|
||||
+ object->IMediaObjectInPlace_iface.lpVtbl = &gargle_mediainplaceVtbl;
|
||||
+ object->ref = 1;
|
||||
+
|
||||
+ ret = garglefx_QueryInterface(&object->IDirectSoundFXGargle_iface, riid, ppv);
|
||||
+ garglefx_Release(&object->IDirectSoundFXGargle_iface);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/dlls/dsdmo/main.c b/dlls/dsdmo/main.c
|
||||
index 8ea1b625ea1..74c3c08ee22 100644
|
||||
--- a/dlls/dsdmo/main.c
|
||||
+++ b/dlls/dsdmo/main.c
|
||||
@@ -123,11 +123,20 @@ static const IClassFactoryVtbl FlangerFactoryVtbl = {
|
||||
ClassFactory_LockServer
|
||||
};
|
||||
|
||||
+static const IClassFactoryVtbl GargleFactoryVtbl = {
|
||||
+ ClassFactory_QueryInterface,
|
||||
+ ClassFactory_AddRef,
|
||||
+ ClassFactory_Release,
|
||||
+ GargleFactory_CreateInstance,
|
||||
+ ClassFactory_LockServer
|
||||
+};
|
||||
+
|
||||
static IClassFactory echofx_factory = { &EchoFactoryVtbl };
|
||||
static IClassFactory chorusfx_factory = { &ChrousFactoryVtbl };
|
||||
static IClassFactory compressorfx_factory = { &CompressorFactoryVtbl };
|
||||
static IClassFactory distortionfx_factory = { &DistortionFactoryVtbl };
|
||||
static IClassFactory flangerfx_factory = { &FlangerFactoryVtbl };
|
||||
+static IClassFactory garglefx_factory = { &GargleFactoryVtbl };
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject
|
||||
@@ -161,6 +170,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
TRACE("GUID_DSFX_STANDARD_FLANGER\n");
|
||||
return IClassFactory_QueryInterface(&flangerfx_factory, riid, ppv);
|
||||
}
|
||||
+ else if(IsEqualGUID(&GUID_DSFX_STANDARD_GARGLE, rclsid))
|
||||
+ {
|
||||
+ TRACE("GUID_DSFX_STANDARD_GARGLE\n");
|
||||
+ return IClassFactory_QueryInterface(&garglefx_factory, riid, ppv);
|
||||
+ }
|
||||
|
||||
FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.17.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user