ReactOS.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
2024
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
List overview
Download
Ros-diffs
March 2016
----- 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
ros-diffs@reactos.org
13 participants
263 discussions
Start a n
N
ew thread
[akhaldi] 70876: [MCIQTZ32] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:38:34 2016 New Revision: 70876 URL:
http://svn.reactos.org/svn/reactos?rev=70876&view=rev
Log: [MCIQTZ32] Sync with Wine Staging 1.9.4. CORE-10912 Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mciqtz32/mciqtz.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mciqtz32/mciqtz.…
============================================================================== --- trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mciqtz32/mciqtz.c [iso-8859-1] Thu Mar 3 13:38:34 2016 @@ -165,6 +165,7 @@ CloseHandle(wma->task.notify); CloseHandle(wma->task.done); CloseHandle(wma->task.thread); + wma->cs.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&wma->cs); mciSetDriverData(dwDevID, 0); CloseHandle(wma->stop_event); @@ -939,6 +940,53 @@ return 0; } +/*************************************************************************** + * MCIQTZ_mciPut [internal] + */ +static DWORD MCIQTZ_mciPut(UINT wDevID, DWORD dwFlags, MCI_GENERIC_PARMS *lpParms) +{ + WINE_MCIQTZ *wma = MCIQTZ_mciGetOpenDev(wDevID); + MCI_DGV_RECT_PARMS *rectparms; + HRESULT hr; + + TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); + + if (!wma) + return MCIERR_INVALID_DEVICE_ID; + + if (!(dwFlags & MCI_DGV_RECT)) { + FIXME("No support for non-RECT MCI_PUT\n"); + return 1; + } + + if (dwFlags & MCI_TEST) + return 0; + + dwFlags &= ~MCI_DGV_RECT; + rectparms = (MCI_DGV_RECT_PARMS*)lpParms; + + if (dwFlags & MCI_DGV_PUT_DESTINATION) { + hr = IVideoWindow_SetWindowPosition(wma->vidwin, + rectparms->rc.left, rectparms->rc.top, + rectparms->rc.right - rectparms->rc.left, + rectparms->rc.bottom - rectparms->rc.top); + if(FAILED(hr)) + WARN("IVideoWindow_SetWindowPosition failed: 0x%x\n", hr); + + dwFlags &= ~MCI_DGV_PUT_DESTINATION; + } + + if (dwFlags & MCI_NOTIFY) { + MCIQTZ_mciNotify(lpParms->dwCallback, wma, MCI_NOTIFY_SUCCESSFUL); + dwFlags &= ~MCI_NOTIFY; + } + + if (dwFlags) + FIXME("No support for some flags: 0x%x\n", dwFlags); + + return 0; +} + /****************************************************************************** * MCIAVI_mciUpdate [internal] */ @@ -1102,6 +1150,9 @@ case MCI_WINDOW: task->res = MCIQTZ_mciWindow(task->devid, task->flags, (LPMCI_DGV_WINDOW_PARMSW)task->parms); break; + case MCI_PUT: + task->res = MCIQTZ_mciPut(task->devid, task->flags, (MCI_GENERIC_PARMS*)task->parms); + break; case MCI_CLOSE: /* Special internal message */ SetEvent(task->done); @@ -1166,9 +1217,9 @@ case MCI_SETAUDIO: case MCI_UPDATE: case MCI_WINDOW: + case MCI_PUT: if (!dwParam2) return MCIERR_NULL_PARAMETER_BLOCK; return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2); - case MCI_PUT: case MCI_RECORD: case MCI_RESUME: case MCI_INFO: Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 3 13:38:34 2016 @@ -94,7 +94,7 @@ reactos/dll/win32/mapi32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mciavi32 # Synced to WineStaging-1.7.55 reactos/dll/win32/mcicda # Synced to WineStaging-1.7.55 -reactos/dll/win32/mciqtz32 # Synced to WineStaging-1.7.55 +reactos/dll/win32/mciqtz32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mciseq # Synced to WineStaging-1.7.55 reactos/dll/win32/mciwave # Synced to WineStaging-1.7.55 reactos/dll/win32/mgmtapi # Synced to WineStaging-1.7.55
8 years, 8 months
1
0
0
0
[akhaldi] 70873: [PSDK] Update d3d11shader.h. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:25:26 2016 New Revision: 70873 URL:
http://svn.reactos.org/svn/reactos?rev=70873&view=rev
Log: [PSDK] Update d3d11shader.h. CORE-10912 Modified: trunk/reactos/include/psdk/d3d11shader.h Modified: trunk/reactos/include/psdk/d3d11shader.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/d3d11shader.h…
============================================================================== --- trunk/reactos/include/psdk/d3d11shader.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/d3d11shader.h [iso-8859-1] Thu Mar 3 13:25:26 2016 @@ -35,7 +35,7 @@ typedef struct _D3D11_SHADER_DESC { UINT Version; - LPCSTR Creator; + const char *Creator; UINT Flags; UINT ConstantBuffers; UINT BoundResources; @@ -76,11 +76,11 @@ typedef struct _D3D11_SHADER_VARIABLE_DESC { - LPCSTR Name; + const char *Name; UINT StartOffset; UINT Size; UINT uFlags; - LPVOID DefaultValue; + void *DefaultValue; UINT StartTexture; UINT TextureSize; UINT StartSampler; @@ -96,12 +96,12 @@ UINT Elements; UINT Members; UINT Offset; - LPCSTR Name; + const char *Name; } D3D11_SHADER_TYPE_DESC; typedef struct _D3D11_SHADER_BUFFER_DESC { - LPCSTR Name; + const char *Name; D3D_CBUFFER_TYPE Type; UINT Variables; UINT Size; @@ -110,7 +110,7 @@ typedef struct _D3D11_SHADER_INPUT_BIND_DESC { - LPCSTR Name; + const char *Name; D3D_SHADER_INPUT_TYPE Type; UINT BindPoint; UINT BindCount; @@ -122,7 +122,7 @@ typedef struct _D3D11_SIGNATURE_PARAMETER_DESC { - LPCSTR SemanticName; + const char *SemanticName; UINT SemanticIndex; UINT Register; D3D_NAME SystemValueType; @@ -139,8 +139,8 @@ { STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_TYPE_DESC *desc) PURE; STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE; - STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT index) PURE; + STDMETHOD_(struct ID3D11ShaderReflectionType *, GetMemberTypeByName)(THIS_ const char *name) PURE; + STDMETHOD_(const char *, GetMemberTypeName)(THIS_ UINT index) PURE; STDMETHOD(IsEqual)(THIS_ struct ID3D11ShaderReflectionType *type) PURE; STDMETHOD_(struct ID3D11ShaderReflectionType *, GetSubType)(THIS) PURE; STDMETHOD_(struct ID3D11ShaderReflectionType *, GetBaseClass)(THIS) PURE; @@ -170,7 +170,7 @@ { STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_BUFFER_DESC *desc) PURE; STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE; }; #undef INTERFACE @@ -180,19 +180,19 @@ DECLARE_INTERFACE_(ID3D11ShaderReflection, IUnknown) { /* IUnknown methods */ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /* ID3D11ShaderReflection methods */ STDMETHOD(GetDesc)(THIS_ D3D11_SHADER_DESC *desc) PURE; STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE; - STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(struct ID3D11ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ const char *name) PURE; STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE; STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE; STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE; STDMETHOD(GetPatchConstantParameterDesc)(THIS_ UINT index, D3D11_SIGNATURE_PARAMETER_DESC *desc) PURE; - STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE; - STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR name, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE; + STDMETHOD_(struct ID3D11ShaderReflectionVariable *, GetVariableByName)(THIS_ const char *name) PURE; + STDMETHOD(GetResourceBindingDescByName)(THIS_ const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) PURE; STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE; STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE; STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE;
8 years, 8 months
1
0
0
0
[akhaldi] 70874: [MAPI32] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:36:26 2016 New Revision: 70874 URL:
http://svn.reactos.org/svn/reactos?rev=70874&view=rev
Log: [MAPI32] Sync with Wine Staging 1.9.4. CORE-10912 Modified: trunk/reactos/dll/win32/mapi32/imalloc.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/mapi32/imalloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/imalloc.c…
============================================================================== --- trunk/reactos/dll/win32/mapi32/imalloc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/imalloc.c [iso-8859-1] Thu Mar 3 13:36:26 2016 @@ -98,7 +98,7 @@ */ static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, SIZE_T cb) { - TRACE("(%p)->(%d)\n", iface, cb); + TRACE("(%p)->(%ld)\n", iface, cb); return LocalAlloc(LMEM_FIXED, cb); } @@ -108,7 +108,7 @@ */ static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, SIZE_T cb) { - TRACE("(%p)->(%p, %d)\n", iface, pv, cb); + TRACE("(%p)->(%p, %ld)\n", iface, pv, cb); if (!pv) return LocalAlloc(LMEM_FIXED, cb); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 3 13:36:26 2016 @@ -91,7 +91,7 @@ reactos/dll/win32/localspl # Synced to WineStaging-1.7.55 reactos/dll/win32/localui # Synced to WineStaging-1.7.55 reactos/dll/win32/lz32 # Synced to WineStaging-1.7.55 -reactos/dll/win32/mapi32 # Synced to WineStaging-1.7.55 +reactos/dll/win32/mapi32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mciavi32 # Synced to WineStaging-1.7.55 reactos/dll/win32/mcicda # Synced to WineStaging-1.7.55 reactos/dll/win32/mciqtz32 # Synced to WineStaging-1.7.55
8 years, 8 months
1
0
0
0
[akhaldi] 70875: [IMAGEHLP_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:37:13 2016 New Revision: 70875 URL:
http://svn.reactos.org/svn/reactos?rev=70875&view=rev
Log: [IMAGEHLP_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912 Modified: trunk/rostests/winetests/imagehlp/image.c Modified: trunk/rostests/winetests/imagehlp/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/imagehlp/image.…
============================================================================== --- trunk/rostests/winetests/imagehlp/image.c [iso-8859-1] (original) +++ trunk/rostests/winetests/imagehlp/image.c [iso-8859-1] Thu Mar 3 13:37:13 2016 @@ -190,10 +190,7 @@ { DWORD i; - if (expected->todo) - todo_wine ok(expected->cUpdates == got->cUpdates, "%s: expected %d updates, got %d\n", - header, expected->cUpdates, got->cUpdates); - else + todo_wine_if (expected->todo) ok(expected->cUpdates == got->cUpdates, "%s: expected %d updates, got %d\n", header, expected->cUpdates, got->cUpdates); for (i = 0; i < min(expected->cUpdates, got->cUpdates); i++)
8 years, 8 months
1
0
0
0
[akhaldi] 70871: [JSCRIPT] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:24:43 2016 New Revision: 70871 URL:
http://svn.reactos.org/svn/reactos?rev=70871&view=rev
Log: [JSCRIPT] Sync with Wine Staging 1.9.4. CORE-10912 Added: trunk/reactos/dll/win32/jscript/json.c (with props) Modified: trunk/reactos/dll/win32/jscript/CMakeLists.txt trunk/reactos/dll/win32/jscript/array.c trunk/reactos/dll/win32/jscript/bool.c trunk/reactos/dll/win32/jscript/function.c trunk/reactos/dll/win32/jscript/global.c trunk/reactos/dll/win32/jscript/jscript.h trunk/reactos/dll/win32/jscript/jsutils.c trunk/reactos/dll/win32/jscript/lex.c trunk/reactos/dll/win32/jscript/number.c trunk/reactos/dll/win32/jscript/object.c trunk/reactos/dll/win32/jscript/parser.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/jscript/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/jscript/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/CMakeLists.txt [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -21,6 +21,7 @@ global.c jscript.c jscript_main.c + json.c jsregexp.c jsstr.c jsutils.c Modified: trunk/reactos/dll/win32/jscript/array.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/array.c?…
============================================================================== --- trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/array.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -55,6 +55,12 @@ return is_vclass(jsthis, JSCLASS_ARRAY) ? array_from_vdisp(jsthis) : NULL; } +unsigned array_get_length(jsdisp_t *array) +{ + assert(is_class(array, JSCLASS_ARRAY)); + return array_from_jsdisp(array)->length; +} + static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret) { ArrayInstance *array; Modified: trunk/reactos/dll/win32/jscript/bool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/bool.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/bool.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -33,6 +33,12 @@ return is_vclass(jsthis, JSCLASS_BOOLEAN) ? (BoolInstance*)jsthis->u.jsdisp : NULL; } +BOOL bool_obj_value(jsdisp_t *obj) +{ + assert(is_class(obj, JSCLASS_BOOLEAN)); + return ((BoolInstance*)obj)->val; +} + /* ECMA-262 3rd Edition 15.6.4.2 */ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { Modified: trunk/reactos/dll/win32/jscript/function.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/function…
============================================================================== --- trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/function.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -814,6 +814,7 @@ TRACE("\n"); switch(flags) { + case DISPATCH_METHOD: case DISPATCH_CONSTRUCT: { IDispatch *ret; Modified: trunk/reactos/dll/win32/jscript/global.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/global.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/global.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -57,6 +57,7 @@ {'S','c','r','i','p','t','E','n','g','i','n','e','B','u','i','l','d','V','e','r','s','i','o','n',0}; static const WCHAR CollectGarbageW[] = {'C','o','l','l','e','c','t','G','a','r','b','a','g','e',0}; static const WCHAR MathW[] = {'M','a','t','h',0}; +static const WCHAR JSONW[] = {'J','S','O','N',0}; static const WCHAR encodeURIW[] = {'e','n','c','o','d','e','U','R','I',0}; static const WCHAR decodeURIW[] = {'d','e','c','o','d','e','U','R','I',0}; static const WCHAR encodeURIComponentW[] = {'e','n','c','o','d','e','U','R','I','C','o','m','p','o','n','e','n','t',0}; @@ -254,8 +255,7 @@ if(FAILED(hres)) return hres; - if(!isinf(n) && !isnan(n)) - ret = TRUE; + ret = is_finite(n); } if(r) @@ -1098,6 +1098,19 @@ if(FAILED(hres)) return hres; + if(ctx->version >= 2) { + jsdisp_t *json; + + hres = create_json(ctx, &json); + if(FAILED(hres)) + return hres; + + hres = jsdisp_propput_dontenum(ctx->global, JSONW, jsval_obj(json)); + jsdisp_release(json); + if(FAILED(hres)) + return hres; + } + hres = create_activex_constr(ctx, &constr); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/jscript.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jscript.…
============================================================================== --- trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jscript.h [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -131,7 +131,8 @@ JSCLASS_REGEXP, JSCLASS_STRING, JSCLASS_ARGUMENTS, - JSCLASS_VBARRAY + JSCLASS_VBARRAY, + JSCLASS_JSON } jsclass_t; jsdisp_t *iface_to_jsdisp(IUnknown*) DECLSPEC_HIDDEN; @@ -331,6 +332,7 @@ HRESULT create_bool(script_ctx_t*,BOOL,jsdisp_t**) DECLSPEC_HIDDEN; HRESULT create_number(script_ctx_t*,double,jsdisp_t**) DECLSPEC_HIDDEN; HRESULT create_vbarray(script_ctx_t*,SAFEARRAY*,jsdisp_t**) DECLSPEC_HIDDEN; +HRESULT create_json(script_ctx_t*,jsdisp_t**) DECLSPEC_HIDDEN; typedef enum { NO_HINT, @@ -353,6 +355,7 @@ HRESULT decode_source(WCHAR*) DECLSPEC_HIDDEN; HRESULT double_to_string(double,jsstr_t**) DECLSPEC_HIDDEN; +BOOL is_finite(double) DECLSPEC_HIDDEN; typedef struct named_item_t { IDispatch *disp; @@ -471,6 +474,9 @@ HRESULT regexp_match_next(script_ctx_t*,jsdisp_t*,DWORD,jsstr_t*,struct match_state_t**) DECLSPEC_HIDDEN; HRESULT parse_regexp_flags(const WCHAR*,DWORD,DWORD*) DECLSPEC_HIDDEN; HRESULT regexp_string_match(script_ctx_t*,jsdisp_t*,jsstr_t*,jsval_t*) DECLSPEC_HIDDEN; + +BOOL bool_obj_value(jsdisp_t*) DECLSPEC_HIDDEN; +unsigned array_get_length(jsdisp_t*) DECLSPEC_HIDDEN; static inline BOOL is_class(jsdisp_t *jsdisp, jsclass_t class) { Added: trunk/reactos/dll/win32/jscript/json.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/json.c?r…
============================================================================== --- trunk/reactos/dll/win32/jscript/json.c (added) +++ trunk/reactos/dll/win32/jscript/json.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -0,0 +1,844 @@ +/* + * Copyright 2016 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "jscript.h" + +static const WCHAR parseW[] = {'p','a','r','s','e',0}; +static const WCHAR stringifyW[] = {'s','t','r','i','n','g','i','f','y',0}; + +static const WCHAR nullW[] = {'n','u','l','l',0}; +static const WCHAR trueW[] = {'t','r','u','e',0}; +static const WCHAR falseW[] = {'f','a','l','s','e',0}; + +static const WCHAR toJSONW[] = {'t','o','J','S','O','N',0}; + +typedef struct { + const WCHAR *ptr; + const WCHAR *end; + script_ctx_t *ctx; +} json_parse_ctx_t; + +static BOOL is_json_space(WCHAR c) +{ + return c == ' ' || c == '\t' || c == '\n' || c == '\r'; +} + +static WCHAR skip_spaces(json_parse_ctx_t *ctx) +{ + while(is_json_space(*ctx->ptr)) + ctx->ptr++; + return *ctx->ptr; +} + +static BOOL is_keyword(json_parse_ctx_t *ctx, const WCHAR *keyword) +{ + unsigned i; + for(i=0; keyword[i]; i++) { + if(!ctx->ptr[i] || keyword[i] != ctx->ptr[i]) + return FALSE; + } + if(is_identifier_char(ctx->ptr[i])) + return FALSE; + ctx->ptr += i; + return TRUE; +} + +/* ECMA-262 5.1 Edition 15.12.1.1 */ +static HRESULT parse_json_string(json_parse_ctx_t *ctx, WCHAR **r) +{ + const WCHAR *ptr = ++ctx->ptr; + size_t len; + WCHAR *buf; + + while(*ctx->ptr && *ctx->ptr != '"') { + if(*ctx->ptr++ == '\\') + ctx->ptr++; + } + if(!*ctx->ptr) { + FIXME("unterminated string\n"); + return E_FAIL; + } + + len = ctx->ptr-ptr; + buf = heap_alloc((len+1)*sizeof(WCHAR)); + if(!buf) + return E_OUTOFMEMORY; + if(len) + memcpy(buf, ptr, len*sizeof(WCHAR)); + buf[len] = 0; + + if(!unescape(buf)) { + FIXME("unescape failed\n"); + heap_free(buf); + return E_FAIL; + } + + ctx->ptr++; + *r = buf; + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.1.2 */ +static HRESULT parse_json_value(json_parse_ctx_t *ctx, jsval_t *r) +{ + HRESULT hres; + + switch(skip_spaces(ctx)) { + + /* JSONNullLiteral */ + case 'n': + if(!is_keyword(ctx, nullW)) + break; + *r = jsval_null(); + return S_OK; + + /* JSONBooleanLiteral */ + case 't': + if(!is_keyword(ctx, trueW)) + break; + *r = jsval_bool(TRUE); + return S_OK; + case 'f': + if(!is_keyword(ctx, falseW)) + break; + *r = jsval_bool(FALSE); + return S_OK; + + /* JSONObject */ + case '{': { + WCHAR *prop_name; + jsdisp_t *obj; + jsval_t val; + + hres = create_object(ctx->ctx, NULL, &obj); + if(FAILED(hres)) + return hres; + + ctx->ptr++; + if(skip_spaces(ctx) == '}') { + ctx->ptr++; + *r = jsval_obj(obj); + return S_OK; + } + + while(1) { + if(*ctx->ptr != '"') + break; + hres = parse_json_string(ctx, &prop_name); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) != ':') { + FIXME("missing ':'\n"); + heap_free(prop_name); + break; + } + + ctx->ptr++; + hres = parse_json_value(ctx, &val); + if(SUCCEEDED(hres)) { + hres = jsdisp_propput_name(obj, prop_name, val); + jsval_release(val); + } + heap_free(prop_name); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) == '}') { + ctx->ptr++; + *r = jsval_obj(obj); + return S_OK; + } + + if(*ctx->ptr++ != ',') { + FIXME("expected ','\n"); + break; + } + skip_spaces(ctx); + } + + jsdisp_release(obj); + break; + } + + /* JSONString */ + case '"': { + WCHAR *string; + jsstr_t *str; + + hres = parse_json_string(ctx, &string); + if(FAILED(hres)) + return hres; + + /* FIXME: avoid reallocation */ + str = jsstr_alloc(string); + heap_free(string); + if(!str) + return E_OUTOFMEMORY; + + *r = jsval_string(str); + return S_OK; + } + + /* JSONArray */ + case '[': { + jsdisp_t *array; + unsigned i = 0; + jsval_t val; + + hres = create_array(ctx->ctx, 0, &array); + if(FAILED(hres)) + return hres; + + ctx->ptr++; + if(skip_spaces(ctx) == ']') { + ctx->ptr++; + *r = jsval_obj(array); + return S_OK; + } + + while(1) { + hres = parse_json_value(ctx, &val); + if(FAILED(hres)) + break; + + hres = jsdisp_propput_idx(array, i, val); + jsval_release(val); + if(FAILED(hres)) + break; + + if(skip_spaces(ctx) == ']') { + ctx->ptr++; + *r = jsval_obj(array); + return S_OK; + } + + if(*ctx->ptr != ',') { + FIXME("expected ','\n"); + break; + } + + ctx->ptr++; + i++; + } + + jsdisp_release(array); + break; + } + + /* JSONNumber */ + default: { + int sign = 1; + double n; + + if(*ctx->ptr == '-') { + sign = -1; + ctx->ptr++; + skip_spaces(ctx); + } + + if(!isdigitW(*ctx->ptr)) + break; + + if(*ctx->ptr == '0') { + ctx->ptr++; + n = 0; + if(is_identifier_char(*ctx->ptr)) + break; + }else { + hres = parse_decimal(&ctx->ptr, ctx->end, &n); + if(FAILED(hres)) + return hres; + } + + *r = jsval_number(sign*n); + return S_OK; + } + } + + FIXME("Syntax error at %s\n", debugstr_w(ctx->ptr)); + return E_FAIL; +} + +/* ECMA-262 5.1 Edition 15.12.2 */ +static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + json_parse_ctx_t parse_ctx; + const WCHAR *buf; + jsstr_t *str; + jsval_t ret; + HRESULT hres; + + if(argc != 1) { + FIXME("Unsupported args\n"); + return E_INVALIDARG; + } + + hres = to_flat_string(ctx, argv[0], &str, &buf); + if(FAILED(hres)) + return hres; + + TRACE("%s\n", debugstr_w(buf)); + + parse_ctx.ptr = buf; + parse_ctx.end = buf + jsstr_length(str); + parse_ctx.ctx = ctx; + hres = parse_json_value(&parse_ctx, &ret); + jsstr_release(str); + if(FAILED(hres)) + return hres; + + if(skip_spaces(&parse_ctx)) { + FIXME("syntax error\n"); + jsval_release(ret); + return E_FAIL; + } + + if(r) + *r = ret; + else + jsval_release(ret); + return S_OK; +} + +typedef struct { + script_ctx_t *ctx; + + WCHAR *buf; + size_t buf_size; + size_t buf_len; + + jsdisp_t **stack; + size_t stack_top; + size_t stack_size; + + WCHAR gap[11]; /* according to the spec, it's no longer than 10 chars */ +} stringify_ctx_t; + +static BOOL stringify_push_obj(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + if(!ctx->stack_size) { + ctx->stack = heap_alloc(4*sizeof(*ctx->stack)); + if(!ctx->stack) + return FALSE; + ctx->stack_size = 4; + }else if(ctx->stack_top == ctx->stack_size) { + jsdisp_t **new_stack; + + new_stack = heap_realloc(ctx->stack, ctx->stack_size*2*sizeof(*ctx->stack)); + if(!new_stack) + return FALSE; + ctx->stack = new_stack; + ctx->stack_size *= 2; + } + + ctx->stack[ctx->stack_top++] = obj; + return TRUE; +} + +static void stringify_pop_obj(stringify_ctx_t *ctx) +{ + ctx->stack_top--; +} + +static BOOL is_on_stack(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + size_t i = ctx->stack_top; + while(i--) { + if(ctx->stack[i] == obj) + return TRUE; + } + return FALSE; +} + +static BOOL append_string_len(stringify_ctx_t *ctx, const WCHAR *str, size_t len) +{ + if(!ctx->buf_size) { + ctx->buf = heap_alloc(len*2*sizeof(WCHAR)); + if(!ctx->buf) + return FALSE; + ctx->buf_size = len*2; + }else if(ctx->buf_len + len > ctx->buf_size) { + WCHAR *new_buf; + size_t new_size; + + new_size = ctx->buf_size * 2 + len; + new_buf = heap_realloc(ctx->buf, new_size*sizeof(WCHAR)); + if(!new_buf) + return FALSE; + ctx->buf = new_buf; + ctx->buf_size = new_size; + } + + if(len) + memcpy(ctx->buf + ctx->buf_len, str, len*sizeof(WCHAR)); + ctx->buf_len += len; + return TRUE; +} + +static inline BOOL append_string(stringify_ctx_t *ctx, const WCHAR *str) +{ + return append_string_len(ctx, str, strlenW(str)); +} + +static inline BOOL append_char(stringify_ctx_t *ctx, WCHAR c) +{ + return append_string_len(ctx, &c, 1); +} + +static inline BOOL append_simple_quote(stringify_ctx_t *ctx, WCHAR c) +{ + WCHAR str[] = {'\\',c}; + return append_string_len(ctx, str, 2); +} + +static HRESULT maybe_to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *r) +{ + jsdisp_t *obj; + HRESULT hres; + + if(!is_object_instance(val) || !get_object(val) || !(obj = iface_to_jsdisp((IUnknown*)get_object(val)))) + return jsval_copy(val, r); + + if(is_class(obj, JSCLASS_NUMBER)) { + double n; + hres = to_number(ctx, val, &n); + jsdisp_release(obj); + if(SUCCEEDED(hres)) + *r = jsval_number(n); + return hres; + } + + if(is_class(obj, JSCLASS_STRING)) { + jsstr_t *str; + hres = to_string(ctx, val, &str); + jsdisp_release(obj); + if(SUCCEEDED(hres)) + *r = jsval_string(str); + return hres; + } + + if(is_class(obj, JSCLASS_BOOLEAN)) { + *r = jsval_bool(bool_obj_value(obj)); + jsdisp_release(obj); + return S_OK; + } + + *r = jsval_obj(obj); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation Quote) */ +static HRESULT json_quote(stringify_ctx_t *ctx, const WCHAR *ptr, size_t len) +{ + if(!ptr || !append_char(ctx, '"')) + return E_OUTOFMEMORY; + + while(len--) { + switch(*ptr) { + case '"': + case '\\': + if(!append_simple_quote(ctx, *ptr)) + return E_OUTOFMEMORY; + break; + case '\b': + if(!append_simple_quote(ctx, 'b')) + return E_OUTOFMEMORY; + break; + case '\f': + if(!append_simple_quote(ctx, 'f')) + return E_OUTOFMEMORY; + break; + case '\n': + if(!append_simple_quote(ctx, 'n')) + return E_OUTOFMEMORY; + break; + case '\r': + if(!append_simple_quote(ctx, 'r')) + return E_OUTOFMEMORY; + break; + case '\t': + if(!append_simple_quote(ctx, 't')) + return E_OUTOFMEMORY; + break; + default: + if(*ptr < ' ') { + const WCHAR formatW[] = {'\\','u','%','0','4','x',0}; + WCHAR buf[7]; + sprintfW(buf, formatW, *ptr); + if(!append_string(ctx, buf)) + return E_OUTOFMEMORY; + }else { + if(!append_char(ctx, *ptr)) + return E_OUTOFMEMORY; + } + } + ptr++; + } + + return append_char(ctx, '"') ? S_OK : E_OUTOFMEMORY; +} + +static inline BOOL is_callable(jsdisp_t *obj) +{ + return is_class(obj, JSCLASS_FUNCTION); +} + +static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val); + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation JA) */ +static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + unsigned length, i, j; + jsval_t val; + HRESULT hres; + + if(is_on_stack(ctx, obj)) { + FIXME("Found a cycle\n"); + return E_FAIL; + } + + if(!stringify_push_obj(ctx, obj)) + return E_OUTOFMEMORY; + + if(!append_char(ctx, '[')) + return E_OUTOFMEMORY; + + length = array_get_length(obj); + + for(i=0; i < length; i++) { + if(i && !append_char(ctx, ',')) + return E_OUTOFMEMORY; + + if(*ctx->gap) { + if(!append_char(ctx, '\n')) + return E_OUTOFMEMORY; + + for(j=0; j < ctx->stack_top; j++) { + if(!append_string(ctx, ctx->gap)) + return E_OUTOFMEMORY; + } + } + + hres = jsdisp_get_idx(obj, i, &val); + if(FAILED(hres)) + return hres; + + hres = stringify(ctx, val); + if(FAILED(hres)) + return hres; + + if(hres == S_FALSE && !append_string(ctx, nullW)) + return E_OUTOFMEMORY; + } + + if((length && *ctx->gap && !append_char(ctx, '\n')) || !append_char(ctx, ']')) + return E_OUTOFMEMORY; + + stringify_pop_obj(ctx); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation JO) */ +static HRESULT stringify_object(stringify_ctx_t *ctx, jsdisp_t *obj) +{ + DISPID dispid = DISPID_STARTENUM; + jsval_t val = jsval_undefined(); + unsigned prop_cnt = 0, i; + size_t stepback; + BSTR prop_name; + HRESULT hres; + + if(is_on_stack(ctx, obj)) { + FIXME("Found a cycle\n"); + return E_FAIL; + } + + if(!stringify_push_obj(ctx, obj)) + return E_OUTOFMEMORY; + + if(!append_char(ctx, '{')) + return E_OUTOFMEMORY; + + while((hres = IDispatchEx_GetNextDispID(&obj->IDispatchEx_iface, fdexEnumDefault, dispid, &dispid)) == S_OK) { + jsval_release(val); + hres = jsdisp_propget(obj, dispid, &val); + if(FAILED(hres)) + return hres; + + if(is_undefined(val)) + continue; + + stepback = ctx->buf_len; + + if(prop_cnt && !append_char(ctx, ',')) { + hres = E_OUTOFMEMORY; + break; + } + + if(*ctx->gap) { + if(!append_char(ctx, '\n')) { + hres = E_OUTOFMEMORY; + break; + } + + for(i=0; i < ctx->stack_top; i++) { + if(!append_string(ctx, ctx->gap)) { + hres = E_OUTOFMEMORY; + break; + } + } + } + + hres = IDispatchEx_GetMemberName(&obj->IDispatchEx_iface, dispid, &prop_name); + if(FAILED(hres)) + break; + + hres = json_quote(ctx, prop_name, SysStringLen(prop_name)); + SysFreeString(prop_name); + if(FAILED(hres)) + break; + + if(!append_char(ctx, ':') || (*ctx->gap && !append_char(ctx, ' '))) { + hres = E_OUTOFMEMORY; + break; + } + + hres = stringify(ctx, val); + if(FAILED(hres)) + break; + + if(hres == S_FALSE) { + ctx->buf_len = stepback; + continue; + } + + prop_cnt++; + } + jsval_release(val); + if(FAILED(hres)) + return hres; + + if(prop_cnt && *ctx->gap) { + if(!append_char(ctx, '\n')) + return E_OUTOFMEMORY; + + for(i=1; i < ctx->stack_top; i++) { + if(!append_string(ctx, ctx->gap)) { + hres = E_OUTOFMEMORY; + break; + } + } + } + + if(!append_char(ctx, '}')) + return E_OUTOFMEMORY; + + stringify_pop_obj(ctx); + return S_OK; +} + +/* ECMA-262 5.1 Edition 15.12.3 (abstract operation Str) */ +static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val) +{ + jsval_t value; + HRESULT hres; + + if(is_object_instance(val) && get_object(val)) { + jsdisp_t *obj; + DISPID id; + + obj = iface_to_jsdisp((IUnknown*)get_object(val)); + if(!obj) + return S_FALSE; + + hres = jsdisp_get_id(obj, toJSONW, 0, &id); + jsdisp_release(obj); + if(hres == S_OK) + FIXME("Use toJSON.\n"); + } + + /* FIXME: Support replacer replacer. */ + + hres = maybe_to_primitive(ctx->ctx, val, &value); + if(FAILED(hres)) + return hres; + + switch(jsval_type(value)) { + case JSV_NULL: + if(!append_string(ctx, nullW)) + hres = E_OUTOFMEMORY; + break; + case JSV_BOOL: + if(!append_string(ctx, get_bool(value) ? trueW : falseW)) + hres = E_OUTOFMEMORY; + break; + case JSV_STRING: { + jsstr_t *str = get_string(value); + const WCHAR *ptr = jsstr_flatten(str); + if(ptr) + hres = json_quote(ctx, ptr, jsstr_length(str)); + else + hres = E_OUTOFMEMORY; + break; + } + case JSV_NUMBER: { + double n = get_number(value); + if(is_finite(n)) { + const WCHAR *ptr; + jsstr_t *str; + + /* FIXME: Optimize. There is no need for jsstr_t here. */ + hres = double_to_string(n, &str); + if(FAILED(hres)) + break; + + ptr = jsstr_flatten(str); + assert(ptr != NULL); + hres = ptr && !append_string_len(ctx, ptr, jsstr_length(str)) ? E_OUTOFMEMORY : S_OK; + jsstr_release(str); + }else { + if(!append_string(ctx, nullW)) + hres = E_OUTOFMEMORY; + } + break; + } + case JSV_OBJECT: { + jsdisp_t *obj; + + obj = iface_to_jsdisp((IUnknown*)get_object(value)); + if(!obj) { + hres = S_FALSE; + break; + } + + if(!is_callable(obj)) + hres = is_class(obj, JSCLASS_ARRAY) ? stringify_array(ctx, obj) : stringify_object(ctx, obj); + else + hres = S_FALSE; + + jsdisp_release(obj); + break; + } + case JSV_UNDEFINED: + hres = S_FALSE; + break; + case JSV_VARIANT: + FIXME("VARIANT\n"); + hres = E_NOTIMPL; + break; + } + + jsval_release(value); + return hres; +} + +/* ECMA-262 5.1 Edition 15.12.3 */ +static HRESULT JSON_stringify(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + stringify_ctx_t stringify_ctx = {ctx, NULL,0,0, NULL,0,0, {0}}; + HRESULT hres; + + TRACE("\n"); + + if(argc >= 2 && is_object_instance(argv[1])) { + FIXME("Replacer %s not yet supported\n", debugstr_jsval(argv[1])); + return E_NOTIMPL; + } + + if(argc >= 3) { + jsval_t space_val; + + hres = maybe_to_primitive(ctx, argv[2], &space_val); + if(FAILED(hres)) + return hres; + + if(is_number(space_val)) { + double n = get_number(space_val); + if(n >= 1) { + int i, len; + if(n > 10) + n = 10; + len = floor(n); + for(i=0; i < len; i++) + stringify_ctx.gap[i] = ' '; + stringify_ctx.gap[len] = 0; + } + }else if(is_string(space_val)) { + jsstr_t *space_str = get_string(space_val); + size_t len = jsstr_length(space_str); + if(len > 10) + len = 10; + jsstr_extract(space_str, 0, len, stringify_ctx.gap); + } + + jsval_release(space_val); + } + + hres = stringify(&stringify_ctx, argv[0]); + if(SUCCEEDED(hres) && r) { + assert(!stringify_ctx.stack_top); + + if(hres == S_OK) { + jsstr_t *ret = jsstr_alloc_len(stringify_ctx.buf, stringify_ctx.buf_len); + if(ret) + *r = jsval_string(ret); + else + hres = E_OUTOFMEMORY; + }else { + *r = jsval_undefined(); + } + } + + heap_free(stringify_ctx.buf); + heap_free(stringify_ctx.stack); + return hres; +} + +static const builtin_prop_t JSON_props[] = { + {parseW, JSON_parse, PROPF_METHOD|2}, + {stringifyW, JSON_stringify, PROPF_METHOD|3} +}; + +static const builtin_info_t JSON_info = { + JSCLASS_JSON, + {NULL, NULL, 0}, + sizeof(JSON_props)/sizeof(*JSON_props), + JSON_props, + NULL, + NULL +}; + +HRESULT create_json(script_ctx_t *ctx, jsdisp_t **ret) +{ + jsdisp_t *json; + HRESULT hres; + + json = heap_alloc_zero(sizeof(*json)); + if(!json) + return E_OUTOFMEMORY; + + hres = init_dispex_from_constr(json, ctx, &JSON_info, ctx->object_constr); + if(FAILED(hres)) { + heap_free(json); + return hres; + } + + *ret = json; + return S_OK; +} Propchange: trunk/reactos/dll/win32/jscript/json.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/jscript/jsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/jsutils.…
============================================================================== --- trunk/reactos/dll/win32/jscript/jsutils.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/jsutils.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -43,6 +43,11 @@ return NULL; } +BOOL is_finite(double n) +{ + return !isnan(n) && !isinf(n); +} + #define MIN_BLOCK_SIZE 128 #define ARENA_FREE_FILLER 0xaa @@ -631,7 +636,7 @@ if(FAILED(hres)) return hres; - *ret = isnan(n) || isinf(n) ? 0 : n; + *ret = is_finite(n) ? n : 0; return S_OK; } Modified: trunk/reactos/dll/win32/jscript/lex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/lex.c?re…
============================================================================== --- trunk/reactos/dll/win32/jscript/lex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/lex.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -19,8 +19,6 @@ #include "jscript.h" #include "parser.tab.h" - -#define LONGLONG_MAX (((LONGLONG)0x7fffffff<<32)|0xffffffff) static const WCHAR breakW[] = {'b','r','e','a','k',0}; static const WCHAR caseW[] = {'c','a','s','e',0}; @@ -97,7 +95,7 @@ } /* ECMA-262 3rd Edition 7.6 */ -static BOOL is_identifier_char(WCHAR c) +BOOL is_identifier_char(WCHAR c) { return isalnumW(c) || c == '$' || c == '_' || c == '\\'; } @@ -237,7 +235,7 @@ return ctx->ptr != ctx->end; } -static BOOL unescape(WCHAR *str) +BOOL unescape(WCHAR *str) { WCHAR *pd, *p, c; int i; @@ -394,14 +392,14 @@ return ret; } -static BOOL parse_double_literal(parser_ctx_t *ctx, LONG int_part, double *ret) -{ - LONGLONG d, hlp; +HRESULT parse_decimal(const WCHAR **iter, const WCHAR *end, double *ret) +{ + const WCHAR *ptr = *iter; + LONGLONG d = 0, hlp; int exp = 0; - d = int_part; - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - hlp = d*10 + *(ctx->ptr++) - '0'; + while(ptr < end && isdigitW(*ptr)) { + hlp = d*10 + *(ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) { exp++; break; @@ -409,51 +407,48 @@ else d = hlp; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { + while(ptr < end && isdigitW(*ptr)) { exp++; - ctx->ptr++; - } - - if(*ctx->ptr == '.') { - ctx->ptr++; - - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - hlp = d*10 + *(ctx->ptr++) - '0'; + ptr++; + } + + if(*ptr == '.') { + ptr++; + + while(ptr < end && isdigitW(*ptr)) { + hlp = d*10 + *(ptr++) - '0'; if(d>MAXLONGLONG/10 || hlp<0) break; d = hlp; exp--; } - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) - ctx->ptr++; - } - - if(ctx->ptr < ctx->end && (*ctx->ptr == 'e' || *ctx->ptr == 'E')) { + while(ptr < end && isdigitW(*ptr)) + ptr++; + } + + if(ptr < end && (*ptr == 'e' || *ptr == 'E')) { int sign = 1, e = 0; - ctx->ptr++; - if(ctx->ptr < ctx->end) { - if(*ctx->ptr == '+') { - ctx->ptr++; - }else if(*ctx->ptr == '-') { + if(++ptr < end) { + if(*ptr == '+') { + ptr++; + }else if(*ptr == '-') { sign = -1; - ctx->ptr++; - }else if(!isdigitW(*ctx->ptr)) { + ptr++; + }else if(!isdigitW(*ptr)) { WARN("Expected exponent part\n"); - lex_error(ctx, E_FAIL); - return FALSE; - } - } - - if(ctx->ptr == ctx->end) { + return E_FAIL; + } + } + + if(ptr == end) { WARN("unexpected end of file\n"); - lex_error(ctx, E_FAIL); - return FALSE; - } - - while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { - if(e > INT_MAX/10 || (e = e*10 + *ctx->ptr++ - '0')<0) + return E_FAIL; + } + + while(ptr < end && isdigitW(*ptr)) { + if(e > INT_MAX/10 || (e = e*10 + *ptr++ - '0')<0) e = INT_MAX; } e *= sign; @@ -463,22 +458,25 @@ else exp += e; } - if(is_identifier_char(*ctx->ptr)) { + if(is_identifier_char(*ptr)) { WARN("wrong char after zero\n"); - lex_error(ctx, JS_E_MISSING_SEMICOLON); - return FALSE; + return JS_E_MISSING_SEMICOLON; } *ret = exp>=0 ? d*pow(10, exp) : d/pow(10, -exp); - return TRUE; + *iter = ptr; + return S_OK; } static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret) { - LONG l, d; - - l = *ctx->ptr++ - '0'; - if(!l) { + HRESULT hres; + + if(*ctx->ptr == '0') { + LONG d, l = 0; + + ctx->ptr++; + if(*ctx->ptr == 'x' || *ctx->ptr == 'X') { if(++ctx->ptr == ctx->end) { ERR("unexpected end of file\n"); @@ -534,7 +532,13 @@ } } - return parse_double_literal(ctx, l, ret); + hres = parse_decimal(&ctx->ptr, ctx->end, ret); + if(FAILED(hres)) { + lex_error(ctx, hres); + return FALSE; + } + + return TRUE; } static int next_token(parser_ctx_t *ctx, void *lval) @@ -587,8 +591,12 @@ case '.': if(++ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { double n; - if(!parse_double_literal(ctx, 0, &n)) + HRESULT hres; + hres = parse_decimal(&ctx->ptr, ctx->end, &n); + if(FAILED(hres)) { + lex_error(ctx, hres); return -1; + } *(literal_t**)lval = new_double_literal(ctx, n); return tNumericLiteral; } Modified: trunk/reactos/dll/win32/jscript/number.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/number.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/number.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -247,7 +247,7 @@ val = number->value; - if(radix==10 || isnan(val) || isinf(val)) { + if(radix==10 || !is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -373,7 +373,7 @@ } val = number->value; - if(isinf(val) || isnan(val)) { + if(!is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -414,7 +414,7 @@ } val = number->value; - if(isinf(val) || isnan(val)) { + if(!is_finite(val)) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; @@ -455,7 +455,7 @@ } val = number->value; - if(isinf(val) || isnan(val) || !prec) { + if(!is_finite(val) || !prec) { hres = to_string(ctx, jsval_number(val), &str); if(FAILED(hres)) return hres; Modified: trunk/reactos/dll/win32/jscript/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/object.c…
============================================================================== --- trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/object.c [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -48,7 +48,7 @@ static const WCHAR stringW[] = {'S','t','r','i','n','g',0}; /* Keep in sync with jsclass_t enum */ static const WCHAR *names[] = {NULL, arrayW, booleanW, dateW, errorW, - functionW, NULL, mathW, numberW, objectW, regexpW, stringW, objectW, objectW}; + functionW, NULL, mathW, numberW, objectW, regexpW, stringW, objectW, objectW, objectW}; TRACE("\n"); Modified: trunk/reactos/dll/win32/jscript/parser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/jscript/parser.h…
============================================================================== --- trunk/reactos/dll/win32/jscript/parser.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/jscript/parser.h [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -63,6 +63,10 @@ { return heap_pool_alloc(&ctx->script->tmp_heap, size); } + +BOOL is_identifier_char(WCHAR) DECLSPEC_HIDDEN; +BOOL unescape(WCHAR*) DECLSPEC_HIDDEN; +HRESULT parse_decimal(const WCHAR**,const WCHAR*,double*) DECLSPEC_HIDDEN; typedef enum { LT_DOUBLE, Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 3 13:24:43 2016 @@ -85,7 +85,7 @@ reactos/dll/win32/iphlpapi # Out of sync reactos/dll/win32/itircl # Synced to WineStaging-1.7.55 reactos/dll/win32/itss # Synced to WineStaging-1.7.55 -reactos/dll/win32/jscript # Synced to WineStaging-1.7.55 +reactos/dll/win32/jscript # Synced to WineStaging-1.9.4 reactos/dll/win32/jsproxy # Synced to WineStaging-1.7.55 reactos/dll/win32/loadperf # Synced to WineStaging-1.7.55 reactos/dll/win32/localspl # Synced to WineStaging-1.7.55
8 years, 8 months
1
0
0
0
[akhaldi] 70872: [JSCRIPT_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:25:03 2016 New Revision: 70872 URL:
http://svn.reactos.org/svn/reactos?rev=70872&view=rev
Log: [JSCRIPT_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912 Modified: trunk/rostests/winetests/jscript/api.js Modified: trunk/rostests/winetests/jscript/api.js URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/api.js?…
============================================================================== --- trunk/rostests/winetests/jscript/api.js [iso-8859-1] (original) +++ trunk/rostests/winetests/jscript/api.js [iso-8859-1] Thu Mar 3 13:25:03 2016 @@ -1766,6 +1766,89 @@ tmp = Math.tan(-Infinity); ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); +(function() { + if(invokeVersion < 2) + return; + + var stringify_tests = [ + [[true], "true"], + [[false], "false"], + [[null], "null"], + [[1], "1"], + [["test"], "\"test\""], + [["test\"\\\b\f\n\r\t\u0002 !"], "\"test\\\"\\\\\\b\\f\\n\\r\\t\\u0002 !\""], + [[NaN], "null"], + [[Infinity], "null"], + [[-Infinity], "null"], + [[{prop1: true, prop2: "string"}], "{\"prop1\":true,\"prop2\":\"string\"}"], + [[{prop1: true, prop2: testObj, prop3: undefined}], "{\"prop1\":true}"], + [[{prop1: true, prop2: {prop: "string"}},undefined," "], + "{\n \"prop1\": true,\n \"prop2\": {\n \"prop\": \"string\"\n }\n}"], + [[{ },undefined," "], "{}"], + [[[,2,undefined,3,{ },]],"[null,2,null,3,{},null]"], + [[[,2,undefined,3,{prop:0},],undefined," "],"[\n null,\n 2,\n null,\n 3,\n {\n \"prop\": 0\n },\n null\n]"] + ]; + + var i, s, v; + + for(i=0; i < stringify_tests.length; i++) { + s = JSON.stringify.apply(null, stringify_tests[i][0]); + ok(s === stringify_tests[i][1], + "["+i+"] stringify(" + stringify_tests[i][0] + ") returned " + s + " expected " + stringify_tests[i][1]); + } + + s = JSON.stringify(testObj); + ok(s === undefined || s === "undefined" /* broken on some old versions */, + "stringify(testObj) returned " + s + " expected undfined"); + + s = JSON.stringify(undefined); + ok(s === undefined || s === "undefined" /* broken on some old versions */, + "stringify(undefined) returned " + s + " expected undfined"); + + var parse_tests = [ + ["true", true], + [" \nnull ", null], + ["{}", {}], + ["\"\\r\\n test\\u1111\"", "\r\n test\u1111"], + ["{\"x\" :\n true}", {x:true}], + ["{\"x y\": {}, \"z\": {\"x\":null}}", {"x y":{}, z:{x:null}}], + ["[]", []], + ["[false,{},{\"x\": []}]", [false,{},{x:[]}]], + ["0", 0], + ["- 1", -1], + ["1e2147483648", Infinity] + ]; + + function json_cmp(x, y) { + if(x === y) + return true; + + if(!(x instanceof Object) || !(y instanceof Object)) + return false; + + for(var prop in x) { + if(!x.hasOwnProperty(prop)) + continue; + if(!x.hasOwnProperty(prop)) + return false; + if(!json_cmp(x[prop], y[prop])) + return false; + } + + for(var prop in y) { + if(!x.hasOwnProperty(prop) && y.hasOwnProperty(prop)) + return false; + } + + return true; + } + + for(i=0; i < parse_tests.length; i++) { + v = JSON.parse(parse_tests[i][0]); + ok(json_cmp(v, parse_tests[i][1]), "parse[" + i + "] returned " + v + ", expected " + parse_tests[i][1]); + } +})(); + var func = function (a) { var a = 1; if(a) return; @@ -1868,6 +1951,16 @@ ok(tmp === undefined, "func() = " + tmp); tmp = func.toString(); ok(tmp == "function anonymous() {\n\n}", "func.toString() = " + tmp); + +// Function constructor called as function +func = Function("return 3;"); + +tmp = func(); +ok(tmp === 3, "func() = " + tmp); +ok(func.call() === 3, "func.call() = " + tmp); +ok(func.length === 0, "func.length = " + func.length); +tmp = func.toString(); +ok(tmp === "function anonymous() {\nreturn 3;\n}", "func.toString() = " + tmp); func = (function() { var tmp = 3; @@ -2707,6 +2800,14 @@ ["lbound", 0], ["toArray", 0], ["ubound", 0] +]); + +if(invokeVersion < 2) + ok(typeof(JSON) === "undefined", "JSON is not undefined"); +else + testFunctions(JSON, [ + ["parse", 2], + ["stringify", 3] ]); ok(ActiveXObject.length == 1, "ActiveXObject.length = " + ActiveXObject.length);
8 years, 8 months
1
0
0
0
[akhaldi] 70870: [INETCOMM] Sync with Wine Staging 1.9.4. CORE-10912 [PSDK] Update objidl.idl. [MAPI32][OLE32] Adapt to objidl.idl changes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Mar 3 13:03:11 2016 New Revision: 70870 URL:
http://svn.reactos.org/svn/reactos?rev=70870&view=rev
Log: [INETCOMM] Sync with Wine Staging 1.9.4. CORE-10912 [PSDK] Update objidl.idl. [MAPI32][OLE32] Adapt to objidl.idl changes. Modified: trunk/reactos/dll/win32/inetcomm/mimeole.c trunk/reactos/dll/win32/mapi32/imalloc.c trunk/reactos/dll/win32/ole32/ifs.c trunk/reactos/include/psdk/objidl.idl trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/inetcomm/mimeole.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeole…
============================================================================== --- trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] Thu Mar 3 13:03:11 2016 @@ -2803,7 +2803,7 @@ static LPVOID WINAPI MimeAlloc_Alloc( IMimeAllocator* iface, - ULONG cb) + SIZE_T cb) { return CoTaskMemAlloc(cb); } @@ -2811,7 +2811,7 @@ static LPVOID WINAPI MimeAlloc_Realloc( IMimeAllocator* iface, LPVOID pv, - ULONG cb) + SIZE_T cb) { return CoTaskMemRealloc(pv, cb); } @@ -2823,7 +2823,7 @@ CoTaskMemFree(pv); } -static ULONG WINAPI MimeAlloc_GetSize( +static SIZE_T WINAPI MimeAlloc_GetSize( IMimeAllocator* iface, LPVOID pv) { Modified: trunk/reactos/dll/win32/mapi32/imalloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mapi32/imalloc.c…
============================================================================== --- trunk/reactos/dll/win32/mapi32/imalloc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/mapi32/imalloc.c [iso-8859-1] Thu Mar 3 13:03:11 2016 @@ -96,7 +96,7 @@ /************************************************************************** * IMAPIMalloc_Alloc */ -static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb) +static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, SIZE_T cb) { TRACE("(%p)->(%d)\n", iface, cb); @@ -106,7 +106,7 @@ /************************************************************************** * IMAPIMalloc_Realloc */ -static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb) +static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, SIZE_T cb) { TRACE("(%p)->(%p, %d)\n", iface, pv, cb); @@ -132,7 +132,7 @@ /************************************************************************** * IMAPIMalloc_GetSize */ -static DWORD WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv) +static SIZE_T WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv) { TRACE("(%p)->(%p)\n", iface, pv); return LocalSize(pv); Modified: trunk/reactos/dll/win32/ole32/ifs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ole32/ifs.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ole32/ifs.c [iso-8859-1] Thu Mar 3 13:03:11 2016 @@ -148,7 +148,7 @@ /****************************************************************************** * IMalloc32_Alloc [VTABLE] */ -static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, DWORD cb) { +static LPVOID WINAPI IMalloc_fnAlloc(LPMALLOC iface, SIZE_T cb) { LPVOID addr; @@ -182,7 +182,7 @@ /****************************************************************************** * IMalloc32_Realloc [VTABLE] */ -static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,DWORD cb) { +static LPVOID WINAPI IMalloc_fnRealloc(LPMALLOC iface,LPVOID pv,SIZE_T cb) { LPVOID pNewMemory; @@ -270,7 +270,7 @@ * win95: size allocated (4 byte boundarys) * win2k: size originally requested !!! (allocated on 8 byte boundarys) */ -static DWORD WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) { +static SIZE_T WINAPI IMalloc_fnGetSize(LPMALLOC iface,LPVOID pv) { DWORD cb; BOOL fSpyed = FALSE; Modified: trunk/reactos/include/psdk/objidl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/objidl.idl?re…
============================================================================== --- trunk/reactos/include/psdk/objidl.idl [iso-8859-1] (original) +++ trunk/reactos/include/psdk/objidl.idl [iso-8859-1] Thu Mar 3 13:03:11 2016 @@ -162,16 +162,16 @@ typedef [unique] IMalloc *LPMALLOC; LPVOID Alloc( - [in] ULONG cb); + [in] SIZE_T cb); LPVOID Realloc( [in] LPVOID pv, - [in] ULONG cb); + [in] SIZE_T cb); void Free( [in] LPVOID pv); - ULONG GetSize( + SIZE_T GetSize( [in] LPVOID pv); int DidAlloc(LPVOID pv); @@ -188,8 +188,8 @@ { typedef [unique] IMallocSpy *LPMALLOCSPY; - ULONG PreAlloc( - [in] ULONG cbRequest); + SIZE_T PreAlloc( + [in] SIZE_T cbRequest); LPVOID PostAlloc( [in] LPVOID pActual); @@ -201,9 +201,9 @@ void PostFree( [in] BOOL fSpyed); - ULONG PreRealloc( + SIZE_T PreRealloc( [in] LPVOID pRequest, - [in] ULONG cbRequest, + [in] SIZE_T cbRequest, [out] LPVOID *ppNewRequest, [in] BOOL fSpyed); @@ -215,8 +215,8 @@ [in] LPVOID pRequest, [in] BOOL fSpyed); - ULONG PostGetSize( - [in] ULONG cbActual, + SIZE_T PostGetSize( + [in] SIZE_T cbActual, [in] BOOL fSpyed); LPVOID PreDidAlloc( Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Mar 3 13:03:11 2016 @@ -78,7 +78,7 @@ reactos/dll/win32/imaadp32.acm # Synced to WineStaging-1.7.55 reactos/dll/win32/imagehlp # Synced to WineStaging-1.7.55 reactos/dll/win32/imm32 # Synced to Wine-1.7.27 -reactos/dll/win32/inetcomm # Synced to WineStaging-1.7.55 +reactos/dll/win32/inetcomm # Synced to WineStaging-1.9.4 reactos/dll/win32/inetmib1 # Synced to WineStaging-1.7.55 reactos/dll/win32/initpki # Synced to WineStaging-1.7.55 reactos/dll/win32/inseng # Synced to WineStaging-1.7.55
8 years, 8 months
1
0
0
0
[akhaldi] 70942: [VBSCRIPT_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Mar 5 10:34:43 2016 New Revision: 70942 URL:
http://svn.reactos.org/svn/reactos?rev=70942&view=rev
Log: [VBSCRIPT_WINETEST] Sync with Wine Staging 1.9.4. CORE-10912 Modified: trunk/rostests/winetests/vbscript/run.c trunk/rostests/winetests/vbscript/vbsregexp55.idl Modified: trunk/rostests/winetests/vbscript/run.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/run.c?…
============================================================================== --- trunk/rostests/winetests/vbscript/run.c [iso-8859-1] (original) +++ trunk/rostests/winetests/vbscript/run.c [iso-8859-1] Sat Mar 5 10:34:43 2016 @@ -568,7 +568,7 @@ ok(!safearray->cLocks, "safearray->cLocks = %x\n", safearray->cLocks); for(i=0; i < safearray->cDims; i++) { - ok(safearray->rgsabound[i].cElements == indims ? i+4 : 1, "safearray->rgsabound[%d].cElements = %d\n", i, + ok(safearray->rgsabound[i].cElements == (indims ? i+4 : 1), "safearray->rgsabound[%d].cElements = %d\n", i, safearray->rgsabound[i].cElements); ok(!safearray->rgsabound[i].lLbound, "safearray->rgsabound[%d].lLbound = %d\n", i, safearray->rgsabound[i].lLbound); } Modified: trunk/rostests/winetests/vbscript/vbsregexp55.idl URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/vbsreg…
============================================================================== --- trunk/rostests/winetests/vbscript/vbsregexp55.idl [iso-8859-1] (original) +++ trunk/rostests/winetests/vbscript/vbsregexp55.idl [iso-8859-1] Sat Mar 5 10:34:43 2016 @@ -24,6 +24,7 @@ [ helpstring("Microsoft VBScript Regular Expressions 5.5"), + id(3), uuid(3f4daca7-160d-11d2-a8e9-00104b365c9f), version(5.5) ]
8 years, 8 months
1
0
0
0
[hbelusca] 70869: [AUTOCHK][CHKDSK]: Minor fixes / formatting. Really add chkdsk to build. [FMIFS]: Quickly implement the chkdsk function, the same way as it is done for the formatting function.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Mar 3 00:36:25 2016 New Revision: 70869 URL:
http://svn.reactos.org/svn/reactos?rev=70869&view=rev
Log: [AUTOCHK][CHKDSK]: Minor fixes / formatting. Really add chkdsk to build. [FMIFS]: Quickly implement the chkdsk function, the same way as it is done for the formatting function. Modified: trunk/reactos/base/system/CMakeLists.txt trunk/reactos/base/system/autochk/autochk.c trunk/reactos/base/system/chkdsk/chkdsk.c trunk/reactos/dll/win32/fmifs/chkdsk.c trunk/reactos/dll/win32/fmifs/format.c trunk/reactos/dll/win32/fmifs/init.c Modified: trunk/reactos/base/system/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/CMakeLists.txt…
============================================================================== --- trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -1,6 +1,7 @@ add_subdirectory(autochk) add_subdirectory(bootok) +add_subdirectory(chkdsk) add_subdirectory(diskpart) add_subdirectory(expand) add_subdirectory(format) Modified: trunk/reactos/base/system/autochk/autochk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/autochk/autoch…
============================================================================== --- trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] (original) +++ trunk/reactos/base/system/autochk/autochk.c [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -1,4 +1,5 @@ -/* PROJECT: ReactOS Kernel +/* + * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory * FILE: base/system/autochk/autochk.c * PURPOSE: Filesystem checker Modified: trunk/reactos/base/system/chkdsk/chkdsk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/chkdsk/chkdsk.…
============================================================================== --- trunk/reactos/base/system/chkdsk/chkdsk.c [iso-8859-1] (original) +++ trunk/reactos/base/system/chkdsk/chkdsk.c [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -4,7 +4,7 @@ // // Copyright (c) 1998 Mark Russinovich // Systems Internals -//
http://www.sysinternals.com/
+//
http://www.sysinternals.com
// // Chkdsk clone that demonstrates the use of the FMIFS file system // utility library. @@ -43,10 +43,14 @@ /* PSDK/NDK Headers */ #define WIN32_NO_STATUS -#include <windows.h> +#include <windef.h> +#include <winbase.h> +#include <wincon.h> #define NTOS_MODE_USER #include <ndk/ntndk.h> + +/* FMIFS Public Header */ #include <fmifs/fmifs.h> #define FMIFS_IMPORT_DLL @@ -118,9 +122,8 @@ // // Tell the user how to use the program // -// 19990216 EA Missing printf %s argument -//---------------------------------------------------------------------- -VOID +//---------------------------------------------------------------------- +static VOID Usage(PWCHAR ProgramName) { wprintf(L"Usage: %s [drive:] [-F] [-V] [-R] [-C]\n\n" @@ -140,7 +143,7 @@ // Get the switches. // //---------------------------------------------------------------------- -int +static int ParseCommandLine( int argc, WCHAR *argv[] @@ -160,9 +163,9 @@ switch (argv[i][1]) { - case L'?': - Usage(argv[0]); - break; + // case L'?': + // Usage(argv[0]); + // return i; case L'F': case L'f': { @@ -309,7 +312,7 @@ case DONE: status = (PBOOLEAN)Argument; - if (*status == TRUE) + if (*status == FALSE) { wprintf(L"Chkdsk was unable to complete successfully.\n\n"); Error = TRUE; @@ -329,7 +332,7 @@ // 19990216 EA Used wide functions // //---------------------------------------------------------------------- -BOOLEAN +static BOOLEAN LoadFMIFSEntryPoints(VOID) { HMODULE hFmifs = LoadLibraryW(L"fmifs.dll"); Modified: trunk/reactos/dll/win32/fmifs/chkdsk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/chkdsk.c?r…
============================================================================== --- trunk/reactos/dll/win32/fmifs/chkdsk.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/chkdsk.c [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -2,12 +2,15 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: File Management IFS Utility functions * FILE: reactos/dll/win32/fmifs/chkdsk.c - * PURPOSE: Chkdsk + * PURPOSE: Disk Checker * - * PROGRAMMERS: (none) + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) */ #include "precomp.h" + +#define NDEBUG +#include <debug.h> /* FMIFS.1 */ VOID @@ -23,12 +26,44 @@ IN PVOID Unused3, IN PFMIFSCALLBACK Callback) { + PIFS_PROVIDER Provider; + UNICODE_STRING usDriveRoot; BOOLEAN Argument = FALSE; + WCHAR VolumeName[MAX_PATH]; + //CURDIR CurDir; - /* FAIL immediately */ - Callback(DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument);/* Argument */ + Provider = GetProvider(Format); + if (!Provider) + { + /* Unknown file system */ + Callback(DONE, 0, &Argument); + return; + } + +#if 1 + DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n"); + swprintf(VolumeName, L"\\??\\%c:", towupper(DriveRoot[0])); + RtlCreateUnicodeString(&usDriveRoot, VolumeName); + /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */ +#else + if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) || + !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir)) + { + /* Report an error. */ + Callback(DONE, 0, &Argument); + return; + } +#endif + + DPRINT("ChkdskEx - %S\n", Format); + Provider->ChkdskEx(&usDriveRoot, + CorrectErrors, + Verbose, + CheckOnlyIfDirty, + ScanDrive, + Callback); + + RtlFreeUnicodeString(&usDriveRoot); } /* EOF */ Modified: trunk/reactos/dll/win32/fmifs/format.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/format.c?r…
============================================================================== --- trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/format.c [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -55,9 +55,7 @@ if (!Provider) { /* Unknown file system */ - Callback(DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument); /* Argument */ + Callback(DONE, 0, &Argument); return; } @@ -71,9 +69,7 @@ !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir)) { /* Report an error. */ - Callback(DONE, /* Command */ - 0, /* DWORD Modifier */ - &Argument); /* Argument */ + Callback(DONE, 0, &Argument); return; } #endif Modified: trunk/reactos/dll/win32/fmifs/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/fmifs/init.c?rev…
============================================================================== --- trunk/reactos/dll/win32/fmifs/init.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/fmifs/init.c [iso-8859-1] Thu Mar 3 00:36:25 2016 @@ -167,9 +167,7 @@ if (FmIfsInitialized == FALSE) { if (InitializeFmIfsOnce() == FALSE) - { - return FALSE; - } + return FALSE; FmIfsInitialized = TRUE; }
8 years, 8 months
1
0
0
0
[hbelusca] 70868: [CHKDSK] - Integrate chkdsk into our build system. - Whitespace fixes.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Mar 2 22:05:19 2016 New Revision: 70868 URL:
http://svn.reactos.org/svn/reactos?rev=70868&view=rev
Log: [CHKDSK] - Integrate chkdsk into our build system. - Whitespace fixes. Modified: trunk/reactos/base/system/chkdsk/CMakeLists.txt trunk/reactos/base/system/chkdsk/chkdsk.c trunk/reactos/base/system/chkdsk/chkdsk.rc Modified: trunk/reactos/base/system/chkdsk/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/chkdsk/CMakeLi…
============================================================================== --- trunk/reactos/base/system/chkdsk/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/chkdsk/CMakeLists.txt [iso-8859-1] Wed Mar 2 22:05:19 2016 @@ -1,7 +1,7 @@ + +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/fmifs) add_executable(chkdsk chkdsk.c chkdsk.rc) -include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/fmifs) set_module_type(chkdsk win32cui UNICODE) -target_link_libraries(chkdsk win32err) add_importlibs(chkdsk fmifs msvcrt kernel32 ntdll) add_cd_file(TARGET chkdsk DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/system/chkdsk/chkdsk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/chkdsk/chkdsk.…
============================================================================== --- trunk/reactos/base/system/chkdsk/chkdsk.c [iso-8859-1] (original) +++ trunk/reactos/base/system/chkdsk/chkdsk.c [iso-8859-1] Wed Mar 2 22:05:19 2016 @@ -3,8 +3,11 @@ // Chkdskx // // Copyright (c) 1998 Mark Russinovich -// Systems Internals -//
http://www.sysinternals.com/
+// Systems Internals +//
http://www.sysinternals.com/
+// +// Chkdsk clone that demonstrates the use of the FMIFS file system +// utility library. // // -------------------------------------------------------------------- // @@ -25,49 +28,69 @@ // // -------------------------------------------------------------------- // -// Chkdsk clone that demonstrates the use of the FMIFS file system -// utility library. -// // 1999 February (Emanuele Aliberti) -// Adapted for ReactOS and lcc-win32. +// Adapted for ReactOS and lcc-win32. // // 1999 April (Emanuele Aliberti) -// Adapted for ReactOS and egcs. +// Adapted for ReactOS and egcs. // // 2008 July (Aleksey Bragin) -// Cleanup, use ReactOS's fmifs.h +// Cleanup, use ReactOS's fmifs.h // //====================================================================== + +#include <stdio.h> + +/* PSDK/NDK Headers */ #define WIN32_NO_STATUS +#include <windows.h> + #define NTOS_MODE_USER -#include <windows.h> -#include <stdio.h> #include <ndk/ntndk.h> #include <fmifs/fmifs.h> -#define _UNICODE 1 -#include <tchar.h> -#include "../config.h" -#include "../win32err.h" + +#define FMIFS_IMPORT_DLL // // Globals // -BOOL Error = FALSE; +BOOL Error = FALSE; // switches -BOOL FixErrors = FALSE; -BOOL SkipClean = FALSE; -BOOL ScanSectors = FALSE; -BOOL Verbose = FALSE; +BOOL FixErrors = FALSE; +BOOL SkipClean = FALSE; +BOOL ScanSectors = FALSE; +BOOL Verbose = FALSE; PWCHAR Drive = NULL; -WCHAR CurrentDirectory[1024]; +WCHAR CurrentDirectory[1024]; #ifndef FMIFS_IMPORT_DLL // // FMIFS function // -//PCHKDSK Chkdsk; +// PCHKDSK Chkdsk; #endif /* ndef FMIFS_IMPORT_DLL */ + + +//---------------------------------------------------------------------- +// +// PrintWin32Error +// +// Takes the win32 error code and prints the text version. +// +//---------------------------------------------------------------------- +static VOID PrintWin32Error(LPWSTR Message, DWORD ErrorCode) +{ + LPWSTR lpMsgBuf; + + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, ErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&lpMsgBuf, 0, NULL); + + wprintf(L"%s: %s\n", Message, lpMsgBuf); + LocalFree(lpMsgBuf); +} //-------------------------------------------------------------------- @@ -80,12 +103,12 @@ //-------------------------------------------------------------------- BOOL WINAPI -CtrlCIntercept( DWORD dwCtrlType ) -{ - // - // Handle the event so that the default handler doesn't - // - return TRUE; +CtrlCIntercept(DWORD dwCtrlType) +{ + // + // Handle the event so that the default handler doesn't + // + return TRUE; } @@ -98,18 +121,15 @@ // 19990216 EA Missing printf %s argument //---------------------------------------------------------------------- VOID -Usage( PWCHAR ProgramName ) -{ - _tprintf( - L"\ -Usage: %s [drive:] [-F] [-V] [-R] [-C]\n\n\ - [drive:] Specifies the drive to check.\n\ - -F Fixes errors on the disk.\n\ - -V Displays the full path of every file on the disk.\n\ - -R Locates bad sectors and recovers readable information.\n\ - -C Checks the drive only if it is dirty.\n\n", - ProgramName - ); +Usage(PWCHAR ProgramName) +{ + wprintf(L"Usage: %s [drive:] [-F] [-V] [-R] [-C]\n\n" + L"[drive:] Specifies the drive to check.\n" + L"-F Fixes errors on the disk.\n" + L"-V Displays the full path of every file on the disk.\n" + L"-R Locates bad sectors and recovers readable information.\n" + L"-C Checks the drive only if it is dirty.\n\n", + ProgramName); } @@ -122,75 +142,76 @@ //---------------------------------------------------------------------- int ParseCommandLine( - int argc, - WCHAR *argv [] - ) -{ - int i; - BOOLEAN gotFix = FALSE; - BOOLEAN gotVerbose = FALSE; - BOOLEAN gotClean = FALSE; - /*BOOLEAN gotScan = FALSE;*/ - - - for ( i = 1; - (i < argc); - i++ - ) { - switch( argv[i][0] ) - { - case L'-': - case L'/': - - switch( argv[i][1] ) - { - case L'F': - case L'f': - - if( gotFix ) return i; - FixErrors = TRUE; - gotFix = TRUE; - break; - - case L'V': - case L'v': - - if( gotVerbose) return i; - Verbose = TRUE; - gotVerbose = TRUE; - break; - - case L'R': - case L'r': - - if( gotFix ) return i; - ScanSectors = TRUE; - gotFix = TRUE; - break; - - case L'C': - case L'c': - - if( gotClean ) return i; - SkipClean = TRUE; - gotClean = TRUE; - break; - - default: - return i; - } - break; - - default: - - if( Drive ) return i; - if( argv[i][1] != L':' ) return i; - - Drive = argv[i]; - break; - } - } - return 0; + int argc, + WCHAR *argv[] + ) +{ + int i; + BOOLEAN gotFix = FALSE; + BOOLEAN gotVerbose = FALSE; + BOOLEAN gotClean = FALSE; + // BOOLEAN gotScan = FALSE; + + for (i = 1; i < argc; i++) + { + switch (argv[i][0]) + { + case L'-': case L'/': + + switch (argv[i][1]) + { + case L'?': + Usage(argv[0]); + break; + + case L'F': case L'f': + { + if (gotFix) return i; + FixErrors = TRUE; + gotFix = TRUE; + break; + } + + case L'V': case L'v': + { + if (gotVerbose) return i; + Verbose = TRUE; + gotVerbose = TRUE; + break; + } + + case L'R': case L'r': + { + if (gotFix) return i; + ScanSectors = TRUE; + gotFix = TRUE; + break; + } + + case L'C': case L'c': + { + if (gotClean) return i; + SkipClean = TRUE; + gotClean = TRUE; + break; + } + + default: + return i; + } + break; + + default: + { + if (Drive) return i; + if (argv[i][1] != L':') return i; + + Drive = argv[i]; + break; + } + } + } + return 0; } @@ -205,97 +226,97 @@ BOOLEAN WINAPI ChkdskCallback( - CALLBACKCOMMAND Command, - DWORD Modifier, - PVOID Argument - ) -{ - PDWORD percent; - PBOOLEAN status; - PTEXTOUTPUT output; - - // - // We get other types of commands, - // but we don't have to pay attention to them - // - switch( Command ) - { - case UNKNOWN2: - wprintf(L"UNKNOWN2\r"); - break; - - case UNKNOWN3: - wprintf(L"UNKNOWN3\r"); - break; - - case UNKNOWN4: - wprintf(L"UNKNOWN4\r"); - break; - - case UNKNOWN5: - wprintf(L"UNKNOWN5\r"); - break; - - case FSNOTSUPPORTED: - wprintf(L"FSNOTSUPPORTED\r"); - break; - - case VOLUMEINUSE: - wprintf(L"VOLUMEINUSE\r"); - break; - - case UNKNOWN9: - wprintf(L"UNKNOWN9\r"); - break; - - case UNKNOWNA: - wprintf(L"UNKNOWNA\r"); - break; - - case UNKNOWNC: - wprintf(L"UNKNOWNC\r"); - break; - - case UNKNOWND: - wprintf(L"UNKNOWND\r"); - break; - - case INSUFFICIENTRIGHTS: - wprintf(L"INSUFFICIENTRIGHTS\r"); - break; - - case STRUCTUREPROGRESS: - wprintf(L"STRUCTUREPROGRESS\r"); - break; - - case DONEWITHSTRUCTURE: - wprintf(L"DONEWITHSTRUCTURE\r"); - break; - - case CLUSTERSIZETOOSMALL: - wprintf(L"CLUSTERSIZETOOSMALL\r"); - break; - - case PROGRESS: - percent = (PDWORD) Argument; - wprintf(L"%d percent completed.\r", *percent); - break; - - case OUTPUT: - output = (PTEXTOUTPUT) Argument; - fwprintf(stdout, L"%s", output->Output); - break; - - case DONE: - status = (PBOOLEAN) Argument; - if ( *status == TRUE ) - { - wprintf(L"Chkdsk was unable to complete successfully.\n\n"); - Error = TRUE; - } - break; - } - return TRUE; + CALLBACKCOMMAND Command, + DWORD Modifier, + PVOID Argument + ) +{ + PDWORD percent; + PBOOLEAN status; + PTEXTOUTPUT output; + + // + // We get other types of commands, + // but we don't have to pay attention to them + // + switch (Command) + { + case UNKNOWN2: + wprintf(L"UNKNOWN2\r"); + break; + + case UNKNOWN3: + wprintf(L"UNKNOWN3\n"); + break; + + case UNKNOWN4: + wprintf(L"UNKNOWN4\n"); + break; + + case UNKNOWN5: + wprintf(L"UNKNOWN5\n"); + break; + + case FSNOTSUPPORTED: + wprintf(L"FSNOTSUPPORTED\n"); + break; + + case VOLUMEINUSE: + wprintf(L"VOLUMEINUSE\n"); + break; + + case UNKNOWN9: + wprintf(L"UNKNOWN9\n"); + break; + + case UNKNOWNA: + wprintf(L"UNKNOWNA\n"); + break; + + case UNKNOWNC: + wprintf(L"UNKNOWNC\n"); + break; + + case UNKNOWND: + wprintf(L"UNKNOWND\n"); + break; + + case INSUFFICIENTRIGHTS: + wprintf(L"INSUFFICIENTRIGHTS\n"); + break; + + case STRUCTUREPROGRESS: + wprintf(L"STRUCTUREPROGRESS\n"); + break; + + case DONEWITHSTRUCTURE: + wprintf(L"DONEWITHSTRUCTURE\n"); + break; + + case CLUSTERSIZETOOSMALL: + wprintf(L"CLUSTERSIZETOOSMALL\n"); + break; + + case PROGRESS: + percent = (PDWORD)Argument; + wprintf(L"%d percent completed.\r", *percent); + break; + + case OUTPUT: + output = (PTEXTOUTPUT)Argument; + wprintf(L"%S", output->Output); + break; + + case DONE: + status = (PBOOLEAN)Argument; + if (*status == TRUE) + { + wprintf(L"Chkdsk was unable to complete successfully.\n\n"); + Error = TRUE; + } + break; + } + return TRUE; } #ifndef FMIFS_IMPORT_DLL @@ -311,17 +332,19 @@ BOOLEAN LoadFMIFSEntryPoints(VOID) { - LoadLibraryW( L"fmifs.dll" ); - - if( !(Chkdsk = - (void *) GetProcAddress( - GetModuleHandleW(L"fmifs.dll"), - "Chkdsk" )) - ) - { - return FALSE; - } - return TRUE; + HMODULE hFmifs = LoadLibraryW(L"fmifs.dll"); + if (hFmifs == NULL) + return FALSE; + + Chkdsk = (PCHKDSK)GetProcAddress(hFmifs, "Chkdsk"); + + if (!Chkdsk) + { + FreeLibrary(hFmifs); + return FALSE; + } + + return TRUE; } #endif /* ndef FMIFS_IMPORT_DLL */ @@ -339,147 +362,120 @@ // //---------------------------------------------------------------------- int -wmain( int argc, WCHAR *argv[] ) -{ - int badArg; - HANDLE volumeHandle; - WCHAR fileSystem [1024]; - WCHAR volumeName [1024]; - DWORD serialNumber; - DWORD flags, - maxComponent; - - wprintf( - L"\n\ +wmain(int argc, WCHAR *argv[]) +{ + int badArg; + HANDLE volumeHandle; + WCHAR fileSystem[1024]; + WCHAR volumeName[1024]; + DWORD serialNumber; + DWORD flags, maxComponent; + + wprintf(L"\n\ Chkdskx v1.0.1 by Mark Russinovich\n\ Systems Internals -
http://www.sysinternals.com/\n\
-ReactOS adaptation 1999 by Emanuele Aliberti\n\n" - ); +ReactOS adaptation 1999 by Emanuele Aliberti\n\n"); + #ifndef FMIFS_IMPORT_DLL - // - // Get function pointers - // - if( !LoadFMIFSEntryPoints()) - { - wprintf(L"Could not located FMIFS entry points.\n\n"); - return -1; - } + // + // Get function pointers + // + if (!LoadFMIFSEntryPoints()) + { + wprintf(L"Could not located FMIFS entry points.\n\n"); + return -1; + } #endif /* ndef FMIFS_IMPORT_DLL */ - // - // Parse command line - // - if( (badArg = ParseCommandLine( argc, argv ))) - { - wprintf( - L"Unknown argument: %s\n", - argv[badArg] - ); - - Usage(argv[0]); - return -1; - } - - // - // Get the drive's format - // - if( !Drive ) - { - if( !GetCurrentDirectoryW( - sizeof(CurrentDirectory), - CurrentDirectory - ) - ) { - - PrintWin32Error( - L"Could not get current directory", - GetLastError() - ); - return -1; - } - - } else { - - wcscpy( CurrentDirectory, Drive ); - } - CurrentDirectory[2] = L'\\'; - CurrentDirectory[3] = L'\0'; - Drive = CurrentDirectory; - - // - // Determine the drive's file system format, which we need to - // tell chkdsk - // - if( !GetVolumeInformationW( - Drive, - volumeName, - sizeof volumeName, - & serialNumber, - & maxComponent, - & flags, - fileSystem, - sizeof fileSystem - ) - ) { - PrintWin32Error( - L"Could not query volume", - GetLastError() - ); - return -1; - } - - // - // If they want to fix, we need to have access to the drive - // - if ( FixErrors ) - { - swprintf( - volumeName, - L"\\\\.\\%C:", - Drive[0] - ); - volumeHandle = CreateFileW( - volumeName, - GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - 0, - 0 - ); - if( volumeHandle == INVALID_HANDLE_VALUE ) - { - wprintf(L"Chdskx cannot run because the volume is in use by another process.\n\n"); - return -1; - } - CloseHandle( volumeHandle ); - - // - // Can't let the user break out of a chkdsk that can modify the drive - // - SetConsoleCtrlHandler( CtrlCIntercept, TRUE ); - } - - // - // Just do it - // - wprintf( - L"The type of file system is %s.\n", - fileSystem - ); - Chkdsk( - Drive, - fileSystem, - FixErrors, - Verbose, - SkipClean, - ScanSectors, - NULL, - NULL, - ChkdskCallback - ); - - if ( Error ) return -1; - return 0; + + // + // Parse command line + // + badArg = ParseCommandLine(argc, argv); + if (badArg) + { + wprintf(L"Unknown argument: %s\n", argv[badArg]); + Usage(argv[0]); + return -1; + } + + // + // Get the drive's format + // + if (!Drive) + { + if (!GetCurrentDirectoryW(ARRAYSIZE(CurrentDirectory), CurrentDirectory)) + { + PrintWin32Error(L"Could not get current directory", GetLastError()); + return -1; + } + } + else + { + wcscpy(CurrentDirectory, Drive); + } + CurrentDirectory[2] = L'\\'; + CurrentDirectory[3] = L'\0'; + Drive = CurrentDirectory; + + // + // Determine the drive's file system format, which we need to + // tell chkdsk + // + if (!GetVolumeInformationW(Drive, + volumeName, + ARRAYSIZE(volumeName), + &serialNumber, + &maxComponent, + &flags, + fileSystem, + ARRAYSIZE(fileSystem))) + { + PrintWin32Error(L"Could not query volume", GetLastError()); + return -1; + } + + // + // If they want to fix, we need to have access to the drive + // + if (FixErrors) + { + swprintf(volumeName, L"\\\\.\\%C:", Drive[0]); + volumeHandle = CreateFileW(volumeName, + GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + 0); + if (volumeHandle == INVALID_HANDLE_VALUE) + { + wprintf(L"Chdskx cannot run because the volume is in use by another process.\n\n"); + return -1; + } + CloseHandle(volumeHandle); + + // + // Can't let the user break out of a chkdsk that can modify the drive + // + SetConsoleCtrlHandler(CtrlCIntercept, TRUE); + } + + // + // Just do it + // + wprintf(L"The type of file system is %s.\n", fileSystem); + Chkdsk(Drive, + fileSystem, + FixErrors, + Verbose, + SkipClean, + ScanSectors, + NULL, + NULL, + ChkdskCallback); + + if (Error) return -1; + return 0; } /* EOF */ Modified: trunk/reactos/base/system/chkdsk/chkdsk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/chkdsk/chkdsk.…
============================================================================== --- trunk/reactos/base/system/chkdsk/chkdsk.rc [iso-8859-1] (original) +++ trunk/reactos/base/system/chkdsk/chkdsk.rc [iso-8859-1] Wed Mar 2 22:05:19 2016 @@ -1,6 +1,6 @@ -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Disk Checking Utility\0" -#define REACTOS_STR_INTERNAL_NAME "chkdsk\0" -#define REACTOS_STR_ORIGINAL_FILENAME "chkdsk.exe\0" -#define REACTOS_STR_ORIGINAL_COPYRIGHT "1998 Mark Russinovich\0" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Disk Checking Utility" +#define REACTOS_STR_INTERNAL_NAME "chkdsk" +#define REACTOS_STR_ORIGINAL_FILENAME "chkdsk.exe" +#define REACTOS_STR_ORIGINAL_COPYRIGHT "1998 Mark Russinovich" #include <reactos/version.rc>
8 years, 8 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
26
27
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
Results per page:
10
25
50
100
200