winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
893 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Fix handling of 64-bit sizes in NtMapViewOfSection.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 3c55f78f52bda377733ec9689e6ca3942033b2e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c55f78f52bda377733ec9689…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 12 15:01:44 2007 +0100 ntdll: Fix handling of 64-bit sizes in NtMapViewOfSection. --- dlls/ntdll/virtual.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 64a8b8e..e4bc27e 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1874,6 +1874,10 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND SERVER_END_REQ; if (res) return res; + size = ((ULONGLONG)size_high << 32) | size_low; + if (sizeof(size) == sizeof(size_low) && size_high) + ERR( "Sizes larger than 4Gb (%x%08x) not supported on this platform\n", size_high, size_low ); + if ((res = server_get_unix_fd( handle, 0, &unix_handle, &needs_close, NULL, NULL ))) goto done; if (prot & VPROT_IMAGE) @@ -1884,32 +1888,28 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND if ((res = server_get_unix_fd( shared_file, FILE_READ_DATA|FILE_WRITE_DATA, &shared_fd, &shared_needs_close, NULL, NULL ))) goto done; - res = map_image( handle, unix_handle, base, size_low, mask, header_size, + res = map_image( handle, unix_handle, base, size, mask, header_size, shared_fd, dup_mapping, addr_ptr ); if (shared_needs_close) close( shared_fd ); NtClose( shared_file ); } else { - res = map_image( handle, unix_handle, base, size_low, mask, header_size, + res = map_image( handle, unix_handle, base, size, mask, header_size, -1, dup_mapping, addr_ptr ); } if (needs_close) close( unix_handle ); - if (!res) *size_ptr = size_low; + if (!res) *size_ptr = size; return res; } - if (size_high) - ERR("Sizes larger than 4Gb not supported\n"); - - if ((offset.u.LowPart >= size_low) || - (*size_ptr > size_low - offset.u.LowPart)) + if ((offset.QuadPart >= size) || (*size_ptr > size - offset.QuadPart)) { res = STATUS_INVALID_PARAMETER; goto done; } if (*size_ptr) size = ROUND_SIZE( offset.u.LowPart, *size_ptr ); - else size = size_low - offset.u.LowPart; + else size = size - offset.QuadPart; switch(protect) {
1
0
0
0
Alexandre Julliard : ntdll: Duplicate the mapping handle on the server side for NtMapViewOfSection.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 4cbe867a8504a4aedd1ddc4f8a5429c1cc1aea3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4cbe867a8504a4aedd1ddc4f8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 12 14:55:31 2007 +0100 ntdll: Duplicate the mapping handle on the server side for NtMapViewOfSection. --- dlls/ntdll/virtual.c | 39 ++++++++++++++++----------------------- include/wine/server_protocol.h | 3 ++- server/mapping.c | 16 ++++++++++++++-- server/protocol.def | 1 + server/trace.c | 2 ++ 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 2ad3cfb..64a8b8e 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -934,7 +934,7 @@ static int do_relocations( char *base, c * Map an executable (PE format) image into memory. */ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_size, SIZE_T mask, - SIZE_T header_size, int shared_fd, BOOL removable, PVOID *addr_ptr ) + SIZE_T header_size, int shared_fd, HANDLE dup_mapping, PVOID *addr_ptr ) { IMAGE_DOS_HEADER *dos; IMAGE_NT_HEADERS *nt; @@ -975,7 +975,7 @@ static NTSTATUS map_image( HANDLE hmappi if (!st.st_size) goto error; header_size = min( header_size, st.st_size ); if (map_file_into_view( view, fd, 0, header_size, 0, VPROT_COMMITTED | VPROT_READ | VPROT_WRITECOPY, - removable ) != STATUS_SUCCESS) goto error; + !dup_mapping ) != STATUS_SUCCESS) goto error; dos = (IMAGE_DOS_HEADER *)ptr; nt = (IMAGE_NT_HEADERS *)(ptr + dos->e_lfanew); header_end = ptr + ROUND_SIZE( 0, header_size ); @@ -1019,7 +1019,7 @@ static NTSTATUS map_image( HANDLE hmappi /* in that case Windows simply maps in the whole file */ if (map_file_into_view( view, fd, 0, total_size, 0, VPROT_COMMITTED | VPROT_READ, - removable ) != STATUS_SUCCESS) goto error; + !dup_mapping ) != STATUS_SUCCESS) goto error; /* check that all sections are loaded at the right offset */ if (nt->OptionalHeader.FileAlignment != nt->OptionalHeader.SectionAlignment) goto error; @@ -1121,7 +1121,7 @@ static NTSTATUS map_image( HANDLE hmappi end < file_start || map_file_into_view( view, fd, sec->VirtualAddress, file_size, file_start, VPROT_COMMITTED | VPROT_READ | VPROT_WRITECOPY, - removable ) != STATUS_SUCCESS) + !dup_mapping ) != STATUS_SUCCESS) { ERR_(module)( "Could not map section %.8s, file probably truncated\n", sec->Name ); goto error; @@ -1195,11 +1195,7 @@ static NTSTATUS map_image( HANDLE hmappi } done: - if (!removable) /* don't keep handle open on removable media */ - NtDuplicateObject( NtCurrentProcess(), hmapping, - NtCurrentProcess(), &view->mapping, - 0, 0, DUPLICATE_SAME_ACCESS ); - + view->mapping = dup_mapping; RtlLeaveCriticalSection( &csVirtual ); *addr_ptr = ptr; @@ -1208,6 +1204,7 @@ static NTSTATUS map_image( HANDLE hmappi error: if (view) delete_view( view ); RtlLeaveCriticalSection( &csVirtual ); + if (dup_mapping) NtClose( dup_mapping ); return status; } @@ -1837,13 +1834,12 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND NTSTATUS res; SIZE_T size = 0; SIZE_T mask = get_mask( zero_bits ); - int unix_handle = -1, flags, needs_close; + int unix_handle = -1, needs_close; int prot; void *base; struct file_view *view; DWORD size_low, size_high, header_size, shared_size; - HANDLE shared_file; - BOOL removable = FALSE; + HANDLE dup_mapping, shared_file; LARGE_INTEGER offset; offset.QuadPart = offset_ptr ? offset_ptr->QuadPart : 0; @@ -1871,14 +1867,14 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND size_low = reply->size_low; size_high = reply->size_high; header_size = reply->header_size; + dup_mapping = reply->mapping; shared_file = reply->shared_file; shared_size = reply->shared_size; } SERVER_END_REQ; if (res) return res; - if ((res = server_get_unix_fd( handle, 0, &unix_handle, &needs_close, NULL, &flags ))) return res; - removable = (flags & FD_FLAG_REMOVABLE) != 0; + if ((res = server_get_unix_fd( handle, 0, &unix_handle, &needs_close, NULL, NULL ))) goto done; if (prot & VPROT_IMAGE) { @@ -1889,14 +1885,14 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND if ((res = server_get_unix_fd( shared_file, FILE_READ_DATA|FILE_WRITE_DATA, &shared_fd, &shared_needs_close, NULL, NULL ))) goto done; res = map_image( handle, unix_handle, base, size_low, mask, header_size, - shared_fd, removable, addr_ptr ); + shared_fd, dup_mapping, addr_ptr ); if (shared_needs_close) close( shared_fd ); NtClose( shared_file ); } else { res = map_image( handle, unix_handle, base, size_low, mask, header_size, - -1, removable, addr_ptr ); + -1, dup_mapping, addr_ptr ); } if (needs_close) close( unix_handle ); if (!res) *size_ptr = size_low; @@ -1926,7 +1922,6 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND res = STATUS_INVALID_PARAMETER; goto done; } - removable = FALSE; /* fall through */ case PAGE_READONLY: case PAGE_WRITECOPY: @@ -1964,16 +1959,13 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND TRACE("handle=%p size=%lx offset=%x%08x\n", handle, size, offset.u.HighPart, offset.u.LowPart ); - res = map_file_into_view( view, unix_handle, 0, size, offset.QuadPart, prot, removable ); + res = map_file_into_view( view, unix_handle, 0, size, offset.QuadPart, prot, !dup_mapping ); if (res == STATUS_SUCCESS) { - if (!removable) /* don't keep handle open on removable media */ - NtDuplicateObject( NtCurrentProcess(), handle, - NtCurrentProcess(), &view->mapping, - 0, 0, DUPLICATE_SAME_ACCESS ); - *addr_ptr = view->base; *size_ptr = size; + view->mapping = dup_mapping; + dup_mapping = 0; /* don't close it */ } else { @@ -1985,6 +1977,7 @@ NTSTATUS WINAPI NtMapViewOfSection( HAND RtlLeaveCriticalSection( &csVirtual ); done: + if (dup_mapping) NtClose( dup_mapping ); if (needs_close) close( unix_handle ); return res; } diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index ce55bf0..03969ff 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -1535,6 +1535,7 @@ struct get_mapping_info_reply int protect; int header_size; void* base; + obj_handle_t mapping; obj_handle_t shared_file; int shared_size; }; @@ -4436,6 +4437,6 @@ union generic_reply struct query_symlink_reply query_symlink_reply; }; -#define SERVER_PROTOCOL_VERSION 263 +#define SERVER_PROTOCOL_VERSION 264 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/mapping.c b/server/mapping.c index fe99879..9b123e2 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -432,6 +432,7 @@ DECL_HANDLER(open_mapping) DECL_HANDLER(get_mapping_info) { struct mapping *mapping; + struct fd *fd; if ((mapping = (struct mapping *)get_handle_obj( current->process, req->handle, 0, &mapping_ops ))) @@ -443,9 +444,20 @@ DECL_HANDLER(get_mapping_info) reply->base = mapping->base; reply->shared_file = 0; reply->shared_size = mapping->shared_size; + if ((fd = get_obj_fd( &mapping->obj ))) + { + if (!is_fd_removable(fd)) + reply->mapping = alloc_handle( current->process, mapping, 0, 0 ); + release_object( fd ); + } if (mapping->shared_file) - reply->shared_file = alloc_handle( current->process, mapping->shared_file, - GENERIC_READ|GENERIC_WRITE, 0 ); + { + if (!(reply->shared_file = alloc_handle( current->process, mapping->shared_file, + GENERIC_READ|GENERIC_WRITE, 0 ))) + { + if (reply->mapping) close_handle( current->process, reply->mapping ); + } + } release_object( mapping ); } } diff --git a/server/protocol.def b/server/protocol.def index a71bcee..3f7fbd5 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1159,6 +1159,7 @@ enum char_info_mode int protect; /* protection flags */ int header_size; /* header size (for VPROT_IMAGE mapping) */ void* base; /* default base addr (for VPROT_IMAGE mapping) */ + obj_handle_t mapping; /* duplicate mapping handle unless removable */ obj_handle_t shared_file; /* shared mapping file handle */ int shared_size; /* shared mapping size */ @END diff --git a/server/trace.c b/server/trace.c index 1770a6d..5defbda 100644 --- a/server/trace.c +++ b/server/trace.c @@ -1570,6 +1570,7 @@ static void dump_get_mapping_info_reply( fprintf( stderr, " protect=%d,", req->protect ); fprintf( stderr, " header_size=%d,", req->header_size ); fprintf( stderr, " base=%p,", req->base ); + fprintf( stderr, " mapping=%p,", req->mapping ); fprintf( stderr, " shared_file=%p,", req->shared_file ); fprintf( stderr, " shared_size=%d", req->shared_size ); } @@ -3966,6 +3967,7 @@ static const struct { "FILE_LOCK_CONFLICT", STATUS_FILE_LOCK_CONFLICT }, { "HANDLES_CLOSED", STATUS_HANDLES_CLOSED }, { "HANDLE_NOT_CLOSABLE", STATUS_HANDLE_NOT_CLOSABLE }, + { "ILLEGAL_FUNCTION", STATUS_ILLEGAL_FUNCTION }, { "INSTANCE_NOT_AVAILABLE", STATUS_INSTANCE_NOT_AVAILABLE }, { "INVALID_CID", STATUS_INVALID_CID }, { "INVALID_FILE_FOR_SECTION", STATUS_INVALID_FILE_FOR_SECTION },
1
0
0
0
Alexandre Julliard : ntdll: Moved the check for removable file in load_dll to the server.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 5bd513640b52b62f379f2d15dc49cffbb899d191 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5bd513640b52b62f379f2d15d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 12 14:42:43 2007 +0100 ntdll: Moved the check for removable file in load_dll to the server. --- dlls/ntdll/loader.c | 3 --- dlls/ntdll/ntdll_misc.h | 1 - dlls/ntdll/virtual.c | 16 ---------------- server/fd.c | 8 +++++++- server/file.c | 6 ++++++ server/file.h | 2 ++ server/process.c | 2 +- 7 files changed, 16 insertions(+), 22 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 98b83b7..999687a 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1438,9 +1438,6 @@ static NTSTATUS load_native_dll( LPCWSTR nt = RtlImageNtHeader( module ); - /* don't keep the file open if the mapping is from removable media */ - if (!VIRTUAL_HasMapping( module )) file = 0; - SERVER_START_REQ( load_dll ) { req->handle = file; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index a7ef8df..3444998 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -111,7 +111,6 @@ extern NTSTATUS DIR_get_unix_cwd( char * /* virtual memory */ extern NTSTATUS VIRTUAL_HandleFault(LPCVOID addr); -extern BOOL VIRTUAL_HasMapping( LPCVOID addr ); extern void VIRTUAL_SetForceExec( BOOL enable ); extern void VIRTUAL_UseLargeAddressSpace(void); diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index fe33566..2ad3cfb 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1291,22 +1291,6 @@ NTSTATUS VIRTUAL_HandleFault( LPCVOID ad return ret; } -/*********************************************************************** - * VIRTUAL_HasMapping - * - * Check if the specified view has an associated file mapping. - */ -BOOL VIRTUAL_HasMapping( LPCVOID addr ) -{ - FILE_VIEW *view; - BOOL ret = FALSE; - - RtlEnterCriticalSection( &csVirtual ); - if ((view = VIRTUAL_FindView( addr ))) ret = (view->mapping != 0); - RtlLeaveCriticalSection( &csVirtual ); - return ret; -} - /*********************************************************************** * VIRTUAL_SetForceExec diff --git a/server/fd.c b/server/fd.c index d20360a..389c6a7 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1668,6 +1668,12 @@ int is_same_file_fd( struct fd *fd1, str return fd1->inode == fd2->inode; } +/* check if fd is on a removable device */ +int is_fd_removable( struct fd *fd ) +{ + return (fd->inode && fd->inode->device->removable); +} + /* handler for close_handle that refuses to close fd-associated handles in other processes */ int fd_close_handle( struct object *obj, struct process *process, obj_handle_t handle ) { @@ -1966,7 +1972,7 @@ DECL_HANDLER(get_handle_fd) reply->type = fd->fd_ops->get_file_info( fd, &reply->flags ); if (reply->type != FD_TYPE_INVALID) { - if (fd->inode && fd->inode->device->removable) reply->flags |= FD_FLAG_REMOVABLE; + if (is_fd_removable(fd)) reply->flags |= FD_FLAG_REMOVABLE; if (!req->cached) { int unix_fd = get_unix_fd( fd ); diff --git a/server/file.c b/server/file.c index 6647138..050f723 100644 --- a/server/file.c +++ b/server/file.c @@ -319,6 +319,12 @@ int get_file_unix_fd( struct file *file return get_unix_fd( file->fd ); } +struct file *grab_file_unless_removable( struct file *file ) +{ + if (is_fd_removable( file->fd )) return NULL; + return (struct file *)grab_object( file ); +} + /* extend a file beyond the current end of file */ static int extend_file( struct file *file, file_pos_t new_size ) { diff --git a/server/file.h b/server/file.h index 6edb59f..836d438 100644 --- a/server/file.h +++ b/server/file.h @@ -55,6 +55,7 @@ extern void *get_fd_user( struct fd *fd extern void set_fd_user( struct fd *fd, const struct fd_ops *ops, struct object *user ); extern int get_unix_fd( struct fd *fd ); extern int is_same_file_fd( struct fd *fd1, struct fd *fd2 ); +extern int is_fd_removable( struct fd *fd ); extern int fd_close_handle( struct object *obj, struct process *process, obj_handle_t handle ); extern void fd_poll_event( struct fd *fd, int event ); extern int check_fd_events( struct fd *fd, int events ); @@ -104,6 +105,7 @@ extern struct file *get_file_obj( struct unsigned int access ); extern int get_file_unix_fd( struct file *file ); extern int is_same_file( struct file *file1, struct file *file2 ); +extern struct file *grab_file_unless_removable( struct file *file ); extern int grow_file( struct file *file, file_pos_t size ); extern struct file *create_temp_file( int access ); extern void file_set_error(void); diff --git a/server/process.c b/server/process.c index 001afcb..1c53f49 100644 --- a/server/process.c +++ b/server/process.c @@ -492,7 +492,7 @@ static struct process_dll *process_load_ free( dll ); return NULL; } - if (file) dll->file = (struct file *)grab_object( file ); + if (file) dll->file = grab_file_unless_removable( file ); list_add_tail( &process->dlls, &dll->entry ); } return dll;
1
0
0
0
Francois Gouget : xrandr: Small X11DRV_XRandR_(Get|Set)CurrentMode() code optimisations.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: c255bf4676ac039b0718466c503f1f0064610742 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c255bf4676ac039b0718466c5…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jan 11 15:47:06 2007 +0100 xrandr: Small X11DRV_XRandR_(Get|Set)CurrentMode() code optimisations. --- dlls/winex11.drv/xrandr.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 8282794..997fc72 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -162,6 +162,8 @@ static int X11DRV_XRandR_GetCurrentMode( sc = pXRRGetScreenInfo (gdi_display, root); size = pXRRConfigCurrentConfiguration (sc, &rot); rate = pXRRConfigCurrentRate (sc); + pXRRFreeScreenConfigInfo(sc); + wine_tsx11_unlock(); for (i = 0; i < real_xrandr_modes_count; i++) { if ( (dd_modes[i].dwWidth == real_xrandr_sizes[size].width ) && @@ -169,10 +171,9 @@ static int X11DRV_XRandR_GetCurrentMode( (dd_modes[i].wRefreshRate == rate ) ) { res = i; + break; } } - pXRRFreeScreenConfigInfo(sc); - wine_tsx11_unlock(); if (res == -1) { ERR("In unknown mode, returning default\n"); @@ -226,6 +227,7 @@ static void X11DRV_XRandR_SetCurrentMode dd_modes[mode].dwWidth, dd_modes[mode].dwHeight, rate); stat = pXRRSetScreenConfigAndRate (gdi_display, sc, root, size, rot, rate, CurrentTime); + break; } } } @@ -235,6 +237,7 @@ static void X11DRV_XRandR_SetCurrentMode dd_modes[mode].dwWidth, dd_modes[mode].dwHeight); stat = pXRRSetScreenConfig (gdi_display, sc, root, size, rot, CurrentTime); } + break; } } pXRRFreeScreenConfigInfo(sc);
1
0
0
0
Bill Medland : odbccp32: Implement SQLGetInstalledDrivers.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: d99f9ab71a7fcc2a518a7323f9ea91e9d71783d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d99f9ab71a7fcc2a518a7323f…
Author: Bill Medland <billmedland(a)shaw.ca> Date: Thu Jan 11 09:29:44 2007 -0800 odbccp32: Implement SQLGetInstalledDrivers. --- dlls/odbccp32/odbccp32.c | 85 ++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 75 insertions(+), 10 deletions(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index cef3fb6..8575b0d 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -43,7 +43,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(odbc); static int num_errors; static int error_code[8]; static const WCHAR *error_msg[8]; +static const WCHAR odbc_error_general_err[] = {'G','e','n','e','r','a','l',' ','e','r','r','o','r',0}; static const WCHAR odbc_error_invalid_buff_len[] = {'I','n','v','a','l','i','d',' ','b','u','f','f','e','r',' ','l','e','n','g','t','h',0}; +static const WCHAR odbc_error_component_not_found[] = {'C','o','m','p','o','n','e','n','t',' ','n','o','t',' ','f','o','u','n','d',0}; +static const WCHAR odbc_error_out_of_mem[] = {'O','u','t',' ','o','f',' ','m','e','m','o','r','y',0}; /* Push an error onto the error stack, taking care of ranges etc. */ static void push_error(int code, LPCWSTR msg) @@ -263,31 +266,93 @@ BOOL WINAPI SQLGetConfigMode(UWORD *pwCo return FALSE; } +/* This is implemented sensibly rather than according to exact conformance to Microsoft's buggy implementations + * e.g. The Microsoft one occasionally actually adds a third nul character (possibly beyond the buffer). + * e.g. If the key has no drivers then version 3.525.1117.0 does not modify the buffer at all, not even a nul character. + */ BOOL WINAPI SQLGetInstalledDriversW(LPWSTR lpszBuf, WORD cbBufMax, WORD *pcbBufOut) { + HKEY hDrivers; /* Registry handle to the Drivers key */ + LONG reg_ret; /* Return code from registry functions */ + BOOL success = FALSE; /* The value we will return */ + clear_errors(); - FIXME("\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - /* Just enough for testing the SQLInstallerError. The meat will be in the next patch. */ if (!lpszBuf || cbBufMax == 0) { push_error(ODBC_ERROR_INVALID_BUFF_LEN, odbc_error_invalid_buff_len); } - return FALSE; + else if ((reg_ret = RegOpenKeyExA (HKEY_LOCAL_MACHINE /* The drivers does not depend on the config mode */, + "Software\\ODBC\\ODBCINST.INI\\ODBC Drivers", 0, KEY_READ /* Maybe overkill */, + &hDrivers)) == ERROR_SUCCESS) + { + DWORD index = 0; + cbBufMax--; + success = TRUE; + while (cbBufMax > 0) + { + DWORD size_name; + size_name = cbBufMax; + if ((reg_ret = RegEnumValueW(hDrivers, index, lpszBuf, &size_name, NULL, NULL, NULL, NULL)) == ERROR_SUCCESS) + { + index++; + assert (size_name < cbBufMax && *(lpszBuf + size_name) == 0); + size_name++; + cbBufMax-= size_name; + lpszBuf+=size_name; + } + else + { + if (reg_ret != ERROR_NO_MORE_ITEMS) + { + success = FALSE; + push_error(ODBC_ERROR_GENERAL_ERR, odbc_error_general_err); + } + break; + } + } + *lpszBuf = 0; + if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS) + TRACE ("Error %d closing ODBC Drivers key\n", reg_ret); + } + else + { + /* MSDN states that it returns failure with COMPONENT_NOT_FOUND in this case. + * Version 3.525.1117.0 (Windows 2000) does not; it actually returns success. + * I doubt if it will actually be an issue. + */ + push_error(ODBC_ERROR_COMPONENT_NOT_FOUND, odbc_error_component_not_found); + } + return success; } BOOL WINAPI SQLGetInstalledDrivers(LPSTR lpszBuf, WORD cbBufMax, WORD *pcbBufOut) { - FIXME("\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - /* Just enough for testing the SQLInstallerError. The meat will be in the next patch. */ - if (!lpszBuf || cbBufMax == 0) + BOOL ret; + int size_wbuf = cbBufMax; + LPWSTR wbuf; + WORD size_used; + wbuf = HeapAlloc(GetProcessHeap(), 0, size_wbuf*sizeof(WCHAR)); + if (wbuf) { - push_error(ODBC_ERROR_INVALID_BUFF_LEN, odbc_error_invalid_buff_len); + ret = SQLGetInstalledDriversW(wbuf, size_wbuf, &size_used); + if (ret) + { + if (!(ret = SQLInstall_narrow(2, lpszBuf, wbuf, size_used, cbBufMax, pcbBufOut))) + { + push_error(ODBC_ERROR_GENERAL_ERR, odbc_error_general_err); + } + } + HeapFree(GetProcessHeap(), 0, wbuf); + /* ignore failure; we have achieved the aim */ } - return FALSE; + else + { + push_error(ODBC_ERROR_OUT_OF_MEM, odbc_error_out_of_mem); + ret = FALSE; + } + return ret; } int WINAPI SQLGetPrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry,
1
0
0
0
Duane Clark : treeview: Fix horizontal scrolling.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 7942f5a0e4413ef1ec5a711c173b341ae19d9953 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7942f5a0e4413ef1ec5a711c1…
Author: Duane Clark <fpga(a)pacbell.net> Date: Thu Jan 11 15:06:05 2007 -0800 treeview: Fix horizontal scrolling. --- dlls/comctl32/treeview.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 4fb2a32..587a3cf 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2702,7 +2702,7 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO > infoPtr->clientWidth - GetSystemMetrics(SM_CXVSCROLL)) horz = TRUE; } - else if (infoPtr->treeWidth > infoPtr->clientWidth) + else if (infoPtr->treeWidth > infoPtr->clientWidth || infoPtr->scrollX > 0) horz = TRUE; if (!vert && horz && infoPtr->treeHeight @@ -2760,6 +2760,8 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO infoPtr->uInternalStatus |= TV_HSCROLL; SetScrollInfo(hwnd, SB_HORZ, &si, TRUE); + TREEVIEW_HScroll(infoPtr, + MAKEWPARAM(SB_THUMBPOSITION, scrollX)); } else { @@ -2768,12 +2770,11 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO infoPtr->uInternalStatus &= ~TV_HSCROLL; scrollX = 0; - } - - if (infoPtr->scrollX != scrollX) - { - TREEVIEW_HScroll(infoPtr, - MAKEWPARAM(SB_THUMBPOSITION, scrollX)); + if (infoPtr->scrollX != 0) + { + TREEVIEW_HScroll(infoPtr, + MAKEWPARAM(SB_THUMBPOSITION, scrollX)); + } } if (!horz)
1
0
0
0
Stefan Dösinger : wined3d: Avoid a NULL pointer dereference in UpdateTexture (Coverity).
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: ce0773a02e90c2cfbc506976207c5fe28037f1b3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ce0773a02e90c2cfbc5069762…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Jan 12 00:20:42 2007 +0100 wined3d: Avoid a NULL pointer dereference in UpdateTexture (Coverity). --- dlls/wined3d/device.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5f964fb..8a02e31 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5162,7 +5162,7 @@ static HRESULT WINAPI IWineD3DDeviceIm unsigned int srcSurfaceWidth, srcSurfaceHeight, destSurfaceWidth, destSurfaceHeight; WINED3DFORMAT destFormat, srcFormat; UINT destSize; - int destLeft, destTop; + int srcLeft, destLeft, destTop; WINED3DPOOL srcPool, destPool; int offset = 0; int rowoffset = 0; /* how many bytes to add onto the end of a row to wraparound to the beginning of the next */ @@ -5212,15 +5212,16 @@ static HRESULT WINAPI IWineD3DDeviceIm /* this needs to be done in lines if the sourceRect != the sourceWidth */ srcWidth = pSourceRect ? pSourceRect->right - pSourceRect->left : srcSurfaceWidth; srcHeight = pSourceRect ? pSourceRect->top - pSourceRect->bottom : srcSurfaceHeight; + srcLeft = pSourceRect ? pSourceRect->left : 0; destLeft = pDestPoint ? pDestPoint->x : 0; destTop = pDestPoint ? pDestPoint->y : 0; /* This function doesn't support compressed textures the pitch is just bytesPerPixel * width */ - if(srcWidth != srcSurfaceWidth || (pSourceRect != NULL && pSourceRect->left != 0) ){ + if(srcWidth != srcSurfaceWidth || srcLeft ){ rowoffset = (srcSurfaceWidth - srcWidth) * pSrcSurface->bytesPerPixel; - offset += pSourceRect->left * pSrcSurface->bytesPerPixel; + offset += srcLeft * pSrcSurface->bytesPerPixel; /* TODO: do we ever get 3bpp?, would a shift and an add be quicker than a mul (well maybe a cycle or two) */ } /* TODO DXT formats */
1
0
0
0
Stefan Dösinger : wined3d: Do not perform a NULL check on riid (Coverity).
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 723b32b1c999f8125546c166be1bab76cc769287 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=723b32b1c999f8125546c166b…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Jan 12 00:17:04 2007 +0100 wined3d: Do not perform a NULL check on riid (Coverity). --- dlls/wined3d/surface.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index e7991f6..de263b9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -188,9 +188,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Query IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; /* Warn ,but be nice about things */ TRACE("(%p)->(%s,%p)\n", This,debugstr_guid(riid),ppobj); - if (riid == NULL) { - ERR("Probably FIXME: Calling query interface with NULL riid\n"); - } + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IWineD3DBase) || IsEqualGUID(riid, &IID_IWineD3DResource)
1
0
0
0
Stefan Dösinger : d3d9: Implement IDirect3DDevice9:: StretchRect.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: cb74603e4360713b464137e994e6c9863a2daf75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb74603e4360713b464137e99…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Fri Jan 12 00:08:29 2007 +0100 d3d9: Implement IDirect3DDevice9::StretchRect. --- dlls/d3d9/device.c | 10 +++++++--- dlls/d3d9/directx.c | 3 +++ dlls/wined3d/device.c | 9 --------- include/wine/wined3d_interface.h | 2 -- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index aa788af..4c27853 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -356,9 +356,13 @@ static HRESULT WINAPI IDirect3DDevice9 } static HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) { - IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; - TRACE("(%p) Relay\n" , This); - return IWineD3DDevice_StretchRect(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestSurface)->wineD3DSurface, pDestRect, (WINED3DTEXTUREFILTERTYPE) Filter); + IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; + IDirect3DSurface9Impl *src = (IDirect3DSurface9Impl *) pSourceSurface; + IDirect3DSurface9Impl *dst = (IDirect3DSurface9Impl *) pDestSurface; + + TRACE("(%p)->(%p,%p,%p,%p,%d)\n" , This, src, pSourceRect, dst, pDestRect, Filter); + if(Filter != D3DTEXF_NONE) ERR("Texture filters not supported yet\n"); + return IWineD3DSurface_Blt(dst->wineD3DSurface, (RECT *) pDestRect, src->wineD3DSurface, (RECT *) pSourceRect, 0, NULL); } static HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) { diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index f360b4e..57062b2 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -170,6 +170,9 @@ static HRESULT WINAPI IDirect3D9Impl_Get D3D9CAPSTOWINECAPS(pCaps, pWineCaps) hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps); HeapFree(GetProcessHeap(), 0, pWineCaps); + + /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps */ + pCaps->Caps2 |= D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES; TRACE("(%p) returning %p\n", This, pCaps); return hrc; } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7b81f0e..5f964fb 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4930,14 +4930,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl return hr; } -static HRESULT WINAPI IWineD3DDeviceImpl_StretchRect(IWineD3DDevice *iface, IWineD3DSurface *pSourceSurface, - CONST RECT* pSourceRect, IWineD3DSurface *pDestinationSurface, - CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - - TRACE("(%p) : stub\n", This); - return WINED3D_OK; -} static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTargetData(IWineD3DDevice *iface, IWineD3DSurface *pRenderTarget, IWineD3DSurface *pSurface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; /** TODO: remove remove casts to IWineD3DSurfaceImpl * @@ -6776,7 +6768,6 @@ const IWineD3DDeviceVtbl IWineD3DDevice_ IWineD3DDeviceImpl_ColorFill, IWineD3DDeviceImpl_UpdateTexture, IWineD3DDeviceImpl_UpdateSurface, - IWineD3DDeviceImpl_StretchRect, IWineD3DDeviceImpl_GetRenderTargetData, IWineD3DDeviceImpl_GetFrontBufferData, /*** object tracking ***/ diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 8a685f0..4a24636 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -469,7 +469,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD STDMETHOD(ColorFill)(THIS_ struct IWineD3DSurface* pSurface, CONST WINED3DRECT* pRect, WINED3DCOLOR color) PURE; STDMETHOD(UpdateTexture)(THIS_ struct IWineD3DBaseTexture *pSourceTexture, struct IWineD3DBaseTexture *pDestinationTexture) PURE; STDMETHOD(UpdateSurface)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPoint) PURE; - STDMETHOD(StretchRect)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) PURE; STDMETHOD(GetRenderTargetData)(THIS_ struct IWineD3DSurface* pRenderTarget, struct IWineD3DSurface* pSurface) PURE; STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,struct IWineD3DSurface* pSurface) PURE; /*** object tracking ***/ @@ -608,7 +607,6 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD #define IWineD3DDevice_ColorFill(p,a,b,c) (p)->lpVtbl->ColorFill(p,a,b,c) #define IWineD3DDevice_UpdateTexture(p,a,b) (p)->lpVtbl->UpdateTexture(p,a,b) #define IWineD3DDevice_UpdateSurface(p,a,b,c,d) (p)->lpVtbl->UpdateSurface(p,a,b,c,d) -#define IWineD3DDevice_StretchRect(p,a,b,c,d,e) (p)->lpVtbl->StretchRect(p,a,b,c,d,e) #define IWineD3DDevice_GetRenderTargetData(p,a,b) (p)->lpVtbl->GetRenderTargetData(p,a,b) #define IWineD3DDevice_GetFrontBufferData(p,a,b) (p)->lpVtbl->GetFrontBufferData(p,a,b) #define IWineD3DDevice_ResourceReleased(p,a) (p)->lpVtbl->ResourceReleased(p,a)
1
0
0
0
Paul Vriens : ole32/tests: Cast-qual warnings fixes.
by Alexandre Julliard
12 Jan '07
12 Jan '07
Module: wine Branch: master Commit: 3d2baaa6cf9919291ff7b976bdefa16cbb81c707 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d2baaa6cf9919291ff7b976b…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Fri Jan 12 08:04:35 2007 +0100 ole32/tests: Cast-qual warnings fixes. --- dlls/ole32/tests/propvariant.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ole32/tests/propvariant.c b/dlls/ole32/tests/propvariant.c index c811eaa..f1cbc76 100644 --- a/dlls/ole32/tests/propvariant.c +++ b/dlls/ole32/tests/propvariant.c @@ -199,8 +199,8 @@ static void test_validtypes(void) static void test_copy(void) { - static const char szTestString[] = "Test String"; - static const WCHAR wszTestString[] = {'T','e','s','t',' ','S','t','r','i','n','g',0}; + static char szTestString[] = "Test String"; + static WCHAR wszTestString[] = {'T','e','s','t',' ','S','t','r','i','n','g',0}; PROPVARIANT propvarSrc; PROPVARIANT propvarDst; HRESULT hr; @@ -217,7 +217,7 @@ static void test_copy(void) ok(hr == S_OK, "PropVariantClear(...VT_BSTR...) failed\n"); propvarSrc.vt = VT_LPWSTR; - U(propvarSrc).pwszVal = (LPWSTR)wszTestString; + U(propvarSrc).pwszVal = wszTestString; hr = PropVariantCopy(&propvarDst, &propvarSrc); ok(hr == S_OK, "PropVariantCopy(...VT_LPWSTR...) failed\n"); ok(!lstrcmpW(U(propvarSrc).pwszVal, U(propvarDst).pwszVal), "Wide string not copied properly\n"); @@ -226,7 +226,7 @@ static void test_copy(void) memset(&propvarSrc, 0, sizeof(propvarSrc)); propvarSrc.vt = VT_LPSTR; - U(propvarSrc).pszVal = (LPSTR)szTestString; + U(propvarSrc).pszVal = szTestString; hr = PropVariantCopy(&propvarDst, &propvarSrc); ok(hr == S_OK, "PropVariantCopy(...VT_LPSTR...) failed\n"); ok(!strcmp(U(propvarSrc).pszVal, U(propvarDst).pszVal), "String not copied properly\n");
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200