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
July 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
447 discussions
Start a n
N
ew thread
Rico Schüller : d3dx9: Improve ID3DXConstantTable:: SetDefaults().
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 1099bb5e76de05718e3cbd43a3d0326883f39cfe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1099bb5e76de05718e3cbd43a…
Author: Rico Schüller <kgbricola(a)web.de> Date: Mon Jul 29 11:13:54 2013 +0200 d3dx9: Improve ID3DXConstantTable::SetDefaults(). --- dlls/d3dx9_36/shader.c | 53 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 42 insertions(+), 11 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 457036b..16395e8 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -750,15 +750,6 @@ static inline struct ctab_constant *get_valid_constant(struct ID3DXConstantTable return get_constant_by_name(table, NULL, handle); } -static inline void set_float_shader_constant(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, - UINT register_index, const FLOAT *data, UINT count) -{ - if (is_vertex_shader(table->desc.Version)) - IDirect3DDevice9_SetVertexShaderConstantF(device, register_index, data, count); - else - IDirect3DDevice9_SetPixelShaderConstantF(device, register_index, data, count); -} - /*** IUnknown methods ***/ static HRESULT WINAPI ID3DXConstantTableImpl_QueryInterface(ID3DXConstantTable *iface, REFIID riid, void **out) { @@ -1434,19 +1425,59 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetDefaults(struct ID3DXConstantTab struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface); UINT i; - TRACE("(%p)->(%p)\n", This, device); + TRACE("iface %p, device %p\n", iface, device); if (!device) + { + WARN("Invalid argument specified\n"); return D3DERR_INVALIDCALL; + } for (i = 0; i < This->desc.Constants; i++) { D3DXCONSTANT_DESC *desc = &This->constants[i].desc; + HRESULT hr; if (!desc->DefaultValue) continue; - set_float_shader_constant(This, device, desc->RegisterIndex, desc->DefaultValue, desc->RegisterCount); + switch (desc->RegisterSet) + { + case D3DXRS_BOOL: + if (is_vertex_shader(This->desc.Version)) + hr = IDirect3DDevice9_SetVertexShaderConstantB(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + else + hr = IDirect3DDevice9_SetPixelShaderConstantB(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + break; + + case D3DXRS_INT4: + if (is_vertex_shader(This->desc.Version)) + hr = IDirect3DDevice9_SetVertexShaderConstantI(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + else + hr = IDirect3DDevice9_SetPixelShaderConstantI(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + break; + + case D3DXRS_FLOAT4: + if (is_vertex_shader(This->desc.Version)) + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + else + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, desc->RegisterIndex, desc->DefaultValue, + desc->RegisterCount); + break; + + default: + FIXME("Unhandled register set %s\n", debug_d3dxparameter_registerset(desc->RegisterSet)); + hr = E_NOTIMPL; + break; + } + + if (hr != D3D_OK) + return hr; } return D3D_OK;
1
0
0
0
Rico Schüller : d3dx9/tests: Add ID3DXConstantTable struct struct test.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: c76f6085b25a87b73dae149430504f4f0aac22c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c76f6085b25a87b73dae14943…
Author: Rico Schüller <kgbricola(a)web.de> Date: Mon Jul 29 11:13:42 2013 +0200 d3dx9/tests: Add ID3DXConstantTable struct struct test. --- dlls/d3dx9_36/tests/shader.c | 350 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 350 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c76f6085b25a87b73dae1…
1
0
0
0
Piotr Caban : winedump: Rename res07 typelib segment to NameHashTab.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 1121868e22d78eb4644d24bbceb31924ccc62d03 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1121868e22d78eb4644d24bbc…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jul 28 10:06:17 2013 +0200 winedump: Rename res07 typelib segment to NameHashTab. --- tools/winedump/tlb.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/winedump/tlb.c b/tools/winedump/tlb.c index c487dde..ca72617 100644 --- a/tools/winedump/tlb.c +++ b/tools/winedump/tlb.c @@ -380,9 +380,9 @@ static int dump_msft_guidtab(seg_t *seg) return -1; } -static int dump_msft_res07(seg_t *seg) +static int dump_msft_namehashtab(seg_t *seg) { - print_begin_block("res07"); + print_begin_block("NameHashTab"); dump_binary(seg->length); /* FIXME */ @@ -661,7 +661,7 @@ seg_t segdir[] = { {"RefTab", dump_msft_reftabs, -1, -1}, {"LibTab", dump_msft_libtab, -1, -1}, {"GuidTab", dump_msft_guidtab, -1, -1}, - {"res07", dump_msft_res07, -1, -1}, + {"NameHashTab", dump_msft_namehashtab, -1, -1}, {"pNameTab", dump_msft_nametab, -1, -1}, {"pStringTab", dump_msft_stringtab, -1, -1}, {"TypedescTab", dump_msft_typedesctab, -1, -1},
1
0
0
0
Piotr Caban : oleaut32: Store typeinfo hreftype while saving typelib.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 00d132ee155f84e344193ce6f7e4401f2f041fc3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00d132ee155f84e344193ce6f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jul 28 10:05:39 2013 +0200 oleaut32: Store typeinfo hreftype while saving typelib. --- dlls/oleaut32/typelib.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index f566196..1041e1b 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -9409,10 +9409,14 @@ static DWORD WMSFT_compile_typeinfo(ITypeInfoImpl *info, INT16 index, WMSFT_TLBF else base->posguid = -1; base->flags = info->wTypeFlags; - if(info->Name) + if(info->Name) { base->NameOffset = info->Name->offset; - else + + ((unsigned char*)file->name_seg.data)[info->Name->offset+9] = 0x38; + *(HREFTYPE*)((unsigned char*)file->name_seg.data+info->Name->offset) = info->hreftype; + }else { base->NameOffset = -1; + } base->version = (info->wMinorVerNum << 16) | info->wMajorVerNum; if(info->DocString) base->docstringoffs = info->DocString->offset;
1
0
0
0
Piotr Caban : oleaut32: Name names hash table segment in MSFT_SegDir struct .
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: f9e73f97a90ce68af04b23fcee8ce44ee846d30d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9e73f97a90ce68af04b23fce…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jul 28 10:05:25 2013 +0200 oleaut32: Name names hash table segment in MSFT_SegDir struct. --- dlls/oleaut32/typelib.c | 4 ++-- dlls/oleaut32/typelib.h | 4 ++-- tools/widl/typelib_struct.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index d2423a2..f566196 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -9775,8 +9775,8 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface) TRACE("impfiles at: 0x%x\n", running_offset); tmp_fill_segdir_seg(&file.segdir.pImpFiles, &file.impfile_seg, &running_offset); - TRACE("res07 at: 0x%x\n", running_offset); - tmp_fill_segdir_seg(&file.segdir.res07, &file.namehash_seg, &running_offset); + TRACE("namehashtab at: 0x%x\n", running_offset); + tmp_fill_segdir_seg(&file.segdir.pNameHashTab, &file.namehash_seg, &running_offset); TRACE("nametab at: 0x%x\n", running_offset); tmp_fill_segdir_seg(&file.segdir.pNametab, &file.name_seg, &running_offset); diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h index 7277b58..f21acd5 100644 --- a/dlls/oleaut32/typelib.h +++ b/dlls/oleaut32/typelib.h @@ -104,8 +104,8 @@ typedef struct tagMSFT_SegDir { /* hash table w offsets to guid????? */ /*6*/MSFT_pSeg pGuidTab; /* all guids are stored here together with */ /* offset in some table???? */ -/*7*/MSFT_pSeg res07; /* always created, always same size (0x200) */ - /* purpose largely unknown */ +/*7*/MSFT_pSeg pNameHashTab; /* always created, always same size (0x200) */ + /* hash table with offsets to names */ /*8*/MSFT_pSeg pNametab; /* name tables */ /*9*/MSFT_pSeg pStringtab; /* string table */ /*A*/MSFT_pSeg pTypdescTab; /* table with type descriptors */ diff --git a/tools/widl/typelib_struct.h b/tools/widl/typelib_struct.h index 79b86b9..8a005d3 100644 --- a/tools/widl/typelib_struct.h +++ b/tools/widl/typelib_struct.h @@ -101,8 +101,8 @@ typedef struct tagMSFT_SegDir { /* hash table w offsets to guid????? */ /*6*/MSFT_pSeg pGuidTab; /* all guids are stored here together with */ /* offset in some table???? */ -/*7*/MSFT_pSeg res07; /* always created, always same size (0x200) */ - /* purpose largely unknown */ +/*7*/MSFT_pSeg pNameHashTab; /* always created, always same size (0x200) */ + /* hash table with offsets to names */ /*8*/MSFT_pSeg pNametab; /* name tables */ /*9*/MSFT_pSeg pStringtab; /* string table */ /*A*/MSFT_pSeg pTypdescTab; /* table with type descriptors */
1
0
0
0
Piotr Caban : oleaut32: Fill names hash table while creating typelib.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: aada2c7b6f1bd29783506c1cfb2684b651dcf255 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aada2c7b6f1bd29783506c1cf…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jul 28 10:05:09 2013 +0200 oleaut32: Fill names hash table while creating typelib. --- dlls/oleaut32/typelib.c | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 996886e..d2423a2 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -8620,7 +8620,7 @@ typedef struct tagWMSFT_TLBFile { WMSFT_SegContents ref_seg; WMSFT_SegContents lib_seg; WMSFT_SegContents guid_seg; - WMSFT_SegContents res07_seg; + WMSFT_SegContents namehash_seg; WMSFT_SegContents name_seg; WMSFT_SegContents string_seg; WMSFT_SegContents typdesc_seg; @@ -8725,7 +8725,7 @@ static HRESULT WMSFT_compile_names(ITypeLibImpl *This, last_offs = 0; LIST_FOR_EACH_ENTRY(str, &This->name_list, TLBString, entry) { - int size; + int size, hash; MSFT_NameIntro *intro = (MSFT_NameIntro*)data; size = WideCharToMultiByte(CP_ACP, 0, str->str, strlenW(str->str), @@ -8738,11 +8738,12 @@ static HRESULT WMSFT_compile_names(ITypeLibImpl *This, data[sizeof(MSFT_NameIntro) + size] = '\0'; intro->hreftype = -1; /* TODO? */ - intro->next_hash = -1; intro->namelen = size & 0xFF; /* TODO: namelen & 0xFF00 == ??? maybe HREF type indicator? */ - intro->namelen |= LHashValOfNameSysA(This->syskind, - This->lcid, data + sizeof(MSFT_NameIntro)) << 16; + hash = LHashValOfNameSysA(This->syskind, This->lcid, data + sizeof(MSFT_NameIntro)); + intro->namelen |= hash << 16; + intro->next_hash = ((DWORD*)file->namehash_seg.data)[hash & 0x7f]; + ((DWORD*)file->namehash_seg.data)[hash & 0x7f] = last_offs; memset(data + sizeof(MSFT_NameIntro) + size, 0x57, str->offset - size - sizeof(MSFT_NameIntro)); @@ -9587,17 +9588,11 @@ static void WMSFT_compile_lib(ITypeLibImpl *This, WMSFT_TLBFile *file) #endif } -static void WMSFT_compile_res07(ITypeLibImpl *This, WMSFT_TLBFile *file) +static void WMSFT_compile_namehash(ITypeLibImpl *This, WMSFT_TLBFile *file) { - /* TODO: What actually goes here? - * Wild speculation: - * It's something to do with the Name table (and string table?). When you - * add a new name, the offset to that name from within the Name table gets - * stuck somewhere in res07, apparently starting at the end of the segment - * then moving backwards at a rate of 3 bytes per char in the Name. */ - file->res07_seg.len = 0x200; - file->res07_seg.data = heap_alloc(file->res07_seg.len); - memset(file->res07_seg.data, 0xFF, file->res07_seg.len); + file->namehash_seg.len = 0x200; + file->namehash_seg.data = heap_alloc(file->namehash_seg.len); + memset(file->namehash_seg.data, 0xFF, file->namehash_seg.len); } static void tmp_fill_segdir_seg(MSFT_pSeg *segdir, WMSFT_SegContents *contents, DWORD *running_offset) @@ -9645,7 +9640,7 @@ static void WMSFT_free_file(WMSFT_TLBFile *file) HeapFree(GetProcessHeap(), 0, file->ref_seg.data); HeapFree(GetProcessHeap(), 0, file->impinfo_seg.data); HeapFree(GetProcessHeap(), 0, file->impfile_seg.data); - HeapFree(GetProcessHeap(), 0, file->res07_seg.data); + HeapFree(GetProcessHeap(), 0, file->namehash_seg.data); HeapFree(GetProcessHeap(), 0, file->name_seg.data); HeapFree(GetProcessHeap(), 0, file->string_seg.data); HeapFree(GetProcessHeap(), 0, file->typdesc_seg.data); @@ -9686,6 +9681,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface) file.header.res48 = 0x80; file.header.dispatchpos = This->dispatch_href; + WMSFT_compile_namehash(This, &file); /* do name and string compilation to get offsets for other compilations */ hres = WMSFT_compile_names(This, &file); if (FAILED(hres)){ @@ -9749,7 +9745,6 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface) WMSFT_compile_typeinfo_seg(This, &file, junk + junk_offs); WMSFT_compile_impinfo(This, &file); WMSFT_compile_lib(This, &file); - WMSFT_compile_res07(This, &file); running_offset = 0; @@ -9781,7 +9776,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface) tmp_fill_segdir_seg(&file.segdir.pImpFiles, &file.impfile_seg, &running_offset); TRACE("res07 at: 0x%x\n", running_offset); - tmp_fill_segdir_seg(&file.segdir.res07, &file.res07_seg, &running_offset); + tmp_fill_segdir_seg(&file.segdir.res07, &file.namehash_seg, &running_offset); TRACE("nametab at: 0x%x\n", running_offset); tmp_fill_segdir_seg(&file.segdir.pNametab, &file.name_seg, &running_offset); @@ -9848,7 +9843,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface) WMSFT_write_segment(outfile, &file.ref_seg); WMSFT_write_segment(outfile, &file.impinfo_seg); WMSFT_write_segment(outfile, &file.impfile_seg); - WMSFT_write_segment(outfile, &file.res07_seg); + WMSFT_write_segment(outfile, &file.namehash_seg); WMSFT_write_segment(outfile, &file.name_seg); WMSFT_write_segment(outfile, &file.string_seg); WMSFT_write_segment(outfile, &file.typdesc_seg);
1
0
0
0
Piotr Caban : msvcrt: Add _wcstol_l implementation.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 679542419abb285afc615b5286fbbd25082d5c64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=679542419abb285afc615b528…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sun Jul 28 09:43:59 2013 +0200 msvcrt: Add _wcstol_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/wcs.c | 18 ++++++++++++++++++ 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index c71f7fa..9d4cc80 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1505,7 +1505,7 @@ @ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l @ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 @ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ stub _wcstol_l +@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_l @ cdecl _wcstombs_l(ptr ptr long ptr) msvcrt._wcstombs_l @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) msvcrt._wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 40dd029..6e97edb 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1868,7 +1868,7 @@ @ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l @ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 @ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ stub _wcstol_l +@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_l @ cdecl _wcstombs_l(ptr ptr long ptr) msvcrt._wcstombs_l @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) msvcrt._wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 68530bf..8d91d66 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -1183,7 +1183,7 @@ @ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l @ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 @ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ stub _wcstol_l +@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_l @ cdecl _wcstombs_l(ptr ptr long ptr) msvcrt._wcstombs_l @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) msvcrt._wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 6a1657f..9469587 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -1159,7 +1159,7 @@ @ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l @ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 @ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ stub _wcstol_l +@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_l @ cdecl _wcstombs_l(ptr ptr long ptr) msvcrt._wcstombs_l @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) msvcrt._wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 6a812a9..975afe0 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1123,7 +1123,7 @@ @ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l @ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 @ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l -# stub _wcstol_l(wstr ptr long ptr) +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_l @ cdecl _wcstombs_l(ptr ptr long ptr) MSVCRT__wcstombs_l @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) MSVCRT__wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) MSVCRT__wcstoui64 diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index dbb12dd..3df7c02 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1613,6 +1613,24 @@ __int64 CDECL MSVCRT__wcstoi64(const MSVCRT_wchar_t *nptr, } /********************************************************************* + * _wcstol_l (MSVCRT.@) + */ +MSVCRT_long CDECL MSVCRT__wcstol_l(const MSVCRT_wchar_t *s, + MSVCRT_wchar_t **end, int base, MSVCRT__locale_t locale) +{ + __int64 ret = MSVCRT__wcstoi64_l(s, end, base, locale); + + if(ret > MSVCRT_LONG_MAX) { + ret = MSVCRT_LONG_MAX; + *MSVCRT__errno() = MSVCRT_ERANGE; + }else if(ret < MSVCRT_LONG_MIN) { + ret = MSVCRT_LONG_MIN; + *MSVCRT__errno() = MSVCRT_ERANGE; + } + return ret; +} + +/********************************************************************* * _wtoi_l (MSVCRT.@) */ int __cdecl MSVCRT__wtoi_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale)
1
0
0
0
Nikolay Sivov : msxml3: Support for external entities in writer.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 5dc468f025b46a59fc24ea4d94e7f0d6ee5d7565 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5dc468f025b46a59fc24ea4d9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jul 27 20:37:46 2013 +0400 msxml3: Support for external entities in writer. --- dlls/msxml3/mxwriter.c | 35 ++++++++++++++++++++++++++++++++--- dlls/msxml3/tests/saxreader.c | 22 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 558582d..3196374 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -44,6 +44,7 @@ static const WCHAR spaceW[] = {' '}; static const WCHAR quotW[] = {'\"'}; static const WCHAR closetagW[] = {'>','\r','\n'}; static const WCHAR crlfW[] = {'\r','\n'}; +static const WCHAR entityW[] = {'<','!','E','N','T','I','T','Y',' '}; /* should be ordered as encoding names are sorted */ typedef enum @@ -1576,7 +1577,6 @@ static HRESULT WINAPI SAXDeclHandler_internalEntityDecl(ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *value, int n_value) { mxwriter *This = impl_from_ISAXDeclHandler( iface ); - static const WCHAR entityW[] = {'<','!','E','N','T','I','T','Y',' '}; TRACE("(%p)->(%s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name, debugstr_wn(value, n_value), n_value); @@ -1601,10 +1601,39 @@ static HRESULT WINAPI SAXDeclHandler_externalEntityDecl(ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *publicId, int n_publicId, const WCHAR *systemId, int n_systemId) { + static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; + static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; mxwriter *This = impl_from_ISAXDeclHandler( iface ); - FIXME("(%p)->(%s:%d %s:%d %s:%d): stub\n", This, debugstr_wn(name, n_name), n_name, + + TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name, debugstr_wn(publicId, n_publicId), n_publicId, debugstr_wn(systemId, n_systemId), n_systemId); - return E_NOTIMPL; + + if (!name) return E_INVALIDARG; + if (publicId && !systemId) return E_INVALIDARG; + if (!publicId && !systemId) return E_INVALIDARG; + + write_output_buffer(This->buffer, entityW, sizeof(entityW)/sizeof(WCHAR)); + if (n_name) { + write_output_buffer(This->buffer, name, n_name); + write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + } + + if (publicId) + { + write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This->buffer, publicId, n_publicId); + write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer_quoted(This->buffer, systemId, n_systemId); + } + else + { + write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This->buffer, systemId, n_systemId); + } + + write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + + return S_OK; } static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl = { diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 1eff7f6..5c7d080 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -4739,6 +4739,28 @@ static void test_mxwriter_dtd(void) ok(!lstrcmpW(_bstr_("<!ENTITY name \"value\">\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); + /* external entities */ + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_put_output(writer, dest); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, NULL, 0, NULL, 0, NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), -1, NULL, 0, NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), + _bstr_("sysid"), strlen("sysid")); + ok(hr == S_OK, "got 0x%08x\n", hr); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<!ENTITY name PUBLIC \"pubid\" \"sysid\">\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + ISAXContentHandler_Release(content); ISAXLexicalHandler_Release(lexical); ISAXDeclHandler_Release(decl);
1
0
0
0
Nikolay Sivov : msxml3: Implement output indentation for writer.
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: b3d85d41d99fbe9518db35761c7e7560d6cdd61b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b3d85d41d99fbe9518db35761…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Jul 27 18:27:27 2013 +0400 msxml3: Implement output indentation for writer. --- dlls/msxml3/mxwriter.c | 62 +++++++++++++++++++++++++++++++++++++++-- dlls/msxml3/tests/saxreader.c | 62 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+), 5 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index d62e6a3..558582d 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -1,7 +1,7 @@ /* * MXWriter implementation * - * Copyright 2011-2012 Nikolay Sivov for CodeWeavers + * Copyright 2011-2013 Nikolay Sivov for CodeWeavers * Copyright 2011 Thomas Mullaly * * This library is free software; you can redistribute it and/or @@ -43,6 +43,7 @@ static const WCHAR emptyW[] = {0}; static const WCHAR spaceW[] = {' '}; static const WCHAR quotW[] = {'\"'}; static const WCHAR closetagW[] = {'>','\r','\n'}; +static const WCHAR crlfW[] = {'\r','\n'}; /* should be ordered as encoding names are sorted */ typedef enum @@ -146,6 +147,10 @@ typedef struct BOOL prop_changed; BOOL cdata; + BOOL text; /* last node was text node, so we shouldn't indent next node */ + BOOL newline; /* newline was already added as a part of previous call */ + UINT indent; /* indentation level for next node */ + BSTR version; BSTR encoding; /* exact property value */ @@ -454,14 +459,13 @@ static WCHAR *get_escaped_string(const WCHAR *str, escape_mode mode, int *len) return ret; } -static void write_prolog_buffer(const mxwriter *This) +static void write_prolog_buffer(mxwriter *This) { static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','='}; static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','=','\"'}; static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'}; static const WCHAR yesW[] = {'y','e','s','\"','?','>'}; static const WCHAR noW[] = {'n','o','\"','?','>'}; - static const WCHAR crlfW[] = {'\r','\n'}; /* version */ write_output_buffer(This->buffer, versionW, sizeof(versionW)/sizeof(WCHAR)); @@ -483,6 +487,7 @@ static void write_prolog_buffer(const mxwriter *This) write_output_buffer(This->buffer, noW, sizeof(noW)/sizeof(WCHAR)); write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + This->newline = TRUE; } /* Attempts to the write data from the mxwriter's buffer to @@ -536,6 +541,41 @@ static void close_element_starttag(const mxwriter *This) write_output_buffer(This->buffer, gtW, 1); } +static void write_node_indent(mxwriter *This) +{ + static const WCHAR tabW[] = {'\t'}; + int indent = This->indent; + + if (!This->props[MXWriter_Indent] || This->text) + { + This->text = FALSE; + return; + } + + /* This is to workaround PI output logic that always puts newline chars, + document prolog PI does that too. */ + if (!This->newline) + write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + while (indent--) + write_output_buffer(This->buffer, tabW, 1); + + This->newline = FALSE; + This->text = FALSE; +} + +static inline void writer_inc_indent(mxwriter *This) +{ + This->indent++; +} + +static inline void writer_dec_indent(mxwriter *This) +{ + if (This->indent) This->indent--; + /* depth is decreased only when element is closed, meaning it's not a text node + at this point */ + This->text = FALSE; +} + static void set_element_name(mxwriter *This, const WCHAR *name, int len) { SysFreeString(This->element); @@ -1082,8 +1122,11 @@ static HRESULT WINAPI SAXContentHandler_startElement( set_element_name(This, QName ? QName : emptyW, QName ? nQName : 0); + write_node_indent(This); + write_output_buffer(This->buffer, ltW, 1); write_output_buffer(This->buffer, QName, nQName); + writer_inc_indent(This); if (attr) { @@ -1147,6 +1190,8 @@ static HRESULT WINAPI SAXContentHandler_endElement( (nQName == -1 && This->class_version == MSXML6)) return E_INVALIDARG; + writer_dec_indent(This); + if (This->element) { static const WCHAR closeW[] = {'/','>'}; @@ -1157,6 +1202,7 @@ static HRESULT WINAPI SAXContentHandler_endElement( static const WCHAR closetagW[] = {'<','/'}; static const WCHAR gtW[] = {'>'}; + write_node_indent(This); write_output_buffer(This->buffer, closetagW, 2); write_output_buffer(This->buffer, QName, nQName); write_output_buffer(This->buffer, gtW, 1); @@ -1181,6 +1227,9 @@ static HRESULT WINAPI SAXContentHandler_characters( close_element_starttag(This); set_element_name(This, NULL, 0); + if (!This->cdata) + This->text = TRUE; + if (nchars) { if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE) @@ -1230,6 +1279,7 @@ static HRESULT WINAPI SAXContentHandler_processingInstruction( if (!target) return E_INVALIDARG; + write_node_indent(This); write_output_buffer(This->buffer, openpiW, sizeof(openpiW)/sizeof(WCHAR)); if (*target) @@ -1242,6 +1292,7 @@ static HRESULT WINAPI SAXContentHandler_processingInstruction( } write_output_buffer(This->buffer, closepiW, sizeof(closepiW)/sizeof(WCHAR)); + This->newline = TRUE; return S_OK; } @@ -1381,6 +1432,7 @@ static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface) TRACE("(%p)\n", This); + write_node_indent(This); write_output_buffer(This->buffer, scdataW, sizeof(scdataW)/sizeof(WCHAR)); This->cdata = TRUE; @@ -1411,6 +1463,7 @@ static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const if (!chars) return E_INVALIDARG; close_element_starttag(This); + write_node_indent(This); write_output_buffer(This->buffer, copenW, sizeof(copenW)/sizeof(WCHAR)); if (nchars) @@ -1609,6 +1662,9 @@ HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *outer, void **ppObj) This->element = NULL; This->cdata = FALSE; + This->indent = 0; + This->text = FALSE; + This->newline = FALSE; This->dest = NULL; This->dest_written = 0; diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index dec62bb..1eff7f6 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -35,6 +35,8 @@ #include "wine/test.h" +static const WCHAR emptyW[] = {0}; + #define EXPECT_HR(hr,hr_exp) \ ok(hr == hr_exp, "got 0x%08x, expected 0x%08x\n", hr, hr_exp) @@ -2890,7 +2892,6 @@ static void test_mxwriter_default_properties(const struct mxwriter_props_t *tabl static void test_mxwriter_properties(void) { static const WCHAR utf16W[] = {'U','T','F','-','1','6',0}; - static const WCHAR emptyW[] = {0}; static const WCHAR testW[] = {'t','e','s','t',0}; ISAXContentHandler *content; IMXWriter *writer; @@ -3041,7 +3042,6 @@ static void test_mxwriter_properties(void) static void test_mxwriter_flush(void) { - static const WCHAR emptyW[] = {0}; ISAXContentHandler *content; IMXWriter *writer; LARGE_INTEGER pos; @@ -5245,6 +5245,63 @@ static void test_mxattr_localname(void) } } +static void test_mxwriter_indent(void) +{ + ISAXContentHandler *content; + IMXWriter *writer; + VARIANT dest; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, &IID_IMXWriter, (void**)&writer); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IMXWriter_put_indent(writer, VARIANT_TRUE); + ok(hr == S_OK, "got %08x\n", hr); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_startDocument(content); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_startElement(content, emptyW, 0, emptyW, 0, _bstr_("a"), -1, NULL); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_characters(content, _bstr_(""), 0); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_startElement(content, emptyW, 0, emptyW, 0, _bstr_("b"), -1, NULL); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_startElement(content, emptyW, 0, emptyW, 0, _bstr_("c"), -1, NULL); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_endElement(content, emptyW, 0, emptyW, 0, _bstr_("c"), -1); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_endElement(content, emptyW, 0, emptyW, 0, _bstr_("b"), -1); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_endElement(content, emptyW, 0, emptyW, 0, _bstr_("a"), -1); + ok(hr == S_OK, "got %08x\n", hr); + + hr = ISAXContentHandler_endDocument(content); + ok(hr == S_OK, "got %08x\n", hr); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + ok(hr == S_OK, "got %08x\n", hr); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n<a><b>\r\n\t\t<c/>\r\n\t</b>\r\n</a>"), V_BSTR(&dest)), + "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + ISAXContentHandler_Release(content); + IMXWriter_Release(writer); + + free_bstrs(); +} + START_TEST(saxreader) { ISAXXMLReader *reader; @@ -5292,6 +5349,7 @@ START_TEST(saxreader) test_mxwriter_stream(); test_mxwriter_encoding(); test_mxwriter_dispex(); + test_mxwriter_indent(); } else win_skip("MXXMLWriter not supported\n");
1
0
0
0
Bruno Jesus : kernel32/tests: Add tests for GetVolumePathNameA().
by Alexandre Julliard
29 Jul '13
29 Jul '13
Module: wine Branch: master Commit: 95d01f1751d893de7a8c681f724c972e11e69ec7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=95d01f1751d893de7a8c681f7…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Sun Jul 28 15:01:32 2013 -0300 kernel32/tests: Add tests for GetVolumePathNameA(). --- dlls/kernel32/tests/volume.c | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index f7879c8..e63a2ef 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -53,6 +53,7 @@ static BOOL (WINAPI *pFindVolumeClose)(HANDLE); static UINT (WINAPI *pGetLogicalDriveStringsA)(UINT,LPSTR); static UINT (WINAPI *pGetLogicalDriveStringsW)(UINT,LPWSTR); static BOOL (WINAPI *pGetVolumeInformationA)(LPCSTR, LPSTR, DWORD, LPDWORD, LPDWORD, LPDWORD, LPSTR, DWORD); +static BOOL (WINAPI *pGetVolumePathNameA)(LPCSTR, LPSTR, DWORD); static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameA)(LPCSTR, LPSTR, DWORD, LPDWORD); static BOOL (WINAPI *pGetVolumePathNamesForVolumeNameW)(LPCWSTR, LPWSTR, DWORD, LPDWORD); @@ -588,6 +589,83 @@ static void test_disk_extents(void) CloseHandle( handle ); } +static void test_GetVolumePathNameA(void) +{ + BOOL ret; + char volume[MAX_PATH]; + char expected[] = "C:\\", pathC1[] = "C:\\", pathC2[] = "C::"; + DWORD error; + + if (!pGetVolumePathNameA) + { + win_skip("required functions not found\n"); + return; + } + + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA(NULL, NULL, 0); + error = GetLastError(); + ok(!ret, "expected failure\n"); +todo_wine + ok(error == ERROR_INVALID_PARAMETER + || broken( error == 0xdeadbeef) /* <=XP */, + "expected ERROR_INVALID_PARAMETER got %u\n", error); + + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA("", NULL, 0); + error = GetLastError(); + ok(!ret, "expected failure\n"); +todo_wine + ok(error == ERROR_INVALID_PARAMETER + || broken( error == 0xdeadbeef) /* <=XP */, + "expected ERROR_INVALID_PARAMETER got %u\n", error); + + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA(pathC1, NULL, 0); + error = GetLastError(); + ok(!ret, "expected failure\n"); +todo_wine + ok(error == ERROR_INVALID_PARAMETER + || broken(error == ERROR_FILENAME_EXCED_RANGE) /* <=XP */, + "expected ERROR_INVALID_PARAMETER got %u\n", error); + + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA(pathC1, volume, 0); + error = GetLastError(); + ok(!ret, "expected failure\n"); +todo_wine + ok(error == ERROR_INVALID_PARAMETER + || broken(error == ERROR_FILENAME_EXCED_RANGE ) /* <=XP */, + "expected ERROR_INVALID_PARAMETER got %u\n", error); + + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA(pathC1, volume, 1); + error = GetLastError(); + ok(!ret, "expected failure\n"); +todo_wine + ok(error == ERROR_FILENAME_EXCED_RANGE, "expected ERROR_FILENAME_EXCED_RANGE got %u\n", error); + + volume[0] = '\0'; + ret = pGetVolumePathNameA(pathC1, volume, sizeof(volume)); + ok(ret, "expected success\n"); + ok(!strcmp(expected, volume), "expected name '%s', returned '%s'\n", pathC1, volume); + + pathC1[0] = tolower(pathC1[0]); + volume[0] = '\0'; + ret = pGetVolumePathNameA(pathC1, volume, sizeof(volume)); + ok(ret, "expected success\n"); +todo_wine + ok(!strcmp(expected, volume) || broken(!strcasecmp(expected, volume)) /* <=XP */, + "expected name '%s', returned '%s'\n", expected, volume); + + volume[0] = '\0'; + ret = pGetVolumePathNameA(pathC2, volume, sizeof(volume)); +todo_wine + ok(ret, "expected success\n"); +todo_wine + ok(!strcmp(expected, volume), "expected name '%s', returned '%s'\n", expected, volume); +} + static void test_GetVolumePathNamesForVolumeNameA(void) { BOOL ret; @@ -926,12 +1004,14 @@ START_TEST(volume) pGetLogicalDriveStringsA = (void *) GetProcAddress(hdll, "GetLogicalDriveStringsA"); pGetLogicalDriveStringsW = (void *) GetProcAddress(hdll, "GetLogicalDriveStringsW"); pGetVolumeInformationA = (void *) GetProcAddress(hdll, "GetVolumeInformationA"); + pGetVolumePathNameA = (void *) GetProcAddress(hdll, "GetVolumePathNameA"); pGetVolumePathNamesForVolumeNameA = (void *) GetProcAddress(hdll, "GetVolumePathNamesForVolumeNameA"); pGetVolumePathNamesForVolumeNameW = (void *) GetProcAddress(hdll, "GetVolumePathNamesForVolumeNameW"); test_query_dos_deviceA(); test_define_dos_deviceA(); test_FindFirstVolume(); + test_GetVolumePathNameA(); test_GetVolumeNameForVolumeMountPointA(); test_GetVolumeNameForVolumeMountPointW(); test_GetLogicalDriveStringsA();
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
45
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
Results per page:
10
25
50
100
200