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
June 2013
----- 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
2 participants
411 discussions
Start a n
N
ew thread
Andrew Eikum : oleaut32: When loading typelibs, skip over function default parameters as well.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 09d787d2d552baa184f72ed86a02ba98081e66b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=09d787d2d552baa184f72ed86…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue Jun 4 08:18:55 2013 -0500 oleaut32: When loading typelibs, skip over function default parameters as well. --- dlls/oleaut32/typelib.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 295cac3..725bf2f 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -2310,6 +2310,8 @@ MSFT_DoFuncs(TLBContext* pcx, /* size without argument data */ optional = reclength - pFuncRec->nrargs*sizeof(MSFT_ParameterInfo); + if (pFuncRec->FKCCIC & 0x1000) + optional -= pFuncRec->nrargs * sizeof(INT); if (optional > FIELD_OFFSET(MSFT_FuncRecord, HelpContext)) ptfd->helpcontext = pFuncRec->HelpContext;
1
0
0
0
Andrew Eikum : oleaut32: Implement ICreateTypeLib::SaveAllChanges.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: af3ae0c4f23366ea071dd1d48f7539ba6bad3a65 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af3ae0c4f23366ea071dd1d48…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue Jun 4 08:18:30 2013 -0500 oleaut32: Implement ICreateTypeLib::SaveAllChanges. --- dlls/oleaut32/typelib.c | 1251 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 1249 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=af3ae0c4f23366ea071dd…
1
0
0
0
Hans Leidekker : wbemprox: Add a partial implementation of CIM_DataFile.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 97f9d6fd8f3a4622ea68cfa59243cdc1e8f5da20 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=97f9d6fd8f3a4622ea68cfa59…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jun 4 13:29:03 2013 +0200 wbemprox: Add a partial implementation of CIM_DataFile. --- dlls/wbemprox/Makefile.in | 2 +- dlls/wbemprox/builtin.c | 131 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 131 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/Makefile.in b/dlls/wbemprox/Makefile.in index 613f3ff..1e42d3f 100644 --- a/dlls/wbemprox/Makefile.in +++ b/dlls/wbemprox/Makefile.in @@ -1,5 +1,5 @@ MODULE = wbemprox.dll -IMPORTS = iphlpapi dxgi oleaut32 ole32 advapi32 user32 gdi32 +IMPORTS = version iphlpapi dxgi oleaut32 ole32 advapi32 user32 gdi32 C_SRCS = \ builtin.c \ diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index ce97196..8878ddc 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -37,6 +37,7 @@ #include "winternl.h" #include "winioctl.h" #include "winsvc.h" +#include "winver.h" #include "wine/debug.h" #include "wbemprox_private.h" @@ -51,6 +52,8 @@ static const WCHAR class_cdromdriveW[] = {'W','i','n','3','2','_','C','D','R','O','M','D','r','i','v','e',0}; static const WCHAR class_compsysW[] = {'W','i','n','3','2','_','C','o','m','p','u','t','e','r','S','y','s','t','e','m',0}; +static const WCHAR class_datafileW[] = + {'C','I','M','_','D','a','t','a','F','i','l','e',0}; static const WCHAR class_directoryW[] = {'W','i','n','3','2','_','D','i','r','e','c','t','o','r','y',0}; static const WCHAR class_diskdriveW[] = @@ -262,10 +265,15 @@ static const struct column col_compsys[] = { prop_numprocessorsW, CIM_UINT32, VT_I4 }, { prop_totalphysicalmemoryW, CIM_UINT64 } }; +static const struct column col_datafile[] = +{ + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_versionW, CIM_STRING|COL_FLAG_DYNAMIC } +}; static const struct column col_directory[] = { { prop_accessmaskW, CIM_UINT32 }, - { prop_nameW, CIM_STRING|COL_FLAG_KEY } + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY } }; static const struct column col_diskdrive[] = { @@ -498,6 +506,11 @@ struct record_computersystem UINT32 num_processors; UINT64 total_physical_memory; }; +struct record_datafile +{ + const WCHAR *name; + const WCHAR *version; +}; struct record_directory { UINT32 accessmask; @@ -1092,6 +1105,121 @@ static WCHAR *append_path( const WCHAR *path, const WCHAR *segment, UINT *len ) return ret; } +static WCHAR *get_file_version( const WCHAR *filename ) +{ + static const WCHAR slashW[] = {'\\',0}, fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; + VS_FIXEDFILEINFO *info; + DWORD size; + void *block; + WCHAR *ret; + + if (!(ret = heap_alloc( (4 * 5 + sizeof(fmtW) / sizeof(fmtW[0])) * sizeof(WCHAR) ))) return NULL; + if (!(size = GetFileVersionInfoSizeW( filename, NULL )) || !(block = heap_alloc( size ))) + { + heap_free( ret ); + return NULL; + } + if (!GetFileVersionInfoW( filename, 0, size, block ) || + !VerQueryValueW( block, slashW, (void **)&info, &size )) + { + heap_free( block ); + heap_free( ret ); + return NULL; + } + sprintfW( ret, fmtW, info->dwFileVersionMS >> 16, info->dwFileVersionMS & 0xffff, + info->dwFileVersionLS >> 16, info->dwFileVersionLS & 0xffff ); + heap_free( block ); + return ret; +} + +static enum fill_status fill_datafile( struct table *table, const struct expr *cond ) +{ + static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0}; + struct record_datafile *rec; + UINT i, len, row = 0, offset = 0, num_expected_rows; + WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0}; + DWORD drives = GetLogicalDrives(); + WIN32_FIND_DATAW data; + HANDLE handle; + struct dirstack *dirstack = alloc_dirstack(2); + enum fill_status status = FILL_STATUS_UNFILTERED; + + if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED; + + for (i = 0; i < sizeof(drives); i++) + { + if (!(drives & (1 << i))) continue; + + root[0] = 'A' + i; + if (GetDriveTypeW( root ) != DRIVE_FIXED) continue; + + num_expected_rows = 0; + if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack ); + + for (;;) + { + path = pop_dir( dirstack, &len ); + if (!(glob = build_glob( root[0], path, len ))) + { + status = FILL_STATUS_FAILED; + goto done; + } + if ((handle = FindFirstFileW( glob, &data )) != INVALID_HANDLE_VALUE) + { + do + { + if (!resize_table( table, row + 1, sizeof(*rec) )) + { + status = FILL_STATUS_FAILED; + goto done; + } + if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue; + new_path = append_path( path, data.cFileName, &len ); + + if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + if (push_dir( dirstack, new_path, len )) continue; + heap_free( new_path ); + status = FILL_STATUS_FAILED; + goto done; + } + rec = (struct record_datafile *)(table->data + offset); + rec->name = build_name( root[0], new_path ); + rec->version = get_file_version( rec->name ); + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + else if (num_expected_rows && row == num_expected_rows - 1) + { + row++; + FindClose( handle ); + status = FILL_STATUS_FILTERED; + goto done; + } + offset += sizeof(*rec); + row++; + } + while (FindNextFileW( handle, &data )); + FindClose( handle ); + } + if (!peek_dir( dirstack )) break; + heap_free( glob ); + heap_free( path ); + } + } + +done: + free_dirstack( dirstack ); + heap_free( glob ); + heap_free( path ); + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static enum fill_status fill_directory( struct table *table, const struct expr *cond ) { static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0}; @@ -1870,6 +1998,7 @@ static struct table builtin_classes[] = { class_biosW, SIZEOF(col_bios), col_bios, SIZEOF(data_bios), 0, (BYTE *)data_bios }, { class_cdromdriveW, SIZEOF(col_cdromdrive), col_cdromdrive, 0, 0, NULL, fill_cdromdrive }, { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys }, + { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile }, { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory }, { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, SIZEOF(data_diskdrive), 0, (BYTE *)data_diskdrive }, { class_diskpartitionW, SIZEOF(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition },
1
0
0
0
Hans Leidekker : wbemprox: Add a function to resize a table.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 0f8cbab1a9c99c63da4a880912abdb2d7280ce02 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0f8cbab1a9c99c63da4a88091…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jun 4 13:28:21 2013 +0200 wbemprox: Add a function to resize a table. --- dlls/wbemprox/builtin.c | 127 ++++++++++++++++++-------------------- dlls/wbemprox/class.c | 2 +- dlls/wbemprox/table.c | 20 +++--- dlls/wbemprox/wbemprox_private.h | 3 +- 4 files changed, 74 insertions(+), 78 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0f8cbab1a9c99c63da4a8…
1
0
0
0
Hans Leidekker : wbemprox: Rewrite IWbemServices:: ExecMethod with low-level functions so we can reuse the object instance.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: f4da96bb29d38f67dae6d2868ff41f62af4ae1e4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4da96bb29d38f67dae6d2868…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jun 4 13:27:48 2013 +0200 wbemprox: Rewrite IWbemServices::ExecMethod with low-level functions so we can reuse the object instance. --- dlls/wbemprox/query.c | 12 +++---- dlls/wbemprox/services.c | 70 +++++++++++++++++++++++++------------- dlls/wbemprox/wbemprox_private.h | 3 ++ 3 files changed, 54 insertions(+), 31 deletions(-) diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index bff3f8e..e1a10a4 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -238,7 +238,7 @@ HRESULT eval_cond( const struct table *table, UINT row, const struct expr *cond, return WBEM_E_INVALID_QUERY; } -static HRESULT execute_view( struct view *view ) +HRESULT execute_view( struct view *view ) { UINT i, j = 0, len; @@ -272,7 +272,7 @@ static HRESULT execute_view( struct view *view ) return S_OK; } -static struct query *create_query(void) +struct query *create_query(void) { struct query *query; @@ -282,15 +282,13 @@ static struct query *create_query(void) return query; } -static void free_query( struct query *query ) +void free_query( struct query *query ) { struct list *mem, *next; + if (!query) return; destroy_view( query->view ); - LIST_FOR_EACH_SAFE( mem, next, &query->mem ) - { - heap_free( mem ); - } + LIST_FOR_EACH_SAFE( mem, next, &query->mem ) { heap_free( mem ); } heap_free( query ); } diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 10036ae..ac5eb74 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -377,7 +377,7 @@ static void free_path( struct path *path ) heap_free( path ); } -static HRESULT create_instance_enum( const struct path *path, IEnumWbemClassObject **iter ) +static WCHAR *query_from_path( const struct path *path ) { static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','%','s',' ', @@ -385,22 +385,30 @@ static HRESULT create_instance_enum( const struct path *path, IEnumWbemClassObje static const WCHAR select_allW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0}; WCHAR *query; - HRESULT hr; UINT len; if (path->filter) { len = path->class_len + path->filter_len + SIZEOF(selectW); - if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL; sprintfW( query, selectW, path->class, path->filter ); } else { len = path->class_len + SIZEOF(select_allW); - if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY; + if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL; strcpyW( query, select_allW ); strcatW( query, path->class ); } + return query; +} + +static HRESULT create_instance_enum( const struct path *path, IEnumWbemClassObject **iter ) +{ + WCHAR *query; + HRESULT hr; + + if (!(query = query_from_path( path ))) return E_OUTOFMEMORY; hr = exec_query( query, iter ); heap_free( query ); return hr; @@ -778,10 +786,12 @@ static HRESULT WINAPI wbem_services_ExecMethod( IWbemClassObject **ppOutParams, IWbemCallResult **ppCallResult ) { - IWbemClassObject *obj; - struct table *table; - class_method *func; + IEnumWbemClassObject *result = NULL; + IWbemClassObject *obj = NULL; + struct query *query = NULL; struct path *path; + WCHAR *str; + class_method *func; HRESULT hr; TRACE("%p, %s, %s, %08x, %p, %p, %p, %p\n", iface, debugstr_w(strObjectPath), @@ -789,28 +799,40 @@ static HRESULT WINAPI wbem_services_ExecMethod( if (lFlags) FIXME("flags %08x not supported\n", lFlags); - if ((hr = get_object( strObjectPath, &obj ))) return hr; - if ((hr = parse_path( strObjectPath, &path )) != S_OK) + if ((hr = parse_path( strObjectPath, &path )) != S_OK) return hr; + if (!(str = query_from_path( path ))) { - IWbemClassObject_Release( obj ); - return hr; - } - table = grab_table( path->class ); - free_path( path ); - if (!table) - { - IWbemClassObject_Release( obj ); - return WBEM_E_NOT_FOUND; + hr = E_OUTOFMEMORY; + goto done; } - hr = get_method( table, strMethodName, &func ); - release_table( table ); - if (hr != S_OK) + if (!(query = create_query())) { - IWbemClassObject_Release( obj ); - return hr; + hr = E_OUTOFMEMORY; + goto done; } + hr = parse_query( str, &query->view, &query->mem ); + if (hr != S_OK) goto done; + + hr = execute_view( query->view ); + if (hr != S_OK) goto done; + + hr = EnumWbemClassObject_create( NULL, query, (void **)&result ); + if (hr != S_OK) goto done; + + hr = create_class_object( query->view->table->name, result, 0, NULL, &obj ); + if (hr != S_OK) goto done; + + hr = get_method( query->view->table, strMethodName, &func ); + if (hr != S_OK) goto done; + hr = func( obj, pInParams, ppOutParams ); - IWbemClassObject_Release( obj ); + +done: + if (result) IEnumWbemClassObject_Release( result ); + if (obj) IWbemClassObject_Release( obj ); + free_query( query ); + free_path( path ); + heap_free( str ); return hr; } diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h index 7c5ee89..e11cdff 100644 --- a/dlls/wbemprox/wbemprox_private.h +++ b/dlls/wbemprox/wbemprox_private.h @@ -163,6 +163,8 @@ struct query struct list mem; }; +struct query *create_query(void) DECLSPEC_HIDDEN; +void free_query( struct query * ) DECLSPEC_HIDDEN; struct query *addref_query( struct query * ) DECLSPEC_HIDDEN; void release_query( struct query *query ) DECLSPEC_HIDDEN; HRESULT exec_query( const WCHAR *, IEnumWbemClassObject ** ) DECLSPEC_HIDDEN; @@ -170,6 +172,7 @@ HRESULT parse_query( const WCHAR *, struct view **, struct list * ) DECLSPEC_HID HRESULT create_view( const struct property *, const WCHAR *, const struct expr *, struct view ** ) DECLSPEC_HIDDEN; void destroy_view( struct view * ) DECLSPEC_HIDDEN; +HRESULT execute_view( struct view * ) DECLSPEC_HIDDEN; void init_table_list( void ) DECLSPEC_HIDDEN; struct table *grab_table( const WCHAR * ) DECLSPEC_HIDDEN; struct table *addref_table( struct table * ) DECLSPEC_HIDDEN;
1
0
0
0
Hans Leidekker : wbemprox: Use the right allocator for BSTR values in get_owner.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 9a14d5d024ec4f95663b74a0e8a5c1e5a571f651 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a14d5d024ec4f95663b74a0e…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jun 4 13:27:08 2013 +0200 wbemprox: Use the right allocator for BSTR values in get_owner. --- dlls/wbemprox/process.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wbemprox/process.c b/dlls/wbemprox/process.c index 918ba91..d3552b7 100644 --- a/dlls/wbemprox/process.c +++ b/dlls/wbemprox/process.c @@ -40,14 +40,14 @@ static HRESULT get_owner( VARIANT *user, VARIANT *domain, VARIANT *retval ) len = 0; GetUserNameW( NULL, &len ); if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto done; - if (!(V_BSTR( user ) = heap_alloc( len * sizeof(WCHAR) ))) goto done; + if (!(V_BSTR( user ) = SysAllocStringLen( NULL, len - 1 ))) goto done; if (!GetUserNameW( V_BSTR( user ), &len )) goto done; V_VT( user ) = VT_BSTR; len = 0; GetComputerNameW( NULL, &len ); if (GetLastError() != ERROR_BUFFER_OVERFLOW) goto done; - if (!(V_BSTR( domain ) = heap_alloc( len * sizeof(WCHAR) ))) goto done; + if (!(V_BSTR( domain ) = SysAllocStringLen( NULL, len - 1 ))) goto done; if (!GetComputerNameW( V_BSTR( domain ), &len )) goto done; V_VT( domain ) = VT_BSTR;
1
0
0
0
Hans Leidekker : wbemprox: Optimize a common Win32_Directory query.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 8e1aa4358a7eeef906a9255594f27f9e5910eb6c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e1aa4358a7eeef906a925559…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Jun 4 13:26:32 2013 +0200 wbemprox: Optimize a common Win32_Directory query. --- dlls/wbemprox/builtin.c | 176 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 139 insertions(+), 37 deletions(-) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index fc77419..91bcb9e 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -839,37 +839,6 @@ static enum fill_status fill_compsys( struct table *table, const struct expr *co return status; } -static WCHAR *get_filesystem( const WCHAR *root ) -{ - static const WCHAR ntfsW[] = {'N','T','F','S',0}; - WCHAR buffer[MAX_PATH + 1]; - - if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) - return heap_strdupW( buffer ); - return heap_strdupW( ntfsW ); -} - -static UINT64 get_freespace( const WCHAR *dir, UINT64 *disksize ) -{ - WCHAR root[] = {'\\','\\','.','\\','A',':',0}; - ULARGE_INTEGER free; - DISK_GEOMETRY_EX info; - HANDLE handle; - - free.QuadPart = 512 * 1024 * 1024; - GetDiskFreeSpaceExW( dir, NULL, NULL, &free ); - - root[4] = dir[0]; - handle = CreateFileW( root, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); - if (handle != INVALID_HANDLE_VALUE) - { - if (DeviceIoControl( handle, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, &info, sizeof(info), NULL, NULL )) - *disksize = info.DiskSize.QuadPart; - CloseHandle( handle ); - } - return free.QuadPart; -} - struct dirstack { WCHAR **dirs; @@ -899,10 +868,16 @@ static struct dirstack *alloc_dirstack( UINT size ) return dirstack; } -static void free_dirstack( struct dirstack *dirstack ) +static void clear_dirstack( struct dirstack *dirstack ) { UINT i; for (i = 0; i < dirstack->num_dirs; i++) heap_free( dirstack->dirs[i] ); + dirstack->num_dirs = 0; +} + +static void free_dirstack( struct dirstack *dirstack ) +{ + clear_dirstack( dirstack ); heap_free( dirstack->dirs ); heap_free( dirstack->len_dirs ); heap_free( dirstack ); @@ -912,6 +887,8 @@ static BOOL push_dir( struct dirstack *dirstack, WCHAR *dir, UINT len ) { UINT size, i = dirstack->num_dirs; + if (!dir) return FALSE; + if (i == dirstack->num_allocated) { WCHAR **tmp; @@ -957,7 +934,7 @@ static WCHAR *build_glob( WCHAR drive, const WCHAR *path, UINT len ) ret[i++] = drive; ret[i++] = ':'; ret[i++] = '\\'; - if (path) + if (path && len) { memcpy( ret + i, path, len * sizeof(WCHAR) ); i += len; @@ -968,7 +945,7 @@ static WCHAR *build_glob( WCHAR drive, const WCHAR *path, UINT len ) return ret; } -static WCHAR *build_dirname( WCHAR drive, const WCHAR *path ) +static WCHAR *build_name( WCHAR drive, const WCHAR *path ) { UINT i = 0, len = 0; const WCHAR *p; @@ -997,6 +974,90 @@ static WCHAR *build_dirname( WCHAR drive, const WCHAR *path ) return ret; } +static WCHAR *build_dirname( const WCHAR *path, UINT *ret_len ) +{ + const WCHAR *p = path, *start; + UINT len, i; + WCHAR *ret; + + if (!isalphaW( p[0] ) || p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL; + start = path + 4; + len = strlenW( start ); + p = start + len - 1; + if (*p == '\\') return NULL; + + while (p >= start && *p != '\\') { len--; p--; }; + while (p >= start && *p == '\\') { len--; p--; }; + + if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL; + for (i = 0, p = start; p < start + len; p++) + { + if (p[0] == '\\' && p[1] == '\\') + { + ret[i++] = '\\'; + p++; + } + else ret[i++] = *p; + } + ret[i] = 0; + *ret_len = i; + return ret; +} + +static BOOL seen_dir( struct dirstack *dirstack, const WCHAR *path ) +{ + UINT i; + for (i = 0; i < dirstack->num_dirs; i++) if (!strcmpW( dirstack->dirs[i], path )) return TRUE; + return FALSE; +} + +/* optimize queries of the form WHERE Name='...' [OR Name='...']* */ +static UINT seed_dirs( struct dirstack *dirstack, const struct expr *cond, WCHAR root, UINT *count ) +{ + const struct expr *left = cond->u.expr.left, *right = cond->u.expr.right; + + if (cond->type != EXPR_COMPLEX) return *count = 0; + if (cond->u.expr.op == OP_EQ) + { + UINT len; + WCHAR *path; + const WCHAR *str = NULL; + + if (left->type == EXPR_PROPVAL && right->type == EXPR_SVAL && + !strcmpW( left->u.propval->name, prop_nameW ) && + toupperW( right->u.sval[0] ) == toupperW( root )) + { + str = right->u.sval; + } + else if (left->type == EXPR_SVAL && right->type == EXPR_PROPVAL && + !strcmpW( right->u.propval->name, prop_nameW ) && + toupperW( left->u.sval[0] ) == toupperW( root )) + { + str = left->u.sval; + } + if (str && (path = build_dirname( str, &len ))) + { + if (seen_dir( dirstack, path )) + { + heap_free( path ); + return ++*count; + } + else if (push_dir( dirstack, path, len )) return ++*count; + heap_free( path ); + return *count = 0; + } + } + else if (cond->u.expr.op == OP_OR) + { + UINT left_count = 0, right_count = 0; + + if (!(seed_dirs( dirstack, left, root, &left_count ))) return *count = 0; + if (!(seed_dirs( dirstack, right, root, &right_count ))) return *count = 0; + return *count += left_count + right_count; + } + return *count = 0; +} + static WCHAR *append_path( const WCHAR *path, const WCHAR *segment, UINT *len ) { UINT len_path = 0, len_segment = strlenW( segment ); @@ -1005,7 +1066,7 @@ static WCHAR *append_path( const WCHAR *path, const WCHAR *segment, UINT *len ) *len = 0; if (path) len_path = strlenW( path ); if (!(ret = heap_alloc( (len_path + len_segment + 2) * sizeof(WCHAR) ))) return NULL; - if (path) + if (path && len_path) { memcpy( ret, path, len_path * sizeof(WCHAR) ); ret[len_path] = '\\'; @@ -1021,7 +1082,7 @@ static enum fill_status fill_directory( struct table *table, const struct expr * { static const WCHAR dotW[] = {'.',0}, dotdotW[] = {'.','.',0}; struct record_directory *rec; - UINT i, len, row = 0, offset = 0, count = 4; + UINT i, len, row = 0, offset = 0, count = 4, num_expected_rows; WCHAR *glob = NULL, *path = NULL, *new_path, root[] = {'A',':','\\',0}; DWORD drives = GetLogicalDrives(); WIN32_FIND_DATAW data; @@ -1038,6 +1099,9 @@ static enum fill_status fill_directory( struct table *table, const struct expr * root[0] = 'A' + i; if (GetDriveTypeW( root ) != DRIVE_FIXED) continue; + num_expected_rows = 0; + if (!seed_dirs( dirstack, cond, root[0], &num_expected_rows )) clear_dirstack( dirstack ); + for (;;) { path = pop_dir( dirstack, &len ); @@ -1074,12 +1138,19 @@ static enum fill_status fill_directory( struct table *table, const struct expr * } rec = (struct record_directory *)(table->data + offset); rec->accessmask = FILE_ALL_ACCESS; - rec->name = build_dirname( root[0], new_path ); + rec->name = build_name( root[0], new_path ); if (!match_row( table, row, cond, &status )) { free_row_values( table, row ); continue; } + else if (num_expected_rows && row == num_expected_rows - 1) + { + row++; + FindClose( handle ); + status = FILL_STATUS_FILTERED; + goto done; + } offset += sizeof(*rec); row++; } @@ -1102,6 +1173,37 @@ done: return status; } +static WCHAR *get_filesystem( const WCHAR *root ) +{ + static const WCHAR ntfsW[] = {'N','T','F','S',0}; + WCHAR buffer[MAX_PATH + 1]; + + if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) + return heap_strdupW( buffer ); + return heap_strdupW( ntfsW ); +} + +static UINT64 get_freespace( const WCHAR *dir, UINT64 *disksize ) +{ + WCHAR root[] = {'\\','\\','.','\\','A',':',0}; + ULARGE_INTEGER free; + DISK_GEOMETRY_EX info; + HANDLE handle; + + free.QuadPart = 512 * 1024 * 1024; + GetDiskFreeSpaceExW( dir, NULL, NULL, &free ); + + root[4] = dir[0]; + handle = CreateFileW( root, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 ); + if (handle != INVALID_HANDLE_VALUE) + { + if (DeviceIoControl( handle, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, &info, sizeof(info), NULL, NULL )) + *disksize = info.DiskSize.QuadPart; + CloseHandle( handle ); + } + return free.QuadPart; +} + static enum fill_status fill_diskpartition( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] =
1
0
0
0
Ken Thomases : winemac: Ignore window frame changes while minimized but check again when unminimized .
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: a6dc4906de8caa187deb38bd0e044e5aab442ce5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a6dc4906de8caa187deb38bd0…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Tue Jun 4 04:59:54 2013 -0500 winemac: Ignore window frame changes while minimized but check again when unminimized. --- dlls/winemac.drv/cocoa_window.m | 2 ++ dlls/winemac.drv/window.c | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 6fbd0db..9d8984c 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -1229,6 +1229,8 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) causing_becomeKeyWindow = FALSE; [controller windowGotFocus:self]; } + + [self windowDidResize:notification]; } - (void) windowDidEndLiveResize:(NSNotification *)notification diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index a04f1e2..7e0c60e 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1500,7 +1500,7 @@ void macdrv_window_frame_changed(HWND hwnd, CGRect frame) if (!hwnd) return; if (!(data = get_win_data(hwnd))) return; - if (!data->on_screen) + if (!data->on_screen || data->minimized) { release_win_data(data); return;
1
0
0
0
Ken Thomases : winemac: Make windows key after unminimizing, if allowed.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: 62a1907c9e9f66c331370c654bb600f175a0cba1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=62a1907c9e9f66c331370c654…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Tue Jun 4 04:59:51 2013 -0500 winemac: Make windows key after unminimizing, if allowed. We generally prevent Cocoa from making our windows key (focused) so that Wine can be in control. However, after unminimizing, Wine believes the window is already focused but Cocoa doesn't, so key presses just cause beeps. --- dlls/winemac.drv/cocoa_window.m | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 035576e..6fbd0db 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -1202,6 +1202,8 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) - (void)windowDidDeminiaturize:(NSNotification *)notification { + WineApplicationController* controller = [WineApplicationController sharedController]; + if (!ignore_windowDeminiaturize) { macdrv_event* event; @@ -1218,7 +1220,15 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) ignore_windowDeminiaturize = FALSE; - [[WineApplicationController sharedController] adjustWindowLevels]; + [controller adjustWindowLevels]; + + if (!self.disabled && !self.noActivate) + { + causing_becomeKeyWindow = TRUE; + [self makeKeyWindow]; + causing_becomeKeyWindow = FALSE; + [controller windowGotFocus:self]; + } } - (void) windowDidEndLiveResize:(NSNotification *)notification
1
0
0
0
Ken Thomases : winemac: Allow Cocoa to make minimized windows key; it will unminimize them as necessary.
by Alexandre Julliard
04 Jun '13
04 Jun '13
Module: wine Branch: master Commit: b15f412e14ec3160ba2c9b2afe42102355f64a89 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b15f412e14ec3160ba2c9b2af…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Tue Jun 4 04:59:49 2013 -0500 winemac: Allow Cocoa to make minimized windows key; it will unminimize them as necessary. --- dlls/winemac.drv/window.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index eacc0b6..a04f1e2 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -93,7 +93,6 @@ static inline BOOL can_activate_window(HWND hwnd) if (!(style & WS_VISIBLE)) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; - if (style & WS_MINIMIZE) return FALSE; if (GetWindowLongW(hwnd, GWL_EXSTYLE) & WS_EX_NOACTIVATE) return FALSE; if (hwnd == GetDesktopWindow()) return FALSE; if (GetWindowRect(hwnd, &rect) && IsRectEmpty(&rect)) return FALSE; @@ -1548,14 +1547,15 @@ void macdrv_window_frame_changed(HWND hwnd, CGRect frame) */ void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) { + LONG style = GetWindowLongW(hwnd, GWL_STYLE); + if (!hwnd) return; TRACE("win %p/%p serial %lu enabled %d visible %d style %08x focus %p active %p fg %p\n", hwnd, event->window, event->window_got_focus.serial, IsWindowEnabled(hwnd), - IsWindowVisible(hwnd), GetWindowLongW(hwnd, GWL_STYLE), GetFocus(), - GetActiveWindow(), GetForegroundWindow()); + IsWindowVisible(hwnd), style, GetFocus(), GetActiveWindow(), GetForegroundWindow()); - if (can_activate_window(hwnd)) + if (can_activate_window(hwnd) && !(style & WS_MINIMIZE)) { /* simulate a mouse click on the caption to find out * whether the window wants to be activated */
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
42
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
Results per page:
10
25
50
100
200