Compare commits

...

16 Commits
v5.10 ... v5.11

Author SHA1 Message Date
Alistair Leslie-Hughes
3d9a927266 Release v5.11 2020-06-20 11:51:49 +10:00
Zebediah Figura
8e5546184f ntdll-Junction_Points: Rebase and re-enable. 2020-06-18 20:41:39 -05:00
Zebediah Figura
d799e8fd82 Rebase against e80df2d2d54a3f16389bea77f6863cc1c05d6251. 2020-06-18 19:13:40 -05:00
Alistair Leslie-Hughes
02913f754f Rebase against 67ef5151744b347d4a30c985da6712fb0061e675. 2020-06-18 08:59:21 +10:00
Zebediah Figura
03f5adcafb advapi32-Token_Integrity_Level: Correct rebase. 2020-06-16 19:38:49 -05:00
Alistair Leslie-Hughes
984d402240 Rebase against f56e409c2feb62056eb133e53fe398eadd0a503e. 2020-06-17 10:06:04 +10:00
Zebediah Figura
32fcc0d75b Rebase against 634cb775c27b61ad6ce1fbe3e9972b0edfa31dcb. 2020-06-15 17:43:18 -05:00
Zebediah Figura
b6595d9e28 Rebase against 948a6a47b8dbd0ddd86cad04de03f0e4ba81b65d. 2020-06-12 18:15:13 -05:00
Alistair Leslie-Hughes
eb4f9db59c Updated wow64cpu-Wow64Transition patchset
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49025
2020-06-12 09:41:04 +10:00
Alistair Leslie-Hughes
11f545447b Rebase against 22970932d014f024fcf7f0f98b1a5384b1b1eb99. 2020-06-12 09:35:12 +10:00
Paul Gofman
7934e14fc0 Updated ntdll-Syscall_Emulation patchset.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49362
2020-06-11 15:26:30 +03:00
Paul Gofman
5306e1df11 Updated winebuild-Fake_Dlls patchset.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49357
2020-06-11 15:23:16 +03:00
Alistair Leslie-Hughes
938c0aa155 Rebase against 343043153b44fa46a2081fa8a2c171eac7c8dab6. 2020-06-11 08:44:26 +10:00
Zebediah Figura
cb2a6551bc Rebase against bf454cc39428fc5299e5c26d9c0ddc6a9277c7ae. 2020-06-09 18:27:57 -05:00
Zebediah Figura
9a4c8c5631 Rebase against 17529582402ebe27ef975fc7dcb8353f4f95e629. 2020-06-08 16:00:03 -05:00
Paul Gofman
044cb93066 Updated ntdll-ForceBottomUpAlloc patchset.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49326
2020-06-08 15:33:28 +03:00
87 changed files with 2396 additions and 3487 deletions

View File

@@ -1,4 +1,4 @@
From 90474eb9f6583f2e8fe0314cfa0b0dc04797833b Mon Sep 17 00:00:00 2001
From ed999d4430c1aca8f90f26670d3615cdaaab300d 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 1ebe07fc08c..7a19674b2f3 100644
index 0d19e12768f..e313d5807b3 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1586,6 +1586,9 @@
@@ -1594,6 +1594,9 @@
# Virtual memory
@ cdecl __wine_locked_recvmsg(long ptr long)
@@ -28,10 +28,10 @@ index 1ebe07fc08c..7a19674b2f3 100644
@ cdecl wine_get_version() NTDLL_wine_get_version
@ cdecl wine_get_build_id() NTDLL_wine_get_build_id
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 27e7141bc65..4baf8a3967b 100644
index 47800db41b1..12e7b721cb5 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -107,6 +107,9 @@ extern int __wine_main_argc;
@@ -86,6 +86,9 @@ extern int __wine_main_argc;
extern char **__wine_main_argv;
extern WCHAR **__wine_main_wargv;
@@ -42,10 +42,10 @@ index 27e7141bc65..4baf8a3967b 100644
extern const char *build_dir DECLSPEC_HIDDEN;
extern const char *data_dir DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 6c5f722b2a6..df81e061e7b 100644
index b1cc307d2ae..2e5fee216ef 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -119,6 +119,24 @@ HANDLE CDECL __wine_make_process_system(void)
@@ -85,6 +85,24 @@ HANDLE CDECL __wine_make_process_system(void)
return ret;
}
@@ -67,11 +67,11 @@ index 6c5f722b2a6..df81e061e7b 100644
+ return ret;
+}
+
static UINT process_error_mode;
#define UNIMPLEMENTED_INFO_CLASS(c) \
/******************************************************************************
* NtQueryInformationProcess [NTDLL.@]
* ZwQueryInformationProcess [NTDLL.@]
diff --git a/server/protocol.def b/server/protocol.def
index c53ceb50d50..947a3c971f5 100644
index 6e0f309450a..7315f8ac4ea 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3755,6 +3755,14 @@ struct handle_info
@@ -215,5 +215,5 @@ index c4f1cd943c2..970ed1838da 100644
+ }
+}
--
2.26.2
2.27.0

View File

@@ -1,4 +1,4 @@
From 0e9d9a6aa1b65dae1c8dc34d6d5fb27aa73f96ea Mon Sep 17 00:00:00 2001
From 1f2b1bafabfd457836f18741f178b3745e129c36 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 51addaaf983..71efed5fa32 100644
index 0c8f05285c4..92ae87c6e6d 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3903,6 +3903,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
@@ -3898,6 +3898,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
}
@@ -48,15 +48,15 @@ index 51addaaf983..71efed5fa32 100644
/***********************************************************************
* load_global_options
*/
@@ -4363,6 +4389,7 @@ void __wine_process_init(void)
's','y','s','t','e','m','3','2','\\',
@@ -4359,6 +4385,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;
+ ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
WINE_MODREF *wm;
NTSTATUS status;
ANSI_STRING func_name;
@@ -4466,6 +4493,16 @@ void __wine_process_init(void)
@@ -4453,6 +4480,16 @@ void __wine_process_init(void)
unix_funcs->virtual_set_large_address_space();
@@ -74,10 +74,10 @@ index 51addaaf983..71efed5fa32 100644
RemoveEntryList( &wm->ldr.InLoadOrderLinks );
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks );
diff --git a/server/process.c b/server/process.c
index 80a091b0c72..34010b301c3 100644
index ac85cace95d..52604ec4d61 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1112,6 +1112,14 @@ struct process_snapshot *process_snap( int *count )
@@ -1115,6 +1115,14 @@ struct process_snapshot *process_snap( int *count )
return snapshot;
}
@@ -105,10 +105,10 @@ index 5b83e111a6f..dfe5c4e52d8 100644
/* console functions */
extern void inherit_console( struct thread *parent_thread, struct process *parent,
diff --git a/server/protocol.def b/server/protocol.def
index d8618a5c964..89adc93305c 100644
index 7315f8ac4ea..901c380b721 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3762,6 +3762,13 @@ struct handle_info
@@ -3763,6 +3763,13 @@ struct handle_info
@END

View File

@@ -1,4 +1,4 @@
From 51830c6683b199e79cb9e782ee51555054a4da7c Mon Sep 17 00:00:00 2001
From 9c61f6acfa2c43e43f07fae1a5cd447573b9529b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 6 Aug 2017 02:08:05 +0200
Subject: [PATCH] server: Implement support for creating processes using a
@@ -6,20 +6,20 @@ Subject: [PATCH] server: Implement support for creating processes using a
---
dlls/kernelbase/process.c | 24 +++++++++++++-----------
dlls/ntdll/process.c | 3 ++-
dlls/ntdll/unix/process.c | 1 +
server/process.c | 39 +++++++++++++++++++++++++++++++++++----
server/process.h | 2 +-
server/protocol.def | 1 +
server/request.c | 2 +-
server/security.h | 2 ++
server/token.c | 11 +++++++++++
8 files changed, 66 insertions(+), 18 deletions(-)
8 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c
index a07dddb1f..99985ab89 100644
index a3b168543fc..b5c8b47239d 100644
--- a/dlls/kernelbase/process.c
+++ b/dlls/kernelbase/process.c
@@ -242,7 +242,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
@@ -244,7 +244,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
/***********************************************************************
* create_nt_process
*/
@@ -28,7 +28,7 @@ index a07dddb1f..99985ab89 100644
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info, HANDLE parent )
{
@@ -257,7 +257,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
@@ -259,7 +259,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
status = RtlCreateUserProcess( &nameW, OBJ_CASE_INSENSITIVE, params,
psa ? psa->lpSecurityDescriptor : NULL,
tsa ? tsa->lpSecurityDescriptor : NULL,
@@ -37,7 +37,7 @@ index a07dddb1f..99985ab89 100644
RtlFreeUnicodeString( &nameW );
}
return status;
@@ -267,7 +267,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
@@ -269,7 +269,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
/***********************************************************************
* create_vdm_process
*/
@@ -46,7 +46,7 @@ index a07dddb1f..99985ab89 100644
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info )
{
@@ -288,7 +288,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
@@ -290,7 +290,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, winevdm );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
@@ -55,7 +55,7 @@ index a07dddb1f..99985ab89 100644
HeapFree( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -297,7 +297,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
@@ -299,7 +299,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
/***********************************************************************
* create_cmd_process
*/
@@ -64,7 +64,7 @@ index a07dddb1f..99985ab89 100644
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info )
{
@@ -316,7 +316,7 @@ static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
@@ -318,7 +318,7 @@ static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, comspec );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
@@ -73,7 +73,7 @@ index a07dddb1f..99985ab89 100644
RtlFreeHeap( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -448,7 +448,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
@@ -450,7 +450,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
TRACE( "app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
@@ -84,7 +84,7 @@ index a07dddb1f..99985ab89 100644
if (new_token) FIXME( "No support for returning created process token\n" );
if (app_name)
@@ -521,7 +523,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
@@ -523,7 +525,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
}
}
@@ -93,7 +93,7 @@ index a07dddb1f..99985ab89 100644
switch (status)
{
case STATUS_SUCCESS:
@@ -530,7 +532,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
@@ -532,7 +534,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
case STATUS_INVALID_IMAGE_NE_FORMAT:
case STATUS_INVALID_IMAGE_PROTECT:
TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(app_name) );
@@ -102,7 +102,7 @@ index a07dddb1f..99985ab89 100644
break;
case STATUS_INVALID_IMAGE_NOT_MZ:
/* check for .com or .bat extension */
@@ -538,12 +540,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
@@ -540,12 +542,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if (!wcsicmp( p, L".com" ) || !wcsicmp( p, L".pif" ))
{
TRACE( "starting %s as DOS binary\n", debugstr_w(app_name) );
@@ -117,21 +117,12 @@ index a07dddb1f..99985ab89 100644
}
break;
}
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index f3d9079f8..2fa553091 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -1667,7 +1667,7 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
RTL_USER_PROCESS_PARAMETERS *params,
SECURITY_DESCRIPTOR *process_descr,
SECURITY_DESCRIPTOR *thread_descr,
- HANDLE parent, BOOLEAN inherit, HANDLE debug, HANDLE exception,
+ HANDLE parent, BOOLEAN inherit, HANDLE debug, HANDLE token,
RTL_USER_PROCESS_INFORMATION *info )
{
NTSTATUS status;
@@ -1735,6 +1735,7 @@ NTSTATUS WINAPI RtlCreateUserProcess( UNICODE_STRING *path, ULONG attributes,
req->access = PROCESS_ALL_ACCESS;
diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
index cca6c2747bf..379a0036b63 100644
--- a/dlls/ntdll/unix/process.c
+++ b/dlls/ntdll/unix/process.c
@@ -827,6 +827,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
req->access = process_access;
req->cpu = pe_info.cpu;
req->info_size = startup_info_size;
+ req->token = wine_server_obj_handle( token );
@@ -139,10 +130,10 @@ index f3d9079f8..2fa553091 100644
wine_server_add_data( req, startup_info, startup_info_size );
wine_server_add_data( req, params->Environment, env_size );
diff --git a/server/process.c b/server/process.c
index d6f71a774..aa66814d8 100644
index 52604ec4d61..047916ffd09 100644
--- a/server/process.c
+++ b/server/process.c
@@ -491,7 +491,7 @@ static void start_sigkill_timer( struct process *process )
@@ -499,7 +499,7 @@ static void start_sigkill_timer( struct process *process )
/* create a new process */
/* if the function fails the fd is closed */
struct process *create_process( int fd, struct process *parent, int inherit_all,
@@ -151,7 +142,7 @@ index d6f71a774..aa66814d8 100644
{
struct process *process;
@@ -568,7 +568,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
@@ -576,7 +576,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 */
@@ -160,7 +151,7 @@ index d6f71a774..aa66814d8 100644
process->affinity = parent->affinity;
}
if (!process->handles || !process->token) goto error;
@@ -1124,6 +1124,7 @@ DECL_HANDLER(new_process)
@@ -1132,6 +1132,7 @@ DECL_HANDLER(new_process)
const struct security_descriptor *sd;
const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
struct process *process = NULL;
@@ -168,7 +159,7 @@ index d6f71a774..aa66814d8 100644
struct process *parent;
struct thread *parent_thread = current;
int socket_fd = thread_get_inflight_fd( current, req->socket_fd );
@@ -1177,10 +1178,39 @@ DECL_HANDLER(new_process)
@@ -1185,10 +1186,39 @@ DECL_HANDLER(new_process)
return;
}
@@ -208,7 +199,7 @@ index d6f71a774..aa66814d8 100644
release_object( parent );
return;
}
@@ -1228,7 +1258,7 @@ DECL_HANDLER(new_process)
@@ -1236,7 +1266,7 @@ DECL_HANDLER(new_process)
#undef FIXUP_LEN
}
@@ -217,7 +208,7 @@ index d6f71a774..aa66814d8 100644
process->startup_info = (struct startup_info *)grab_object( info );
@@ -1289,6 +1319,7 @@ DECL_HANDLER(new_process)
@@ -1297,6 +1327,7 @@ DECL_HANDLER(new_process)
reply->handle = alloc_handle_no_access_check( current->process, process, req->access, objattr->attributes );
done:
@@ -225,7 +216,7 @@ index d6f71a774..aa66814d8 100644
if (process) release_object( process );
release_object( parent );
release_object( info );
@@ -1322,7 +1353,7 @@ DECL_HANDLER(exec_process)
@@ -1330,7 +1361,7 @@ DECL_HANDLER(exec_process)
close( socket_fd );
return;
}
@@ -235,7 +226,7 @@ index d6f71a774..aa66814d8 100644
release_object( process );
}
diff --git a/server/process.h b/server/process.h
index dfe5c4e52..61b83abf6 100644
index dfe5c4e52d8..61b83abf693 100644
--- a/server/process.h
+++ b/server/process.h
@@ -118,7 +118,7 @@ extern unsigned int alloc_ptid( void *ptr );
@@ -248,10 +239,10 @@ index dfe5c4e52..61b83abf6 100644
extern struct thread *get_process_first_thread( struct process *process );
extern struct process *get_process_from_id( process_id_t id );
diff --git a/server/protocol.def b/server/protocol.def
index 45ab670ea..c763da4ca 100644
index 901c380b721..8c86967609f 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -791,6 +791,7 @@ struct rawinput_device
@@ -801,6 +801,7 @@ struct rawinput_device
unsigned int access; /* access rights for process object */
client_cpu_t cpu; /* CPU that the new process will use */
data_size_t info_size; /* size of startup info */
@@ -260,7 +251,7 @@ index 45ab670ea..c763da4ca 100644
VARARG(info,startup_info,info_size); /* startup information */
VARARG(env,unicode_str); /* environment for new process */
diff --git a/server/request.c b/server/request.c
index 200c2697d..f743b720a 100644
index 4c1f30a5fe7..321bb6cfa81 100644
--- a/server/request.c
+++ b/server/request.c
@@ -582,7 +582,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
@@ -273,7 +264,7 @@ index 200c2697d..f743b720a 100644
create_thread( -1, process, NULL );
release_object( process );
diff --git a/server/security.h b/server/security.h
index 21e90ccf2..32dfe5f8d 100644
index 21e90ccf23f..32dfe5f8db9 100644
--- a/server/security.h
+++ b/server/security.h
@@ -67,6 +67,8 @@ extern const ACL *token_get_default_dacl( struct token *token );
@@ -286,10 +277,10 @@ index 21e90ccf2..32dfe5f8d 100644
static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace )
{
diff --git a/server/token.c b/server/token.c
index 181219d21..858ec25d7 100644
index 1c1d49989b3..2f466aa1b25 100644
--- a/server/token.c
+++ b/server/token.c
@@ -845,6 +845,12 @@ int token_assign_label( struct token *token, PSID label )
@@ -843,6 +843,12 @@ int token_assign_label( struct token *token, PSID label )
return ret;
}
@@ -302,7 +293,7 @@ index 181219d21..858ec25d7 100644
struct token *token_create_admin( void )
{
struct token *token = NULL;
@@ -1271,6 +1277,11 @@ const SID *token_get_primary_group( struct token *token )
@@ -1269,6 +1275,11 @@ const SID *token_get_primary_group( struct token *token )
return token->primary_group;
}
@@ -315,5 +306,5 @@ index 181219d21..858ec25d7 100644
{
GENERIC_MAPPING mapping;
--
2.24.0
2.27.0

View File

@@ -1,198 +0,0 @@
From 3c3fd497486e624cbc8ab3a98e2fd02cdf6dc2ba Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2019 09:26:16 +1000
Subject: [PATCH 2/6] directmanipulation: New dll
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
configure | 2 +
configure.ac | 1 +
dlls/directmanipulation/Makefile.in | 8 +++
dlls/directmanipulation/directmanip.idl | 38 +++++++++++
dlls/directmanipulation/directmanipulation.c | 67 +++++++++++++++++++
.../directmanipulation.spec | 6 ++
6 files changed, 122 insertions(+)
create mode 100644 dlls/directmanipulation/Makefile.in
create mode 100644 dlls/directmanipulation/directmanip.idl
create mode 100644 dlls/directmanipulation/directmanipulation.c
create mode 100644 dlls/directmanipulation/directmanipulation.spec
diff --git a/configure b/configure
index f1de2c4052..bc376a6686 100755
--- a/configure
+++ b/configure
@@ -1231,6 +1231,7 @@ enable_dhtmled_ocx
enable_difxapi
enable_dinput
enable_dinput8
+enable_directmanipulation
enable_dispex
enable_dmband
enable_dmcompos
@@ -20162,6 +20163,7 @@ wine_fn_config_makefile dlls/dinput enable_dinput
wine_fn_config_makefile dlls/dinput/tests enable_tests
wine_fn_config_makefile dlls/dinput8 enable_dinput8
wine_fn_config_makefile dlls/dinput8/tests enable_tests
+wine_fn_config_makefile dlls/directmanipulation enable_directmanipulation
wine_fn_config_makefile dlls/dispdib.dll16 enable_win16
wine_fn_config_makefile dlls/dispex enable_dispex
wine_fn_config_makefile dlls/dispex/tests enable_tests
diff --git a/configure.ac b/configure.ac
index a7c45ace73..51519fdd9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3148,6 +3148,7 @@ WINE_CONFIG_MAKEFILE(dlls/dinput)
WINE_CONFIG_MAKEFILE(dlls/dinput/tests)
WINE_CONFIG_MAKEFILE(dlls/dinput8)
WINE_CONFIG_MAKEFILE(dlls/dinput8/tests)
+WINE_CONFIG_MAKEFILE(dlls/directmanipulation)
WINE_CONFIG_MAKEFILE(dlls/dispdib.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/dispex)
WINE_CONFIG_MAKEFILE(dlls/dispex/tests)
diff --git a/dlls/directmanipulation/Makefile.in b/dlls/directmanipulation/Makefile.in
new file mode 100644
index 0000000000..331c2a8420
--- /dev/null
+++ b/dlls/directmanipulation/Makefile.in
@@ -0,0 +1,8 @@
+MODULE = directmanipulation.dll
+
+EXTRADLLFLAGS = -mno-cygwin
+
+IDL_SRCS = directmanip.idl
+
+C_SRCS = \
+ directmanipulation.c
diff --git a/dlls/directmanipulation/directmanip.idl b/dlls/directmanipulation/directmanip.idl
new file mode 100644
index 0000000000..ff00668ba5
--- /dev/null
+++ b/dlls/directmanipulation/directmanip.idl
@@ -0,0 +1,38 @@
+/*
+ * 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
+ */
+#pragma makedep register
+
+[
+ uuid(54e211b6-3650-4f75-8334-fa359598e1c5),
+ threading(both)
+]
+coclass DirectManipulationManager
+{
+ interface IDirectManipulationManager2;
+ [default] interface IDirectManipulationManager;
+}
+
+[
+ uuid(99793286-77cc-4b57-96db-3b354f6f9fb5),
+ threading(both)
+]
+coclass DirectManipulationSharedManager
+{
+ interface IDirectManipulationManager2;
+ [default] interface IDirectManipulationManager;
+}
diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c
new file mode 100644
index 0000000000..136b2976a4
--- /dev/null
+++ b/dlls/directmanipulation/directmanipulation.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 Alistair Leslie-Hughes
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "oleidl.h"
+#include "rpcproxy.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(manipulation);
+
+static HINSTANCE dm_instance;
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+ TRACE("(%p, %u, %p)\n", instance, reason, reserved);
+
+ switch (reason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+ case DLL_PROCESS_ATTACH:
+ dm_instance = instance;
+ DisableThreadLibraryCalls(instance);
+ break;
+ }
+
+ return TRUE;
+}
+
+HRESULT WINAPI DllRegisterServer(void)
+{
+ return __wine_register_resources( dm_instance );
+}
+
+HRESULT WINAPI DllUnregisterServer(void)
+{
+ return __wine_unregister_resources( dm_instance );
+}
+
+HRESULT WINAPI DllCanUnloadNow(void)
+{
+ return S_FALSE;
+}
+
+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+ FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
\ No newline at end of file
diff --git a/dlls/directmanipulation/directmanipulation.spec b/dlls/directmanipulation/directmanipulation.spec
new file mode 100644
index 0000000000..3f0004daeb
--- /dev/null
+++ b/dlls/directmanipulation/directmanipulation.spec
@@ -0,0 +1,6 @@
+@ stub InitializeDManipHook
+@ stdcall -private DllCanUnloadNow()
+@ stub DllGetActivationFactory
+@ stdcall -private DllGetClassObject(ptr ptr ptr)
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
--
2.17.1

View File

@@ -1,25 +0,0 @@
From 528186d14bef47f9afdbee2e323445f14191c858 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 18 Jul 2019 09:46:30 +1000
Subject: [PATCH 3/6] uuid: Add directmanipulation.h
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/uuid/uuid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/uuid/uuid.c b/dlls/uuid/uuid.c
index aa3b30c3c7..eacb83301d 100644
--- a/dlls/uuid/uuid.c
+++ b/dlls/uuid/uuid.c
@@ -90,6 +90,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#include "netcfgx.h"
#include "shimgdata.h"
#include "comsvcs.h"
+#include "directmanipulation.h"
/* FIXME: cguids declares GUIDs but does not define their values */
--
2.17.1

View File

@@ -1,259 +0,0 @@
From d7ab064f1040d0031a0f277f16d2ef7bfe5b1944 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 17 Jul 2019 16:33:21 +1000
Subject: [PATCH 4/6] directmanipulation: Create
DirectManipulationManager/DirectManipulationSharedManager objects
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44865
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/directmanipulation/Makefile.in | 1 +
dlls/directmanipulation/directmanipulation.c | 205 ++++++++++++++++++-
2 files changed, 204 insertions(+), 2 deletions(-)
diff --git a/dlls/directmanipulation/Makefile.in b/dlls/directmanipulation/Makefile.in
index 331c2a8420..d67a21eb77 100644
--- a/dlls/directmanipulation/Makefile.in
+++ b/dlls/directmanipulation/Makefile.in
@@ -1,4 +1,5 @@
MODULE = directmanipulation.dll
+IMPORTS = uuid
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c
index 136b2976a4..81efa3688b 100644
--- a/dlls/directmanipulation/directmanipulation.c
+++ b/dlls/directmanipulation/directmanipulation.c
@@ -15,6 +15,7 @@
* 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 <stdarg.h>
@@ -22,8 +23,11 @@
#include "winbase.h"
#include "oleidl.h"
#include "rpcproxy.h"
+#include "wine/heap.h"
#include "wine/debug.h"
+#include "directmanipulation.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(manipulation);
static HINSTANCE dm_instance;
@@ -60,8 +64,205 @@ HRESULT WINAPI DllCanUnloadNow(void)
return S_FALSE;
}
+
+struct directmanipulation
+{
+ IDirectManipulationManager2 IDirectManipulationManager2_iface;
+ LONG ref;
+};
+
+static inline struct directmanipulation *impl_from_IDirectManipulationManager2(IDirectManipulationManager2 *iface)
+{
+ return CONTAINING_RECORD(iface, struct directmanipulation, IDirectManipulationManager2_iface);
+}
+
+static HRESULT WINAPI direct_manip_QueryInterface(IDirectManipulationManager2 *iface, REFIID riid, void **ppv)
+{
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IDirectManipulationManager) ||
+ IsEqualGUID(riid, &IID_IDirectManipulationManager2)) {
+ IUnknown_AddRef(iface);
+ *ppv = iface;
+ return S_OK;
+ }
+
+ FIXME("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ppv);
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI direct_manip_AddRef(IDirectManipulationManager2 *iface)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI direct_manip_Release(IDirectManipulationManager2 *iface)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ if (!ref)
+ {
+ heap_free(This);
+ }
+ return ref;
+}
+
+static HRESULT WINAPI direct_manip_Activate(IDirectManipulationManager2 *iface, HWND window)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p\n", This, window);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_Deactivate(IDirectManipulationManager2 *iface, HWND window)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p\n", This, window);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_RegisterHitTestTarget(IDirectManipulationManager2 *iface, HWND window,
+ HWND hittest, DIRECTMANIPULATION_HITTEST_TYPE type)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p, %p, %d\n", This, window, hittest, type);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_ProcessInput(IDirectManipulationManager2 *iface, const MSG *msg, BOOL *handled)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p, %p\n", This, msg, handled);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_GetUpdateManager(IDirectManipulationManager2 *iface, REFIID riid, void **obj)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %s, %p\n", This, debugstr_guid(riid), obj);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_CreateViewport(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame,
+ HWND window, REFIID riid, void **obj)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p, %p, %s, %p\n", This, frame, window, debugstr_guid(riid), obj);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_CreateContent(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame,
+ REFCLSID clsid, REFIID riid, void **obj)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %p, %s, %p\n", This, frame, debugstr_guid(riid), obj);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI direct_manip_CreateBehavior(IDirectManipulationManager2 *iface, REFCLSID clsid, REFIID riid, void **obj)
+{
+ struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
+ FIXME("%p, %s, %s, %p\n", This, debugstr_guid(clsid), debugstr_guid(riid), obj);
+ return E_NOTIMPL;
+}
+
+static const struct IDirectManipulationManager2Vtbl directmanipVtbl =
+{
+ direct_manip_QueryInterface,
+ direct_manip_AddRef,
+ direct_manip_Release,
+ direct_manip_Activate,
+ direct_manip_Deactivate,
+ direct_manip_RegisterHitTestTarget,
+ direct_manip_ProcessInput,
+ direct_manip_GetUpdateManager,
+ direct_manip_CreateViewport,
+ direct_manip_CreateContent,
+ direct_manip_CreateBehavior
+};
+
+static HRESULT WINAPI DirectManipulation_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
+{
+ struct directmanipulation *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->IDirectManipulationManager2_iface.lpVtbl = &directmanipVtbl;
+ object->ref = 1;
+
+ ret = direct_manip_QueryInterface(&object->IDirectManipulationManager2_iface, riid, ppv);
+ direct_manip_Release(&object->IDirectManipulationManager2_iface);
+
+ return ret;
+}
+
+static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
+{
+ *ppv = NULL;
+
+ if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
+ *ppv = iface;
+ }
+
+ if(*ppv) {
+ IUnknown_AddRef((IUnknown*)*ppv);
+ return S_OK;
+ }
+
+ WARN("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
+{
+ TRACE("(%p)\n", iface);
+ return 2;
+}
+
+static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
+{
+ TRACE("(%p)\n", iface);
+ return 1;
+}
+
+static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
+{
+ TRACE("(%p)->(%x)\n", iface, fLock);
+ return S_OK;
+}
+
+static const IClassFactoryVtbl DirectFactoryVtbl = {
+ ClassFactory_QueryInterface,
+ ClassFactory_AddRef,
+ ClassFactory_Release,
+ DirectManipulation_CreateInstance,
+ ClassFactory_LockServer
+};
+
+static IClassFactory direct_factory = { &DirectFactoryVtbl };
+
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
- FIXME("(%s,%s,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+ if(IsEqualGUID(&CLSID_DirectManipulationManager, rclsid) ||
+ IsEqualGUID(&CLSID_DirectManipulationSharedManager, rclsid) ) {
+ TRACE("(CLSID_DirectManipulationManager %s %p)\n", debugstr_guid(riid), ppv);
+ return IClassFactory_QueryInterface(&direct_factory, riid, ppv);
+ }
+
+ FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
-}
\ No newline at end of file
+}
--
2.17.1

View File

@@ -1,4 +1,4 @@
From c7190485c2cc3ccc4d6480d0621552aa488154bd Mon Sep 17 00:00:00 2001
From 9a5ebfa598dedd23eeef0ea4d1a292f4e6281a1c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 23 Jul 2019 08:37:12 +1000
Subject: [PATCH] directmanipulation: Supprot
@@ -10,10 +10,10 @@ Subject: [PATCH] directmanipulation: Supprot
1 file changed, 49 insertions(+)
diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c
index 44d74b368d0..f5a8aee5de2 100644
index 3b4c19a7994..e1cfec7a6a5 100644
--- a/dlls/directmanipulation/directmanipulation.c
+++ b/dlls/directmanipulation/directmanipulation.c
@@ -213,6 +213,7 @@ static HRESULT WINAPI DirectManipulation_CreateInstance(IClassFactory *iface, IU
@@ -340,6 +340,7 @@ static HRESULT WINAPI DirectManipulation_CreateInstance(IClassFactory *iface, IU
struct directcompositor
{
IDirectManipulationCompositor IDirectManipulationCompositor_iface;
@@ -21,7 +21,7 @@ index 44d74b368d0..f5a8aee5de2 100644
LONG ref;
};
@@ -221,8 +222,15 @@ static inline struct directcompositor *impl_from_IDirectManipulationCompositor(I
@@ -348,8 +349,15 @@ static inline struct directcompositor *impl_from_IDirectManipulationCompositor(I
return CONTAINING_RECORD(iface, struct directcompositor, IDirectManipulationCompositor_iface);
}
@@ -37,7 +37,7 @@ index 44d74b368d0..f5a8aee5de2 100644
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectManipulationCompositor))
{
@@ -230,6 +238,12 @@ static HRESULT WINAPI compositor_QueryInterface(IDirectManipulationCompositor *i
@@ -357,6 +365,12 @@ static HRESULT WINAPI compositor_QueryInterface(IDirectManipulationCompositor *i
*ppv = iface;
return S_OK;
}
@@ -50,7 +50,7 @@ index 44d74b368d0..f5a8aee5de2 100644
FIXME("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
@@ -299,6 +313,40 @@ static const struct IDirectManipulationCompositorVtbl compositorVtbl =
@@ -426,6 +440,40 @@ static const struct IDirectManipulationCompositorVtbl compositorVtbl =
compositor_Flush
};
@@ -91,7 +91,7 @@ index 44d74b368d0..f5a8aee5de2 100644
static HRESULT WINAPI DirectCompositor_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
{
struct directcompositor *object;
@@ -313,6 +361,7 @@ static HRESULT WINAPI DirectCompositor_CreateInstance(IClassFactory *iface, IUnk
@@ -440,6 +488,7 @@ static HRESULT WINAPI DirectCompositor_CreateInstance(IClassFactory *iface, IUnk
return E_OUTOFMEMORY;
object->IDirectManipulationCompositor_iface.lpVtbl = &compositorVtbl;
@@ -100,5 +100,5 @@ index 44d74b368d0..f5a8aee5de2 100644
ret = compositor_QueryInterface(&object->IDirectManipulationCompositor_iface, riid, ppv);
--
2.17.1
2.27.0

View File

@@ -1,176 +0,0 @@
From 3b024e2861712c7fd833c77a2de71b025102309f Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 22 Jul 2019 10:36:34 +1000
Subject: [PATCH] directmanipulation: Implement IDirectManipulationManager2
GetUpdateManager.
---
dlls/directmanipulation/directmanipulation.c | 131 ++++++++++++++++++-
1 file changed, 129 insertions(+), 2 deletions(-)
diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c
index edfdda980e..c67d3ff956 100644
--- a/dlls/directmanipulation/directmanipulation.c
+++ b/dlls/directmanipulation/directmanipulation.c
@@ -68,6 +68,13 @@ HRESULT WINAPI DllCanUnloadNow(void)
struct directmanipulation
{
IDirectManipulationManager2 IDirectManipulationManager2_iface;
+ IDirectManipulationUpdateManager *updatemanager;
+ LONG ref;
+};
+
+struct directupdatemanager
+{
+ IDirectManipulationUpdateManager IDirectManipulationUpdateManager_iface;
LONG ref;
};
@@ -76,6 +83,100 @@ static inline struct directmanipulation *impl_from_IDirectManipulationManager2(I
return CONTAINING_RECORD(iface, struct directmanipulation, IDirectManipulationManager2_iface);
}
+static inline struct directupdatemanager *impl_from_IDirectManipulationUpdateManager(IDirectManipulationUpdateManager *iface)
+{
+ return CONTAINING_RECORD(iface, struct directupdatemanager, IDirectManipulationUpdateManager_iface);
+}
+
+static HRESULT WINAPI update_manager_QueryInterface(IDirectManipulationUpdateManager *iface, REFIID riid,void **ppv)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+
+ TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
+
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IDirectManipulationUpdateManager)) {
+ IUnknown_AddRef(iface);
+ *ppv = iface;
+ return S_OK;
+ }
+
+ FIXME("(%p)->(%s,%p), not found\n", This, debugstr_guid(riid), ppv);
+ return E_NOINTERFACE;
+}
+
+ULONG WINAPI update_manager_AddRef(IDirectManipulationUpdateManager *iface)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ return ref;
+}
+
+ULONG WINAPI update_manager_Release(IDirectManipulationUpdateManager *iface)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ if (!ref)
+ {
+ heap_free(This);
+ }
+ return ref;
+}
+
+static HRESULT WINAPI update_manager_RegisterWaitHandleCallback(IDirectManipulationUpdateManager *iface, HANDLE handle,
+ IDirectManipulationUpdateHandler *handler, DWORD *cookie)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+ FIXME("%p, %p, %p, %p\n", This, handle, handler, cookie);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI update_manager_UnregisterWaitHandleCallback(IDirectManipulationUpdateManager *iface, DWORD cookie)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+ FIXME("%p, %x\n", This, cookie);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI update_manager_Update(IDirectManipulationUpdateManager *iface, IDirectManipulationFrameInfoProvider *provider)
+{
+ struct directupdatemanager *This = impl_from_IDirectManipulationUpdateManager(iface);
+ FIXME("%p, %p\n", This, provider);
+ return E_NOTIMPL;
+}
+
+struct IDirectManipulationUpdateManagerVtbl updatemanagerVtbl =
+{
+ update_manager_QueryInterface,
+ update_manager_AddRef,
+ update_manager_Release,
+ update_manager_RegisterWaitHandleCallback,
+ update_manager_UnregisterWaitHandleCallback,
+ update_manager_Update
+};
+
+static HRESULT create_update_manager(IDirectManipulationUpdateManager **obj)
+{
+ struct directupdatemanager *object;
+
+ object = heap_alloc(sizeof(*object));
+ if(!object)
+ return E_OUTOFMEMORY;
+
+ object->IDirectManipulationUpdateManager_iface.lpVtbl = &updatemanagerVtbl;
+ object->ref = 1;
+
+ *obj = &object->IDirectManipulationUpdateManager_iface;
+
+ return S_OK;
+}
+
static HRESULT WINAPI direct_manip_QueryInterface(IDirectManipulationManager2 *iface, REFIID riid, void **ppv)
{
if (IsEqualGUID(riid, &IID_IUnknown) ||
@@ -109,6 +210,8 @@ static ULONG WINAPI direct_manip_Release(IDirectManipulationManager2 *iface)
if (!ref)
{
+ if(This->updatemanager)
+ IDirectManipulationUpdateManager_Release(This->updatemanager);
heap_free(This);
}
return ref;
@@ -146,8 +249,32 @@ static HRESULT WINAPI direct_manip_ProcessInput(IDirectManipulationManager2 *ifa
static HRESULT WINAPI direct_manip_GetUpdateManager(IDirectManipulationManager2 *iface, REFIID riid, void **obj)
{
struct directmanipulation *This = impl_from_IDirectManipulationManager2(iface);
- FIXME("%p, %s, %p\n", This, debugstr_guid(riid), obj);
- return E_NOTIMPL;
+ HRESULT hr = E_FAIL;
+
+ TRACE("%p, %s, %p\n", This, debugstr_guid(riid), obj);
+
+ *obj = NULL;
+ if(IsEqualGUID(riid, &IID_IDirectManipulationUpdateManager))
+ {
+ if(!This->updatemanager)
+ {
+ hr = create_update_manager(&This->updatemanager);
+ }
+ else
+ {
+ hr = S_OK;
+ }
+
+ if(hr == S_OK)
+ {
+ IDirectManipulationUpdateManager_AddRef(This->updatemanager);
+ *obj = This->updatemanager;
+ }
+ }
+ else
+ FIXME("Interface %s currently not supported.\n", debugstr_guid(riid));
+
+ return hr;
}
static HRESULT WINAPI direct_manip_CreateViewport(IDirectManipulationManager2 *iface, IDirectManipulationFrameInfoProvider *frame,
--
2.17.1

View File

@@ -1,118 +0,0 @@
From efa0cbb8de357cf24f6eb4d15c638dd3c26819ba Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 29 Jul 2019 09:09:41 +1000
Subject: [PATCH] directmanipulation/tests: Initial tests
---
configure | 1 +
configure.ac | 1 +
dlls/directmanipulation/tests/Makefile.in | 5 ++
dlls/directmanipulation/tests/manipulation.c | 60 ++++++++++++++++++++
4 files changed, 67 insertions(+)
create mode 100644 dlls/directmanipulation/tests/Makefile.in
create mode 100644 dlls/directmanipulation/tests/manipulation.c
diff --git a/configure b/configure
index 2ae3710ebb0..da201f4ffef 100755
--- a/configure
+++ b/configure
@@ -20370,6 +20370,7 @@ wine_fn_config_makefile dlls/dinput/tests enable_tests
wine_fn_config_makefile dlls/dinput8 enable_dinput8
wine_fn_config_makefile dlls/dinput8/tests enable_tests
wine_fn_config_makefile dlls/directmanipulation enable_directmanipulation
+wine_fn_config_makefile dlls/directmanipulation/tests enable_tests
wine_fn_config_makefile dlls/dispdib.dll16 enable_win16
wine_fn_config_makefile dlls/dispex enable_dispex
wine_fn_config_makefile dlls/dispex/tests enable_tests
diff --git a/configure.ac b/configure.ac
index 7c0044c8872..b2a913132c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3186,6 +3186,7 @@ WINE_CONFIG_MAKEFILE(dlls/dinput/tests)
WINE_CONFIG_MAKEFILE(dlls/dinput8)
WINE_CONFIG_MAKEFILE(dlls/dinput8/tests)
WINE_CONFIG_MAKEFILE(dlls/directmanipulation)
+WINE_CONFIG_MAKEFILE(dlls/directmanipulation/tests)
WINE_CONFIG_MAKEFILE(dlls/dispdib.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/dispex)
WINE_CONFIG_MAKEFILE(dlls/dispex/tests)
diff --git a/dlls/directmanipulation/tests/Makefile.in b/dlls/directmanipulation/tests/Makefile.in
new file mode 100644
index 00000000000..29ec0db511a
--- /dev/null
+++ b/dlls/directmanipulation/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL = directmanipulation.dll
+IMPORTS = uuid ole32
+
+C_SRCS = \
+ manipulation.c
diff --git a/dlls/directmanipulation/tests/manipulation.c b/dlls/directmanipulation/tests/manipulation.c
new file mode 100644
index 00000000000..93b692729b3
--- /dev/null
+++ b/dlls/directmanipulation/tests/manipulation.c
@@ -0,0 +1,60 @@
+/*
+ *
+ * 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 <stdarg.h>
+
+#include "windows.h"
+#include "directmanipulation.h"
+
+#include "wine/test.h"
+
+static void test_IDirectManipulationManager2(void)
+{
+ IDirectManipulationManager2 *manager2;
+ IDirectManipulationUpdateManager *update;
+ HRESULT hres;
+
+ hres = CoCreateInstance(&CLSID_DirectManipulationManager, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
+ &IID_IDirectManipulationManager2, (void**)&manager2);
+ if(FAILED(hres))
+ {
+ win_skip("Failed to create XMLView instance\n");
+ return;
+ }
+ ok(hres == S_OK, "CoCreateInstance returned %x, expected S_OK\n", hres);
+
+ hres = IDirectManipulationManager2_GetUpdateManager(manager2, &IID_IDirectManipulationUpdateManager, (void**)&update);
+ ok(hres == S_OK, "returned %x, expected S_OK\n", hres);
+
+ if(update)
+ IDirectManipulationUpdateManager_Release(update);
+
+ IDirectManipulationManager2_Release(manager2);
+}
+
+START_TEST(manipulation)
+{
+ CoInitialize(NULL);
+
+ test_IDirectManipulationManager2();
+
+ CoUninitialize();
+}
--
2.24.1

View File

@@ -1,4 +1,4 @@
From b03e8c0e0097e3dfd2c30f1f53f13abaa731b858 Mon Sep 17 00:00:00 2001
From 2fc74d8b5fd617e4b614e80c2eba9971a2dea00e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 3 Mar 2015 03:39:12 +0100
Subject: [PATCH] ntdll: Reuse old async fileio structures if possible.
@@ -7,14 +7,14 @@ This should speed up apps which heavily rely on async io stuff. Some
tests (using the kernel and ntdll wine tests) show that it is very
often possible to reuse old fileio structures.
---
dlls/ntdll/file.c | 24 ++++++++++++++++++------
dlls/ntdll/unix/file.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 45660b47ec2e..083a413aac5f 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -387,6 +387,7 @@ struct async_fileio
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ca6899b50f5..4c3f3dac465 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -4433,6 +4433,7 @@ struct async_fileio
{
async_callback_t *callback; /* must be the first field */
struct async_fileio *next;
@@ -22,10 +22,10 @@ index 45660b47ec2e..083a413aac5f 100644
HANDLE handle;
};
@@ -430,18 +431,29 @@ static struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback,
@@ -4484,18 +4485,29 @@ static void release_fileio( struct async_fileio *io )
static struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback, HANDLE handle )
{
/* first free remaining previous fileinfos */
- struct async_fileio *io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL );
+ struct async_fileio *old_io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL );
+ struct async_fileio *io = NULL;
@@ -59,5 +59,5 @@ index 45660b47ec2e..083a413aac5f 100644
}
return io;
--
2.26.2
2.27.0

View File

@@ -1,2 +1 @@
Fixes: [44658] Add dummy apiset to PEB struct
Depends: ntdll-ThreadTime

View File

@@ -1,23 +1,23 @@
From 74693bc85e3dbc1f757cfea348dc385b4badeb89 Mon Sep 17 00:00:00 2001
From 0bfc43bff3a9b53e65c82d987bb072f0ff0a3a2b Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 19 Aug 2014 22:10:49 -0600
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
NtQueryInformationFile.
[fd_]get_file_info().
---
configure.ac | 12 ++++++++++++
dlls/ntdll/file.c | 16 ++++++++++++++++
include/wine/port.h | 8 ++++++++
libs/port/Makefile.in | 3 ++-
libs/port/xattr.c | 39 +++++++++++++++++++++++++++++++++++++++
5 files changed, 77 insertions(+), 1 deletion(-)
configure.ac | 12 +++++++++++
dlls/ntdll/unix/file.c | 22 ++++++++++++++++++-
include/wine/port.h | 9 ++++++++
libs/port/Makefile.in | 3 ++-
libs/port/xattr.c | 49 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 93 insertions(+), 2 deletions(-)
create mode 100644 libs/port/xattr.c
diff --git a/configure.ac b/configure.ac
index 180d958fc4ef..1e3d2e0d4ef0 100644
index d3bd12a6340..5e775c04449 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,7 @@ AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb lib
@@ -88,6 +88,7 @@ AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb lib
AC_ARG_WITH(v4l2, AS_HELP_STRING([--without-v4l2],[do not use v4l2 (video capture)]))
AC_ARG_WITH(vkd3d, AS_HELP_STRING([--without-vkd3d],[do not use vkd3d (Direct3D 12 support)]))
AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan]))
@@ -25,7 +25,7 @@ index 180d958fc4ef..1e3d2e0d4ef0 100644
AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi])
AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]),
@@ -709,6 +710,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
@@ -697,6 +698,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
#include <sys/socket.h>
#endif])
@@ -43,13 +43,13 @@ index 180d958fc4ef..1e3d2e0d4ef0 100644
dnl **** Check for working dll ****
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 9a9acfdb623b..5536e61db2e4 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -126,6 +126,22 @@ mode_t FILE_umask = 0;
NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, USHORT *unix_dest_len,
DWORD *tag, ULONG *flags, BOOL *is_dir);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 66ce2eb5fe4..d2e783f3300 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1431,6 +1431,22 @@ static BOOL append_entry( struct dir_data *data, const char *long_name,
}
+/* Match the Samba conventions for storing DOS file attributes */
+#define SAMBA_XATTR_DOS_ATTRIB XATTR_USER_PREFIX "DOSATTRIB"
@@ -70,11 +70,31 @@ index 9a9acfdb623b..5536e61db2e4 100644
/* fetch the attributes of a file */
static inline ULONG get_file_attributes( const struct stat *st )
{
@@ -1450,7 +1466,8 @@ static inline ULONG get_file_attributes( const struct stat *st )
static int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
char *parent_path;
- int ret;
+ char hexattr[11];
+ int len, ret;
*attr = 0;
ret = lstat( path, st );
@@ -1476,6 +1493,9 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
}
*attr |= get_file_attributes( st );
+ len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
+ if (len == -1) return ret;
+ *attr |= get_file_xattr( hexattr, len );
return ret;
}
diff --git a/include/wine/port.h b/include/wine/port.h
index e8434c73cca2..f0507efcc7e7 100644
index e8434c73cca..6e81cb71a76 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -361,6 +361,14 @@ int usleep (unsigned int useconds);
@@ -361,6 +361,15 @@ int usleep (unsigned int useconds);
extern int mkstemps(char *template, int suffix_len);
@@ -85,12 +105,13 @@ index e8434c73cca2..f0507efcc7e7 100644
+#endif
+
+extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
+extern int xattr_get( const char *path, const char *name, void *value, size_t size );
+
#else /* NO_LIBWINE_PORT */
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index 1963afe24232..4b1ecab7516b 100644
index 1963afe2423..4b1ecab7516 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -22,4 +22,5 @@ C_SRCS = \
@@ -102,10 +123,10 @@ index 1963afe24232..4b1ecab7516b 100644
+ xattr.c
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
new file mode 100644
index 000000000000..94b77132bbf2
index 00000000000..88e900dac6d
--- /dev/null
+++ b/libs/port/xattr.c
@@ -0,0 +1,39 @@
@@ -0,0 +1,49 @@
+/*
+ * extended attributes functions
+ *
@@ -145,6 +166,16 @@ index 000000000000..94b77132bbf2
+ return -1;
+#endif
+}
+
+int xattr_get( const char *path, const char *name, void *value, size_t size )
+{
+#if defined(HAVE_ATTR_XATTR_H)
+ return getxattr( path, name, value, size );
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
--
2.26.2
2.27.0

View File

@@ -1,69 +0,0 @@
From 34ed49d7dbff7c5f0da8553330c3378b574429fc Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 16:04:34 -0600
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
NtQuery[Full]AttributesFile and NtQueryDirectoryFile.
---
dlls/ntdll/file.c | 6 +++++-
include/wine/port.h | 1 +
libs/port/xattr.c | 10 ++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 5536e61db2e4..2fd62ebfb802 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -182,7 +182,8 @@ int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr
int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
char *parent_path;
- int ret;
+ char hexattr[11];
+ int len, ret;
*attr = 0;
ret = lstat( path, st );
@@ -215,6 +216,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
}
*attr |= get_file_attributes( st );
+ len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
+ if (len == -1) return ret;
+ *attr |= get_file_xattr( hexattr, len );
return ret;
}
diff --git a/include/wine/port.h b/include/wine/port.h
index f0507efcc7e7..6e81cb71a76d 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -368,6 +368,7 @@ extern int mkstemps(char *template, int suffix_len);
#endif
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
+extern int xattr_get( const char *path, const char *name, void *value, size_t size );
#else /* NO_LIBWINE_PORT */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 94b77132bbf2..88e900dac6d4 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -37,3 +37,13 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
return -1;
#endif
}
+
+int xattr_get( const char *path, const char *name, void *value, size_t size )
+{
+#if defined(HAVE_ATTR_XATTR_H)
+ return getxattr( path, name, value, size );
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
--
2.26.2

View File

@@ -1,31 +1,71 @@
From 1a04bc9a0ef3cf03b89d50becee9240f8a195873 Mon Sep 17 00:00:00 2001
From b099458217b2855bd8615b8c97bcc2462eb74b25 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 00:08:52 -0600
Subject: [PATCH] ntdll: Implement storing DOS attributes in
NtSetInformationFile.
---
dlls/ntdll/file.c | 54 ++++++++++++++++++++++++++---------------
dlls/ntdll/tests/file.c | 8 +++---
dlls/ntdll/unix/file.c | 54 ++++++++++++++++++++++++++---------------
include/wine/port.h | 2 ++
libs/port/xattr.c | 20 +++++++++++++++
4 files changed, 60 insertions(+), 24 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 2fd62ebfb802..c077add9769e 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -178,6 +178,39 @@ int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr
return ret;
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 184b7cdad59..37e5ac5d8a5 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -1364,7 +1364,7 @@ static void test_file_basic_information(void)
memset(&fbi, 0, sizeof(fbi));
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM\n", fbi.FileAttributes );
+ ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM (ok in old linux without xattr)\n", fbi.FileAttributes );
/* Then HIDDEN */
memset(&fbi, 0, sizeof(fbi));
@@ -1377,7 +1377,7 @@ static void test_file_basic_information(void)
memset(&fbi, 0, sizeof(fbi));
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN\n", fbi.FileAttributes );
+ ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN (ok in old linux without xattr)\n", fbi.FileAttributes );
/* Check NORMAL last of all (to make sure we can clear attributes) */
memset(&fbi, 0, sizeof(fbi));
@@ -1434,7 +1434,7 @@ static void test_file_all_information(void)
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes, res %x\n", res);
- todo_wine ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM\n", fai_buf.fai.BasicInformation.FileAttributes );
+ ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM (ok in old linux without xattr)\n", fai_buf.fai.BasicInformation.FileAttributes );
/* Then HIDDEN */
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
@@ -1447,7 +1447,7 @@ static void test_file_all_information(void)
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN\n", fai_buf.fai.BasicInformation.FileAttributes );
+ ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN (ok in old linux without xattr)\n", fai_buf.fai.BasicInformation.FileAttributes );
/* Check NORMAL last of all (to make sure we can clear attributes) */
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 70a76ca81ee..924d06b2caa 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1497,6 +1497,39 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON
}
+/* set the stat info and file attributes for a file (by file descriptor) */
+NTSTATUS fd_set_file_info( int fd, ULONG attr )
+{
+ char hexattr[11];
+ struct stat st;
+
+ if (fstat( fd, &st ) == -1) return FILE_GetNtStatus();
+ if (fstat( fd, &st ) == -1) return errno_to_status( errno );
+ if (attr & FILE_ATTRIBUTE_READONLY)
+ {
+ if (S_ISDIR( st.st_mode))
@@ -36,9 +76,9 @@ index 2fd62ebfb802..c077add9769e 100644
+ else
+ {
+ /* add write permission only where we already have read permission */
+ st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~FILE_umask);
+ st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask);
+ }
+ if (fchmod( fd, st.st_mode ) == -1) return FILE_GetNtStatus();
+ if (fchmod( fd, st.st_mode ) == -1) return errno_to_status( errno );
+ attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
+ if (attr != 0)
+ {
@@ -53,9 +93,9 @@ index 2fd62ebfb802..c077add9769e 100644
+}
+
/* get the stat info and file attributes for a file (by name) */
int get_file_info( const char *path, struct stat *st, ULONG *attr )
static int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
@@ -3240,7 +3273,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
@@ -4000,7 +4033,6 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
case FileBasicInformation:
if (len >= sizeof(FILE_BASIC_INFORMATION))
{
@@ -63,12 +103,12 @@ index 2fd62ebfb802..c077add9769e 100644
const FILE_BASIC_INFORMATION *info = ptr;
LARGE_INTEGER mtime, atime;
@@ -3254,25 +3286,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
@@ -4014,25 +4046,7 @@ NTSTATUS WINAPI NtSetInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
io->u.Status = set_file_times( fd, &mtime, &atime );
if (io->u.Status == STATUS_SUCCESS && info->FileAttributes)
- {
- if (fstat( fd, &st ) == -1) io->u.Status = FILE_GetNtStatus();
- if (fstat( fd, &st ) == -1) io->u.Status = errno_to_status( errno );
- else
- {
- if (info->FileAttributes & FILE_ATTRIBUTE_READONLY)
@@ -81,60 +121,20 @@ index 2fd62ebfb802..c077add9769e 100644
- else
- {
- /* add write permission only where we already have read permission */
- st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~FILE_umask);
- st.st_mode |= (0600 | ((st.st_mode & 044) >> 1)) & (~start_umask);
- }
- if (fchmod( fd, st.st_mode ) == -1) io->u.Status = FILE_GetNtStatus();
- if (fchmod( fd, st.st_mode ) == -1) io->u.Status = errno_to_status( errno );
- }
- }
+ io->u.Status = fd_set_file_info( fd, info->FileAttributes );
if (needs_close) close( fd );
}
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 0b05c39685cd..b49a9a4dbbda 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -1365,7 +1365,7 @@ static void test_file_basic_information(void)
memset(&fbi, 0, sizeof(fbi));
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM\n", fbi.FileAttributes );
+ ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM (ok in old linux without xattr)\n", fbi.FileAttributes );
/* Then HIDDEN */
memset(&fbi, 0, sizeof(fbi));
@@ -1378,7 +1378,7 @@ static void test_file_basic_information(void)
memset(&fbi, 0, sizeof(fbi));
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN\n", fbi.FileAttributes );
+ ok ( (fbi.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN (ok in old linux without xattr)\n", fbi.FileAttributes );
/* Check NORMAL last of all (to make sure we can clear attributes) */
memset(&fbi, 0, sizeof(fbi));
@@ -1435,7 +1435,7 @@ static void test_file_all_information(void)
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes, res %x\n", res);
- todo_wine ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM\n", fai_buf.fai.BasicInformation.FileAttributes );
+ ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_SYSTEM, "attribute %x not FILE_ATTRIBUTE_SYSTEM (ok in old linux without xattr)\n", fai_buf.fai.BasicInformation.FileAttributes );
/* Then HIDDEN */
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
@@ -1448,7 +1448,7 @@ static void test_file_all_information(void)
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
- todo_wine ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN\n", fai_buf.fai.BasicInformation.FileAttributes );
+ ok ( (fai_buf.fai.BasicInformation.FileAttributes & attrib_mask) == FILE_ATTRIBUTE_HIDDEN, "attribute %x not FILE_ATTRIBUTE_HIDDEN (ok in old linux without xattr)\n", fai_buf.fai.BasicInformation.FileAttributes );
/* Check NORMAL last of all (to make sure we can clear attributes) */
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
diff --git a/include/wine/port.h b/include/wine/port.h
index 6e81cb71a76d..f90396727d6d 100644
index 4670891ae77..e0249b4c59f 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -368,6 +368,8 @@ extern int mkstemps(char *template, int suffix_len);
@@ -359,6 +359,8 @@ extern int mkstemps(char *template, int suffix_len);
#endif
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
@@ -144,7 +144,7 @@ index 6e81cb71a76d..f90396727d6d 100644
#else /* NO_LIBWINE_PORT */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 88e900dac6d4..6918c9956cc6 100644
index 88e900dac6d..6918c9956cc 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -38,6 +38,26 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
@@ -175,5 +175,5 @@ index 88e900dac6d4..6918c9956cc6 100644
{
#if defined(HAVE_ATTR_XATTR_H)
--
2.26.2
2.27.0

View File

@@ -1,136 +1,17 @@
From 8fde8af21e169d9a48bab50bac4d6e24238141b6 Mon Sep 17 00:00:00 2001
From 769a1043bb174557b600c9ce38765846a3126e7f Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 15:28:00 -0600
Subject: [PATCH] ntdll: Implement storing DOS attributes in NtCreateFile.
---
dlls/ntdll/file.c | 76 +++++++++++++++++++++++-------------
dlls/ntdll/tests/directory.c | 24 ++++++------
dlls/ntdll/unix/file.c | 74 +++++++++++++++++++++++-------------
include/wine/port.h | 2 +
libs/port/xattr.c | 20 ++++++++++
4 files changed, 82 insertions(+), 40 deletions(-)
4 files changed, 81 insertions(+), 39 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index c077add9769e..a596afed72e7 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -255,6 +255,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
return ret;
}
+NTSTATUS set_file_info( const char *path, ULONG attr )
+{
+ char hexattr[11];
+ int len;
+
+ /* Note: unix mode already set when called this way */
+ attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
+ len = sprintf( hexattr, "0x%x", attr );
+ if (attr != 0)
+ xattr_set( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, len );
+ else
+ xattr_remove( path, SAMBA_XATTR_DOS_ATTRIB );
+ return STATUS_SUCCESS;
+}
+
/**************************************************************************
* FILE_CreateFile (internal)
* Open a file.
@@ -266,6 +281,10 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
ULONG attributes, ULONG sharing, ULONG disposition,
ULONG options, PVOID ea_buffer, ULONG ea_length )
{
+ static UNICODE_STRING empty_string;
+ OBJECT_ATTRIBUTES unix_attr;
+ data_size_t len;
+ struct object_attributes *objattr;
ANSI_STRING unix_name;
BOOL created = FALSE;
@@ -309,37 +328,34 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
io->u.Status = STATUS_SUCCESS;
}
- if (io->u.Status == STATUS_SUCCESS)
+ if (io->u.Status != STATUS_SUCCESS)
{
- static UNICODE_STRING empty_string;
- OBJECT_ATTRIBUTES unix_attr = *attr;
- data_size_t len;
- struct object_attributes *objattr;
-
- unix_attr.ObjectName = &empty_string; /* we send the unix name instead */
- if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len )))
- {
- RtlFreeAnsiString( &unix_name );
- return io->u.Status;
- }
+ WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+ return io->u.Status;
+ }
- SERVER_START_REQ( create_file )
- {
- req->access = access;
- req->sharing = sharing;
- req->create = disposition;
- req->options = options;
- req->attrs = attributes;
- wine_server_add_data( req, objattr, len );
- wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
- io->u.Status = wine_server_call( req );
- *handle = wine_server_ptr_handle( reply->handle );
- }
- SERVER_END_REQ;
- RtlFreeHeap( GetProcessHeap(), 0, objattr );
+ unix_attr = *attr;
+ unix_attr.ObjectName = &empty_string; /* we send the unix name instead */
+ if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len )))
+ {
RtlFreeAnsiString( &unix_name );
+ return io->u.Status;
}
- else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+
+ SERVER_START_REQ( create_file )
+ {
+ req->access = access;
+ req->sharing = sharing;
+ req->create = disposition;
+ req->options = options;
+ req->attrs = attributes;
+ wine_server_add_data( req, objattr, len );
+ wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
+ io->u.Status = wine_server_call( req );
+ *handle = wine_server_ptr_handle( reply->handle );
+ }
+ SERVER_END_REQ;
+ RtlFreeHeap( GetProcessHeap(), 0, objattr );
if (io->u.Status == STATUS_SUCCESS)
{
@@ -361,6 +377,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
io->Information = FILE_OVERWRITTEN;
break;
}
+ if (io->Information == FILE_CREATED)
+ {
+ /* set any DOS extended attributes */
+ set_file_info( unix_name.Buffer, attributes );
+ }
}
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
{
@@ -368,6 +389,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
}
+ RtlFreeAnsiString( &unix_name );
return io->u.Status;
}
diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c
index 4618f4eaff2b..44933c2153df 100644
index 248ed99ab20..e0f4debc624 100644
--- a/dlls/ntdll/tests/directory.c
+++ b/dlls/ntdll/tests/directory.c
@@ -55,7 +55,6 @@ static NTSTATUS (WINAPI *pRtlWow64EnableFsRedirectionEx)( ULONG disable, ULONG *
@@ -178,8 +59,125 @@ index 4618f4eaff2b..44933c2153df 100644
testfiles[i].attr_done = TRUE;
}
testfiles[i].nfound++;
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 66ce2eb5fe4..0546039cc47 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3004,6 +3004,20 @@ void CDECL set_show_dot_files( BOOL enable )
show_dot_files = enable;
}
+NTSTATUS set_file_info( const char *path, ULONG attr )
+{
+ char hexattr[11];
+ int len;
+
+ /* Note: unix mode already set when called this way */
+ attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
+ len = sprintf( hexattr, "0x%x", attr );
+ if (attr != 0)
+ xattr_set( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, len );
+ else
+ xattr_remove( path, SAMBA_XATTR_DOS_ATTRIB );
+ return STATUS_SUCCESS;
+}
/******************************************************************************
* NtCreateFile (NTDLL.@)
@@ -3013,6 +3027,10 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
ULONG attributes, ULONG sharing, ULONG disposition,
ULONG options, void *ea_buffer, ULONG ea_length )
{
+ static UNICODE_STRING empty_string;
+ OBJECT_ATTRIBUTES unix_attr;
+ data_size_t len;
+ struct object_attributes *objattr;
ANSI_STRING unix_name;
BOOL created = FALSE;
@@ -3055,36 +3073,34 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
io->u.Status = STATUS_SUCCESS;
}
- if (io->u.Status == STATUS_SUCCESS)
+ if (io->u.Status != STATUS_SUCCESS)
{
- static UNICODE_STRING empty_string;
- OBJECT_ATTRIBUTES unix_attr = *attr;
- data_size_t len;
- struct object_attributes *objattr;
+ WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+ return io->u.Status;
+ }
- unix_attr.ObjectName = &empty_string; /* we send the unix name instead */
- if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len )))
- {
- RtlFreeAnsiString( &unix_name );
- return io->u.Status;
- }
- SERVER_START_REQ( create_file )
- {
- req->access = access;
- req->sharing = sharing;
- req->create = disposition;
- req->options = options;
- req->attrs = attributes;
- wine_server_add_data( req, objattr, len );
- wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
- io->u.Status = wine_server_call( req );
- *handle = wine_server_ptr_handle( reply->handle );
- }
- SERVER_END_REQ;
- RtlFreeHeap( GetProcessHeap(), 0, objattr );
+ unix_attr = *attr;
+ unix_attr.ObjectName = &empty_string; /* we send the unix name instead */
+ if ((io->u.Status = alloc_object_attributes( &unix_attr, &objattr, &len )))
+ {
RtlFreeAnsiString( &unix_name );
+ return io->u.Status;
}
- else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
+
+ SERVER_START_REQ( create_file )
+ {
+ req->access = access;
+ req->sharing = sharing;
+ req->create = disposition;
+ req->options = options;
+ req->attrs = attributes;
+ wine_server_add_data( req, objattr, len );
+ wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
+ io->u.Status = wine_server_call( req );
+ *handle = wine_server_ptr_handle( reply->handle );
+ }
+ SERVER_END_REQ;
+ RtlFreeHeap( GetProcessHeap(), 0, objattr );
if (io->u.Status == STATUS_SUCCESS)
{
@@ -3106,6 +3122,11 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
io->Information = FILE_OVERWRITTEN;
break;
}
+ if (io->Information == FILE_CREATED)
+ {
+ /* set any DOS extended attributes */
+ set_file_info( unix_name.Buffer, attributes );
+ }
}
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
{
@@ -3113,6 +3134,7 @@ NTSTATUS WINAPI NtCreateFile( HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBU
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
}
+ RtlFreeAnsiString( &unix_name );
return io->u.Status;
}
diff --git a/include/wine/port.h b/include/wine/port.h
index f90396727d6d..7d2c73887073 100644
index f90396727d6..7d2c7388707 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -371,6 +371,8 @@ extern int xattr_fget( int filedes, const char *name, void *value, size_t size )
@@ -192,7 +190,7 @@ index f90396727d6d..7d2c73887073 100644
#else /* NO_LIBWINE_PORT */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 6918c9956cc6..683e7a615e2b 100644
index 6918c9956cc..683e7a615e2 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -67,3 +67,23 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
@@ -220,5 +218,5 @@ index 6918c9956cc6..683e7a615e2b 100644
+#endif
+}
--
2.26.2
2.27.0

View File

@@ -1,31 +1,27 @@
From e1e41f084c6cdeba3cb44aaa6753b13bc1411df8 Mon Sep 17 00:00:00 2001
From 01a10dd50491ca0162a5293836cf9b9a3d3c0e34 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 11:26:48 -0600
Subject: [PATCH] ntdll: Perform the Unix-style hidden file check within the
unified file info grabbing routine.
---
dlls/ntdll/directory.c | 15 +++++----------
dlls/ntdll/file.c | 10 ++++------
dlls/ntdll/ntdll_misc.h | 2 +-
3 files changed, 10 insertions(+), 17 deletions(-)
dlls/ntdll/unix/file.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index ba50aa1b807..d6bf1354a5b 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -1274,17 +1274,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 496c92265e9..6f3772d20be 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1217,15 +1217,15 @@ static BOOLEAN get_dir_case_sensitivity( const char *dir )
*
* Check if the specified file should be hidden based on its name and the show dot files option.
*/
-BOOL DIR_is_hidden_file( const UNICODE_STRING *name )
+BOOL DIR_is_hidden_file( const char *name )
-static BOOL is_hidden_file( const UNICODE_STRING *name )
+static BOOL is_hidden_file( const char *name )
{
- WCHAR *p, *end;
+ char *p, *end;
RtlRunOnceExecuteOnce( &init_once, init_options, NULL, NULL );
if (show_dot_files) return FALSE;
- end = p = name->Buffer + name->Length/sizeof(WCHAR);
@@ -37,7 +33,18 @@ index ba50aa1b807..d6bf1354a5b 100644
if (p == end || *p != '.') return FALSE;
/* make sure it isn't '.' or '..' */
if (p + 1 == end) return FALSE;
@@ -1532,11 +1532,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
@@ -1493,6 +1493,10 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
}
*attr |= get_file_attributes( st );
+ /* convert Unix-style hidden files to a DOS hidden file attribute */
+ if (is_hidden_file( path ))
+ *attr |= FILE_ATTRIBUTE_HIDDEN;
+ /* retrieve any stored DOS attributes */
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
if (len == -1) return ret;
*attr |= get_file_xattr( hexattr, len );
@@ -1684,11 +1688,6 @@ static NTSTATUS get_dir_data_entry( struct dir_data *dir_data, void *info_ptr, I
if (class != FileNamesInformation)
{
if (st.st_dev != dir_data->id.dev) st.st_ino = 0; /* ignore inode if on a different device */
@@ -49,55 +56,25 @@ index ba50aa1b807..d6bf1354a5b 100644
fill_file_info( &st, attributes, info, class );
}
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 6a935044f46..a0e54c27198 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -250,6 +250,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
}
*attr |= get_file_attributes( st );
+ /* convert Unix-style hidden files to a DOS hidden file attribute */
+ if (DIR_is_hidden_file( path ))
+ *attr |= FILE_ATTRIBUTE_HIDDEN;
+ /* retrieve any stored DOS attributes */
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
if (len == -1) return ret;
*attr |= get_file_xattr( hexattr, len );
@@ -3489,8 +3493,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
@@ -3301,7 +3300,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
info->AllocationSize = std.AllocationSize;
info->EndOfFile = std.EndOfFile;
info->FileAttributes = basic.FileAttributes;
- if (DIR_is_hidden_file( attr->ObjectName ))
- info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
- if (is_hidden_file( attr->ObjectName )) info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
}
RtlFreeAnsiString( &unix_name );
}
@@ -3518,11 +3520,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
@@ -3328,10 +3326,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
status = STATUS_INVALID_INFO_CLASS;
else
- {
status = fill_file_info( &st, attributes, info, FileBasicInformation );
- if (DIR_is_hidden_file( attr->ObjectName ))
- info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
- if (is_hidden_file( attr->ObjectName )) info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
- }
RtlFreeAnsiString( &unix_name );
}
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index aeed9b857c2..b1cb9aa6843 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -168,7 +168,7 @@ extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
FILE_INFORMATION_CLASS class ) DECLSPEC_HIDDEN;
extern NTSTATUS server_get_unix_name( HANDLE handle, ANSI_STRING *unix_name ) DECLSPEC_HIDDEN;
extern void init_directories(void) DECLSPEC_HIDDEN;
-extern BOOL DIR_is_hidden_file( const UNICODE_STRING *name ) DECLSPEC_HIDDEN;
+extern BOOL DIR_is_hidden_file( const char *name ) DECLSPEC_HIDDEN;
extern NTSTATUS DIR_unmount_device( HANDLE handle ) DECLSPEC_HIDDEN;
extern NTSTATUS DIR_get_unix_cwd( char **cwd ) DECLSPEC_HIDDEN;
extern unsigned int DIR_get_drives_info( struct drive_info info[MAX_DOS_DRIVES] ) DECLSPEC_HIDDEN;
else WARN( "%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
--
2.25.1
2.27.0

View File

@@ -1,23 +1,23 @@
From 08ece1e8da040d80c13348c2ffeb56052779dc53 Mon Sep 17 00:00:00 2001
From 29e0ef12afb2651e61492a8a9f021baca4c66519 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 14 Jan 2016 23:09:19 +0100
Subject: [PATCH] ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be
interpreted as hidden.
---
dlls/ntdll/file.c | 13 ++++++++-----
dlls/ntdll/unix/file.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index a0e54c27198..61b417ef678 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -250,12 +250,15 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 9636c0efe3e..444332e7baa 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1561,12 +1561,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
}
*attr |= get_file_attributes( st );
- /* convert Unix-style hidden files to a DOS hidden file attribute */
- if (DIR_is_hidden_file( path ))
- if (is_hidden_file( path ))
- *attr |= FILE_ATTRIBUTE_HIDDEN;
/* retrieve any stored DOS attributes */
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
@@ -25,22 +25,22 @@ index a0e54c27198..61b417ef678 100644
+ if (len == -1)
+ {
+ /* convert Unix-style hidden files to a DOS hidden file attribute */
+ if (DIR_is_hidden_file( path ))
+ if (is_hidden_file( path ))
+ *attr |= FILE_ATTRIBUTE_HIDDEN;
+ return ret;
+ }
*attr |= get_file_xattr( hexattr, len );
return ret;
}
@@ -268,7 +271,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr )
@@ -3440,7 +3443,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr )
/* Note: unix mode already set when called this way */
attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
len = sprintf( hexattr, "0x%x", attr );
- if (attr != 0)
+ if (attr != 0 || DIR_is_hidden_file( path ))
+ if (attr != 0 || is_hidden_file( path ))
xattr_set( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, len );
else
xattr_remove( path, SAMBA_XATTR_DOS_ATTRIB );
--
2.25.1
2.27.0

View File

@@ -1,4 +1,3 @@
Fixes: [9158] Support for DOS hidden/system file attributes
Fixes: [15679] cygwin symlinks not working in wine
# Depends: ntdll-Syscall_Wrappers
Depends: ntdll-Junction_Points

View File

@@ -1,4 +1,4 @@
From 7ecb980c3b1d3ee2b5ce2ad6419adf5782b85c7a Mon Sep 17 00:00:00 2001
From d39ff3852f684bd9c0ca3c08d7e82e4e50be239d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 21 Aug 2015 06:39:47 +0800
Subject: [PATCH] ntdll: Do not allow to deallocate thread stack for current
@@ -11,10 +11,10 @@ Subject: [PATCH] ntdll: Do not allow to deallocate thread stack for current
3 files changed, 14 insertions(+)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index e9a3230e814..e7a74131c30 100644
index 47800db41b1..be285013afc 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -249,6 +249,7 @@ struct ntdll_thread_data
@@ -154,6 +154,7 @@ struct ntdll_thread_data
int wait_fd[2]; /* fd for sleeping server requests */
BOOL wow64_redir; /* Wow64 filesystem redirection flag */
pthread_t pthread_id; /* pthread thread id */
@@ -23,22 +23,22 @@ index e9a3230e814..e7a74131c30 100644
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 8562efb7dd4..b34adf2f07f 100644
index 9904ef7bfd5..232dea18bee 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -41,6 +41,7 @@ struct ntdll_thread_data
@@ -46,6 +46,7 @@ struct ntdll_thread_data
int wait_fd[2]; /* fd for sleeping server requests */
BOOL wow64_redir; /* Wow64 filesystem redirection flag */
pthread_t pthread_id; /* pthread thread id */
+ void *pthread_stack; /* pthread stack */
struct list entry; /* entry in TEB list */
};
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 0346d0d9753..5e995338a08 100644
index 6166507871c..0bb8cef6d3b 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2715,6 +2715,8 @@ NTSTATUS CDECL virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_si
@@ -2772,6 +2772,8 @@ NTSTATUS CDECL virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_si
stack->DeallocationStack = view->base;
stack->StackBase = (char *)view->base + view->size;
stack->StackLimit = (char *)view->base + 2 * page_size;
@@ -47,7 +47,7 @@ index 0346d0d9753..5e995338a08 100644
done:
server_leave_uninterrupted_section( &csVirtual, &sigset );
return status;
@@ -3374,6 +3376,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
@@ -3521,6 +3523,16 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
/* Free the pages */
if (size || (base != view->base)) status = STATUS_INVALID_PARAMETER;
@@ -65,5 +65,5 @@ index 0346d0d9753..5e995338a08 100644
{
delete_view( view );
--
2.26.2
2.27.0

View File

@@ -1,18 +1,18 @@
From 28b58832717d9c6a8032a555b0fb1035ac9fd710 Mon Sep 17 00:00:00 2001
From 6cf9c37c1e5b2211a61e8d61f97d46f89d86d753 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 29 May 2015 19:57:22 +0200
Subject: ntdll: Return fake device type when systemroot is located on virtual
disk.
Subject: [PATCH] ntdll: Return fake device type when systemroot is located on
virtual disk.
---
dlls/ntdll/file.c | 27 +++++++++++++++++++++++++++
dlls/ntdll/unix/file.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index d081750..45b61fb 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -3126,9 +3126,36 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ca6899b50f5..4f35de4da97 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6136,9 +6136,36 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, IO_STATUS_BLOCK *io
else
{
FILE_FS_DEVICE_INFORMATION *info = buffer;
@@ -29,7 +29,7 @@ index d081750..45b61fb 100644
+ !server_get_unix_name( handle, &unix_name ))
+ {
+ UNICODE_STRING nt_name;
+ if (!wine_unix_to_nt_file_name( &unix_name, &nt_name ))
+ if (!unix_to_nt_file_name( &unix_name, &nt_name ))
+ {
+ WCHAR *buf = nt_name.Buffer;
+ if (nt_name.Length >= 6 * sizeof(WCHAR) &&
@@ -48,7 +48,7 @@ index d081750..45b61fb 100644
+ }
}
break;
case FileFsAttributeInformation:
--
2.4.2
2.27.0

Some files were not shown because too many files have changed in this diff Show More