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
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
List overview
Download
Ros-diffs
March 2010
----- 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
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[janderwald] 45747: [DXSDK] - Add BDA types
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Mar 1 19:55:11 2010 New Revision: 45747 URL:
http://svn.reactos.org/svn/reactos?rev=45747&view=rev
Log: [DXSDK] - Add BDA types Modified: trunk/reactos/include/dxsdk/bdamedia.h Modified: trunk/reactos/include/dxsdk/bdamedia.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/dxsdk/bdamedia.h?r…
============================================================================== --- trunk/reactos/include/dxsdk/bdamedia.h [iso-8859-1] (original) +++ trunk/reactos/include/dxsdk/bdamedia.h [iso-8859-1] Mon Mar 1 19:55:11 2010 @@ -317,4 +317,73 @@ }KSPROPERTY_BDA_SIGNAL_STATS; +/* ------------------------------------------------------------ + BDA Stream Format GUIDs +*/ + +#define STATIC_KSDATAFORMAT_TYPE_BDA_ANTENNA\ + 0x71985f41, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 +DEFINE_GUIDSTRUCT("71985F41-1CA1-11d3-9CC8-00C04F7971E0", KSDATAFORMAT_TYPE_BDA_ANTENNA); +#define KSDATAFORMAT_TYPE_BDA_ANTENNA DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_ANTENNA) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT\ + 0xf4aeb342, 0x0329, 0x4fdd, 0xa8, 0xfd, 0x4a, 0xff, 0x49, 0x26, 0xc9, 0x78 +DEFINE_GUIDSTRUCT("F4AEB342-0329-4fdd-A8FD-4AFF4926C978", KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT); +#define KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_MPEG2_TRANSPORT) + + +#define STATIC_KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT\ + 0x8deda6fd, 0xac5f, 0x4334, 0x8e, 0xcf, 0xa4, 0xba, 0x8f, 0xa7, 0xd0, 0xf0 +DEFINE_GUIDSTRUCT("8DEDA6FD-AC5F-4334-8ECF-A4BA8FA7D0F0", KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT); +#define KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_BDA_TRANSPORT) + + +#define STATIC_KSDATAFORMAT_TYPE_BDA_IF_SIGNAL\ + 0x61be0b47, 0xa5eb, 0x499b, 0x9a, 0x85, 0x5b, 0x16, 0xc0, 0x7f, 0x12, 0x58 +DEFINE_GUIDSTRUCT("61BE0B47-A5EB-499b-9A85-5B16C07F1258", KSDATAFORMAT_TYPE_BDA_IF_SIGNAL); +#define KSDATAFORMAT_TYPE_BDA_IF_SIGNAL DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_BDA_IF_SIGNAL) + + +#define STATIC_KSDATAFORMAT_TYPE_MPEG2_SECTIONS\ + 0x455f176c, 0x4b06, 0x47ce, 0x9a, 0xef, 0x8c, 0xae, 0xf7, 0x3d, 0xf7, 0xb5 +DEFINE_GUIDSTRUCT("455F176C-4B06-47CE-9AEF-8CAEF73DF7B5", KSDATAFORMAT_TYPE_MPEG2_SECTIONS); +#define KSDATAFORMAT_TYPE_MPEG2_SECTIONS DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_SECTIONS) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_ATSC_SI\ + 0xb3c7397c, 0xd303, 0x414d, 0xb3, 0x3c, 0x4e, 0xd2, 0xc9, 0xd2, 0x97, 0x33 +DEFINE_GUIDSTRUCT("B3C7397C-D303-414D-B33C-4ED2C9D29733", KSDATAFORMAT_SUBTYPE_ATSC_SI); +#define KSDATAFORMAT_SUBTYPE_ATSC_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ATSC_SI) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_DVB_SI\ + 0xe9dd31a3, 0x221d, 0x4adb, 0x85, 0x32, 0x9a, 0xf3, 0x9, 0xc1, 0xa4, 0x8 +DEFINE_GUIDSTRUCT("e9dd31a3-221d-4adb-8532-9af309c1a408", KSDATAFORMAT_SUBTYPE_DVB_SI); +#define KSDATAFORMAT_SUBTYPE_DVB_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVB_SI) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP\ + 0x762e3f66, 0x336f, 0x48d1, 0xbf, 0x83, 0x2b, 0x0, 0x35, 0x2c, 0x11, 0xf0 +DEFINE_GUIDSTRUCT("762E3F66-336F-48d1-BF83-2B00352C11F0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP); +#define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_PSIP) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP\ + 0x951727db, 0xd2ce, 0x4528, 0x96, 0xf6, 0x33, 0x1, 0xfa, 0xbb, 0x2d, 0xe0 +DEFINE_GUIDSTRUCT("951727DB-D2CE-4528-96F6-3301FABB2DE0", KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP); +#define KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_BDA_OPENCABLE_OOB_PSIP) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_ISDB_SI\ + 0x4a2eeb99, 0x6458, 0x4538, 0xb1, 0x87, 0x04, 0x01, 0x7c, 0x41, 0x41, 0x3f +DEFINE_GUIDSTRUCT("4a2eeb99-6458-4538-b187-04017c41413f", KSDATAFORMAT_SUBTYPE_ISDB_SI); +#define KSDATAFORMAT_SUBTYPE_ISDB_SI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ISDB_SI) + + +#define STATIC_KSDATAFORMAT_SUBTYPE_PBDA_TRANSPORT_RAW\ + 0x0d7aed42, 0xcb9a, 0x11db, 0x97, 0x05, 0x00, 0x50, 0x56, 0xc0, 0x00, 0x08 +DEFINE_GUIDSTRUCT("0d7AED42-CB9A-11DB-9705-005056C00008", KSDATAFORMAT_SUBTYPE_PBDA_TRANSPORT_RAW); +#define KSDATAFORMAT_SUBTYPE_PBDA_TRANSPORT_RAW DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_PBDA_TRANSPORT_RAW) + #endif
14 years, 9 months
1
0
0
0
[janderwald] 45746: [BDAPLGIN] - Implement IBDA_PinControl::GetPinID, IBDA_PinControl::GetPinType - Comment out enumeration of IBDA_NetworkProvider [MSDVBNP] - Start implementing Network Provider for MPEG-2 based Networks [MSVIDCTL] - Start implementing ActiveX Control for Streaming Video
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Mar 1 16:28:28 2010 New Revision: 45746 URL:
http://svn.reactos.org/svn/reactos?rev=45746&view=rev
Log: [BDAPLGIN] - Implement IBDA_PinControl::GetPinID, IBDA_PinControl::GetPinType - Comment out enumeration of IBDA_NetworkProvider [MSDVBNP] - Start implementing Network Provider for MPEG-2 based Networks [MSVIDCTL] - Start implementing ActiveX Control for Streaming Video Added: trunk/reactos/dll/directx/msdvbnp/ (with props) trunk/reactos/dll/directx/msdvbnp/classfactory.cpp (with props) trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp (with props) trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild (with props) trunk/reactos/dll/directx/msdvbnp/msdvbnp.rc (with props) trunk/reactos/dll/directx/msdvbnp/msdvbnp.spec (with props) trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp (with props) trunk/reactos/dll/directx/msdvbnp/precomp.h (with props) trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp (with props) trunk/reactos/dll/directx/msvidctl/ (with props) trunk/reactos/dll/directx/msvidctl/classfactory.cpp (with props) trunk/reactos/dll/directx/msvidctl/enumtuningspaces.cpp (with props) trunk/reactos/dll/directx/msvidctl/msvidctl.cpp (with props) trunk/reactos/dll/directx/msvidctl/msvidctl.rbuild (with props) trunk/reactos/dll/directx/msvidctl/msvidctl.rc (with props) trunk/reactos/dll/directx/msvidctl/msvidctl.spec (with props) trunk/reactos/dll/directx/msvidctl/precomp.h (with props) trunk/reactos/dll/directx/msvidctl/tunerequest.cpp (with props) trunk/reactos/dll/directx/msvidctl/tuningspace.cpp (with props) trunk/reactos/dll/directx/msvidctl/tuningspace_container.cpp (with props) Modified: trunk/reactos/dll/directx/bdaplgin/devicecontrol.cpp trunk/reactos/dll/directx/bdaplgin/pincontrol.cpp trunk/reactos/dll/directx/bdaplgin/precomp.h Modified: trunk/reactos/dll/directx/bdaplgin/devicecontrol.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/bdaplgin/devic…
============================================================================== --- trunk/reactos/dll/directx/bdaplgin/devicecontrol.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/bdaplgin/devicecontrol.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -469,7 +469,7 @@ #ifdef BDAPLGIN_TRACE WCHAR Buffer[100]; - swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu Dummy %lu\n", hr, BytesReturned, PinId, Dummy); + swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu\n", hr, BytesReturned, PinId); OutputDebugStringW(Buffer); #endif Modified: trunk/reactos/dll/directx/bdaplgin/pincontrol.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/bdaplgin/pinco…
============================================================================== --- trunk/reactos/dll/directx/bdaplgin/pincontrol.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/directx/bdaplgin/pincontrol.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -9,7 +9,8 @@ #include "precomp.h" -const GUID IID_IBDA_PinControl = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}}; +const GUID IID_IBDA_PinControl = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}}; +const GUID KSPROPSETID_BdaPinControl = {0x0ded49d5, 0xa8b7, 0x4d5d, {0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d}}; const GUID IID_IPin = {0x56a86891, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}}; class CBDAPinControl : public IBDA_PinControl @@ -39,7 +40,11 @@ CBDAPinControl(HANDLE hFile, IBDA_NetworkProvider * pProvider, IPin * pConnectedPin) : m_Ref(0), m_Handle(hFile), m_pProvider(pProvider), m_pConnectedPin(pConnectedPin){}; - virtual ~CBDAPinControl(){}; + virtual ~CBDAPinControl() + { + //m_pConnectedPin->Release(); + //m_pProvider->Release(); + }; protected: LONG m_Ref; @@ -67,6 +72,16 @@ return NOERROR; } +#ifdef BDAPLGIN_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CBDAPinControl::QueryInterface: NoInterface for %s", lpstr); + DebugBreak(); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); +#endif + return E_NOINTERFACE; } //------------------------------------------------------------------- @@ -76,22 +91,50 @@ STDMETHODCALLTYPE CBDAPinControl::GetPinID(ULONG *pulPinID) { -#ifdef BDAPLGIN_TRACE - OutputDebugStringW(L"CBDAPinControl::GetPinID: NotImplemented\n"); -#endif - - return E_NOTIMPL; + KSPROPERTY Property; + ULONG BytesReturned; + HRESULT hr; + + // setup request + Property.Set = KSPROPSETID_BdaPinControl; + Property.Id = KSPROPERTY_BDA_PIN_ID; + Property.Flags = KSPROPERTY_TYPE_GET; + + // perform request + hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), pulPinID, sizeof(ULONG), &BytesReturned); + +#ifdef BDAPLGIN_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CBDAPinControl::GetPinID: hr %lx pulPinID %lu BytesReturned %lx\n", hr, *pulPinID, BytesReturned); + OutputDebugStringW(Buffer); +#endif + + return hr; } HRESULT STDMETHODCALLTYPE CBDAPinControl::GetPinType(ULONG *pulPinType) { -#ifdef BDAPLGIN_TRACE - OutputDebugStringW(L"CBDAPinControl::GetPinType: NotImplemented\n"); -#endif - - return E_NOTIMPL; + KSPROPERTY Property; + ULONG BytesReturned; + HRESULT hr; + + // setup request + Property.Set = KSPROPSETID_BdaPinControl; + Property.Id = KSPROPERTY_BDA_PIN_TYPE; + Property.Flags = KSPROPERTY_TYPE_GET; + + // perform request + hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), pulPinType, sizeof(ULONG), &BytesReturned); + +#ifdef BDAPLGIN_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CBDAPinControl::GetPinType: hr %lx pulPinType %lu BytesReturned %lx\n", hr, *pulPinType, BytesReturned); + OutputDebugStringW(Buffer); +#endif + + return hr; } HRESULT @@ -112,15 +155,29 @@ REFIID riid, LPVOID * ppv) { + IPin * pConnectedPin = NULL; + IBDA_NetworkProvider * pNetworkProvider = NULL; + HANDLE hFile = INVALID_HANDLE_VALUE; + +#if 0 + if (!IsEqualGUID(riid, IID_IUnknown)) + { +#ifdef BDAPLGIN_TRACE + OutputDebugStringW(L"CBDAPinControl_fnConstructor: Expected IUnknown\n"); +#endif + return REGDB_E_CLASSNOTREG; + } + + HRESULT hr; IKsObject * pObject = NULL; - IPin * pPin = NULL, * pConnectedPin = NULL; + IPin * pPin = NULL; IEnumFilters *pEnumFilters = NULL; - IBDA_NetworkProvider * pNetworkProvider = NULL; + IBaseFilter * ppFilter[1]; PIN_INFO PinInfo; FILTER_INFO FilterInfo; - HANDLE hFile = INVALID_HANDLE_VALUE; + if (!pUnkOuter) return E_POINTER; @@ -225,6 +282,7 @@ // no network provider interface in graph return E_NOINTERFACE; } +#endif CBDAPinControl * handler = new CBDAPinControl(hFile, pNetworkProvider, pConnectedPin); Modified: trunk/reactos/dll/directx/bdaplgin/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/bdaplgin/preco…
============================================================================== --- trunk/reactos/dll/directx/bdaplgin/precomp.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/bdaplgin/precomp.h [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,6 +1,7 @@ #ifndef PRECOMP_H__ #define PRECOMP_H__ +#define BDAPLGIN_TRACE #define BUILDING_KS #define _KSDDK_ #include <dshow.h> Propchange: trunk/reactos/dll/directx/msdvbnp/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Mar 1 16:28:28 2010 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/directx/msdvbnp/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/directx/msdvbnp/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/directx/msdvbnp/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/directx/msdvbnp/classfactory.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/classf…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/classfactory.cpp (added) +++ trunk/reactos/dll/directx/msdvbnp/classfactory.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,105 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msdvbnp/classfactory.cpp + * PURPOSE: IClassFactory interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; +const GUID IID_IClassFactory = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; + +class CClassFactory : public IClassFactory +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + delete this; + return 0; + } + return m_Ref; + } + + HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject); + HRESULT WINAPI LockServer(BOOL fLock); + + CClassFactory(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst) : m_Ref(1), m_lpfnCI(lpfnCI), m_IID(riidInst) + {}; + + virtual ~CClassFactory(){}; + +protected: + LONG m_Ref; + LPFNCREATEINSTANCE m_lpfnCI; + IID * m_IID; +}; + +HRESULT +WINAPI +CClassFactory::QueryInterface( + REFIID riid, + LPVOID *ppvObj) +{ + *ppvObj = NULL; + if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory)) + { + *ppvObj = PVOID(this); + InterlockedIncrement(&m_Ref); + return S_OK; + } + return E_NOINTERFACE; +} + +HRESULT +WINAPI +CClassFactory::CreateInstance( + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObject) +{ + *ppvObject = NULL; + + if ( m_IID == NULL || IsEqualCLSID(riid, *m_IID) || IsEqualCLSID(riid, IID_IUnknown)) + { + return m_lpfnCI(pUnkOuter, riid, ppvObject); + } + + return E_NOINTERFACE; +} + +HRESULT +WINAPI +CClassFactory::LockServer( + BOOL fLock) +{ + return E_NOTIMPL; +} + +IClassFactory * +CClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + IID * riidInst) +{ + CClassFactory* factory = new CClassFactory(lpfnCI, pcRefDll, riidInst); + + if (!factory) + return NULL; + + if (pcRefDll) + InterlockedIncrement(pcRefDll); + + return (LPCLASSFACTORY)factory; +} Propchange: trunk/reactos/dll/directx/msdvbnp/classfactory.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp (added) +++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,108 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Network Provider for MPEG2 based networks + * FILE: dll/directx/msdvbnp/msdvbnp.cpp + * PURPOSE: COM Initialization + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ + +#include "precomp.h" + +const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}}; + +static INTERFACE_TABLE InterfaceTable[] = +{ + {&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor}, + {NULL, NULL} +}; + +extern "C" +BOOL +WINAPI +DllMain( + HINSTANCE hInstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + CoInitialize(NULL); + +#ifdef MSDVBNP_TRACE + OutputDebugStringW(L"MSDVBNP::DllMain()\n"); +#endif + + DisableThreadLibraryCalls(hInstDLL); + break; + default: + break; + } + + return TRUE; +} + + +extern "C" +KSDDKAPI +HRESULT +WINAPI +DllUnregisterServer(void) +{ + return S_OK; +} + +extern "C" +KSDDKAPI +HRESULT +WINAPI +DllRegisterServer(void) +{ + return S_OK; +} + +KSDDKAPI +HRESULT +WINAPI +DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID *ppv) +{ + UINT i; + HRESULT hres = E_OUTOFMEMORY; + IClassFactory * pcf = NULL; + + if (!ppv) + return E_INVALIDARG; + + *ppv = NULL; + + for (i = 0; InterfaceTable[i].riid; i++) + { + if (IsEqualIID(*InterfaceTable[i].riid, rclsid)) + { + pcf = CClassFactory_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL); + break; + } + } + + if (!pcf) + { + return CLASS_E_CLASSNOTAVAILABLE; + } + + hres = pcf->QueryInterface(riid, ppv); + pcf->Release(); + + return hres; +} + +KSDDKAPI +HRESULT +WINAPI +DllCanUnloadNow(void) +{ + return S_OK; +} Propchange: trunk/reactos/dll/directx/msdvbnp/msdvbnp.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild (added) +++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,28 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="msdvbnp" type="win32dll" baseaddress="${BASEADDRESS_MSDVBNP}" installbase="system32" installname="msdvbnp.ax"> + <importlibrary definition="msdvbnp.spec" /> + <include base="msdvbnp">.</include> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>ole32</library> + <library>advapi32</library> + <library>msvcrt</library> + <library>strmiids</library> + <group compilerset="gcc"> + <compilerflag compiler="cxx">-fno-exceptions</compilerflag> + <compilerflag compiler="cxx">-fno-rtti</compilerflag> + </group> + <group compilerset="msc"> + <compilerflag compiler="cxx">/GR-</compilerflag> + </group> + + <file>classfactory.cpp</file> + <file>msdvbnp.cpp</file> + <file>msdvbnp.rc</file> + <file>networkprovider.cpp</file> + <file>scanningtuner.cpp</file> +</module> +</group> Propchange: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/msdvbnp.rc (added) +++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.rc [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,12 @@ +#include <windows.h> + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Network Provider for MPEG2 based networks\0" +#define REACTOS_STR_INTERNAL_NAME "MSDvBNP.ax\0" +#define REACTOS_STR_ORIGINAL_FILENAME "MSDvBNP.ax\0" +#define REACTOS_STR_PRODUCT_VERSION "6.5.2600.3264\0" +#define REACTOS_STR_FILE_VERSION "6.5.2600.3264\0" + +#include <reactos/version.rc> Propchange: trunk/reactos/dll/directx/msdvbnp/msdvbnp.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/msdvbnp.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/msdvbn…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/msdvbnp.spec (added) +++ trunk/reactos/dll/directx/msdvbnp/msdvbnp.spec [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,4 @@ +@ stdcall DllCanUnloadNow() +@ stdcall DllGetClassObject(ptr ptr ptr) +@ stdcall DllRegisterServer() +@ stdcall DllUnregisterServer() Propchange: trunk/reactos/dll/directx/msdvbnp/msdvbnp.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/networ…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp (added) +++ trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,350 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Network Provider for MPEG2 based networks + * FILE: dll/directx/msdvbnp/networkprovider.cpp + * PURPOSE: IBDA_NetworkProvider interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +class CNetworkProvider : public IBaseFilter, + public IAMovieSetup, + public IBDA_NetworkProvider +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + delete this; + return 0; + } + return m_Ref; + } + + // IBaseFilter methods + HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID); + HRESULT STDMETHODCALLTYPE Stop( void); + HRESULT STDMETHODCALLTYPE Pause( void); + HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME tStart); + HRESULT STDMETHODCALLTYPE GetState(DWORD dwMilliSecsTimeout, FILTER_STATE *State); + HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *pClock); + HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock **pClock); + HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins **ppEnum); + HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR Id, IPin **ppPin); + HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO *pInfo); + HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph *pGraph, LPCWSTR pName); + HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR *pVendorInfo); + + //IAMovieSetup methods + HRESULT STDMETHODCALLTYPE Register( void); + HRESULT STDMETHODCALLTYPE Unregister( void); + + //IBDA_NetworkProvider methods + HRESULT STDMETHODCALLTYPE PutSignalSource(ULONG ulSignalSource); + HRESULT STDMETHODCALLTYPE GetSignalSource(ULONG *pulSignalSource); + HRESULT STDMETHODCALLTYPE GetNetworkType(GUID *pguidNetworkType); + HRESULT STDMETHODCALLTYPE PutTuningSpace(REFGUID guidTuningSpace); + HRESULT STDMETHODCALLTYPE GetTuningSpace(GUID *pguidTuingSpace); + HRESULT STDMETHODCALLTYPE RegisterDeviceFilter(IUnknown *pUnkFilterControl, ULONG *ppvRegisitrationContext); + HRESULT STDMETHODCALLTYPE UnRegisterDeviceFilter(ULONG pvRegistrationContext); + + CNetworkProvider() : m_Ref(0), m_pGraph(0){}; + virtual ~CNetworkProvider(){}; + +protected: + LONG m_Ref; + IFilterGraph *m_pGraph; +}; + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + if (IsEqualGUID(refiid, IID_IBaseFilter)) + { + *Output = (IBaseFilter*)(this); + reinterpret_cast<IBaseFilter*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_ITuner) || + IsEqualGUID(refiid, IID_IScanningTuner)) + { + // construct scanning tuner + return CScanningTunner_fnConstructor(NULL, refiid, Output); + } + + + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s", lpstr); + DebugBreak(); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IBaseFilter interface +// + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetClassID( + CLSID *pClassID) +{ + OutputDebugStringW(L"CNetworkProvider::GetClassID : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::Stop() +{ + OutputDebugStringW(L"CNetworkProvider::Stop : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::Pause() +{ + OutputDebugStringW(L"CNetworkProvider::Pause : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::Run( + REFERENCE_TIME tStart) +{ + OutputDebugStringW(L"CNetworkProvider::Run : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetState( + DWORD dwMilliSecsTimeout, + FILTER_STATE *State) +{ + OutputDebugStringW(L"CNetworkProvider::GetState : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::SetSyncSource( + IReferenceClock *pClock) +{ + OutputDebugStringW(L"CNetworkProvider::SetSyncSource : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetSyncSource( + IReferenceClock **pClock) +{ + OutputDebugStringW(L"CNetworkProvider::GetSyncSource : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::EnumPins( + IEnumPins **ppEnum) +{ + OutputDebugStringW(L"CNetworkProvider::EnumPins : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::FindPin( + LPCWSTR Id, IPin **ppPin) +{ + OutputDebugStringW(L"CNetworkProvider::FindPin : NotImplemented\n"); + return E_NOTIMPL; +} + + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::QueryFilterInfo( + FILTER_INFO *pInfo) +{ + OutputDebugStringW(L"CNetworkProvider::QueryFilterInfo : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::JoinFilterGraph( + IFilterGraph *pGraph, + LPCWSTR pName) +{ + if (pGraph) + { + // joining filter graph + m_pGraph = pGraph; + } + else + { + // leaving graph + m_pGraph = 0; + } + + OutputDebugStringW(L"CNetworkProvider::JoinFilterGraph\n"); + return S_OK; +} + + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::QueryVendorInfo( + LPWSTR *pVendorInfo) +{ + OutputDebugStringW(L"CNetworkProvider::QueryVendorInfo : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IAMovieSetup interface +// + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::Register() +{ + OutputDebugStringW(L"CNetworkProvider::Register : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::Unregister() +{ + OutputDebugStringW(L"CNetworkProvider::Unregister : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IBDA_NetworkProvider interface +// + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::PutSignalSource( + ULONG ulSignalSource) +{ + OutputDebugStringW(L"CNetworkProvider::PutSignalSource : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetSignalSource( + ULONG *pulSignalSource) +{ + OutputDebugStringW(L"CNetworkProvider::GetSignalSource : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetNetworkType( + GUID *pguidNetworkType) +{ + OutputDebugStringW(L"CNetworkProvider::GetNetworkType : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::PutTuningSpace( + REFGUID guidTuningSpace) +{ + OutputDebugStringW(L"CNetworkProvider::PutTuningSpace : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::GetTuningSpace( + GUID *pguidTuingSpace) +{ + OutputDebugStringW(L"CNetworkProvider::GetTuningSpace : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::RegisterDeviceFilter( + IUnknown *pUnkFilterControl, + ULONG *ppvRegisitrationContext) +{ + OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CNetworkProvider::UnRegisterDeviceFilter(ULONG pvRegistrationContext) +{ + OutputDebugStringW(L"CNetworkProvider::UnRegisterDeviceFilter : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +WINAPI +CNetworkProvider_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CNetworkProvider * handler = new CNetworkProvider(); + +#ifdef MSDVBNP_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CNetworkProvider_fnConstructor riid %s pUnknown %p", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!handler) + return E_OUTOFMEMORY; + + if (FAILED(handler->QueryInterface(riid, ppv))) + { + /* not supported */ + delete handler; + return E_NOINTERFACE; + } + OutputDebugStringW(L"CNetworkProvider_fnConstructor Success"); + return NOERROR; +} Propchange: trunk/reactos/dll/directx/msdvbnp/networkprovider.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/precom…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/precomp.h (added) +++ trunk/reactos/dll/directx/msdvbnp/precomp.h [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,54 @@ +#ifndef PRECOMP_H__ +#define PRECOMP_H__ + +#define MSDVBNP_TRACE +#define BUILDING_KS +#define _KSDDK_ +#include <dshow.h> +//#include <streams.h> +#include <ks.h> +#define __STREAMS__ +#include <ksproxy.h> +#include <stdio.h> +#include <wchar.h> +#include <tchar.h> +#include <uuids.h> +#include <bdatypes.h> +#include <bdaiface.h> +#include <bdamedia.h> +#include <tuner.h> +#include <assert.h> + +typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); + +typedef struct +{ + const GUID* riid; + LPFNCREATEINSTANCE lpfnCI; +} INTERFACE_TABLE; + +/* classfactory.cpp */ +IClassFactory * +CClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + IID * riidInst); + +/* networkprovider.cpp */ +HRESULT +WINAPI +CNetworkProvider_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv); + +/* scanningtunner.cpp */ +HRESULT +WINAPI +CScanningTunner_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv); + + +#endif Propchange: trunk/reactos/dll/directx/msdvbnp/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msdvbnp/scanni…
============================================================================== --- trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp (added) +++ trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,265 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Network Provider for MPEG2 based networks + * FILE: dll/directx/msdvbnp/networkprovider.cpp + * PURPOSE: IScanningTunner interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +class CScanningTunner : public IScanningTuner +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + delete this; + return 0; + } + return m_Ref; + } + + //ITuner methods + HRESULT STDMETHODCALLTYPE get_TuningSpace(ITuningSpace **TuningSpace); + HRESULT STDMETHODCALLTYPE put_TuningSpace(ITuningSpace *TuningSpace); + HRESULT STDMETHODCALLTYPE EnumTuningSpaces(IEnumTuningSpaces **ppEnum); + HRESULT STDMETHODCALLTYPE get_TuneRequest(ITuneRequest **TuneRequest); + HRESULT STDMETHODCALLTYPE put_TuneRequest(ITuneRequest *TuneRequest); + HRESULT STDMETHODCALLTYPE Validate(ITuneRequest *TuneRequest); + HRESULT STDMETHODCALLTYPE get_PreferredComponentTypes(IComponentTypes **ComponentTypes); + HRESULT STDMETHODCALLTYPE put_PreferredComponentTypes(IComponentTypes *ComponentTypes); + HRESULT STDMETHODCALLTYPE get_SignalStrength(long *Strength); + HRESULT STDMETHODCALLTYPE TriggerSignalEvents(long Interval); + + //IScanningTuner methods + HRESULT STDMETHODCALLTYPE SeekUp(); + HRESULT STDMETHODCALLTYPE SeekDown(); + HRESULT STDMETHODCALLTYPE ScanUp(long MillisecondsPause); + HRESULT STDMETHODCALLTYPE ScanDown(long MillisecondsPause); + HRESULT STDMETHODCALLTYPE AutoProgram(); + + CScanningTunner() : m_Ref(0), m_TuningSpace(0){}; + virtual ~CScanningTunner(){}; + +protected: + LONG m_Ref; + ITuningSpace * m_TuningSpace; +}; + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + if (IsEqualGUID(refiid, IID_ITuner)) + { + *Output = (ITuner*)(this); + reinterpret_cast<ITuner*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_IScanningTuner)) + { + *Output = (IScanningTuner*)(this); + reinterpret_cast<IScanningTuner*>(*Output)->AddRef(); + return NOERROR; + } + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CScanningTunner::QueryInterface: NoInterface for %s\n", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +//ITuner +// +HRESULT +STDMETHODCALLTYPE +CScanningTunner::get_TuningSpace( + ITuningSpace **TuningSpace) +{ + OutputDebugStringW(L"CScanningTunner::get_TuningSpace\n"); + + *TuningSpace = m_TuningSpace; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::put_TuningSpace( + ITuningSpace *TuningSpace) +{ + OutputDebugStringW(L"CScanningTunner::put_TuningSpace\n"); + m_TuningSpace = TuningSpace; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::EnumTuningSpaces( + IEnumTuningSpaces **ppEnum) +{ + OutputDebugStringW(L"CScanningTunner::EnumTuningSpaces : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::get_TuneRequest( + ITuneRequest **TuneRequest) +{ + OutputDebugStringW(L"CScanningTunner::get_TuneRequest : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::put_TuneRequest( + ITuneRequest *TuneRequest) +{ + OutputDebugStringW(L"CScanningTunner::put_TuneRequest : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::Validate( + ITuneRequest *TuneRequest) +{ + OutputDebugStringW(L"CScanningTunner::Validate : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::get_PreferredComponentTypes( + IComponentTypes **ComponentTypes) +{ + OutputDebugStringW(L"CScanningTunner::get_PreferredComponentTypes : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::put_PreferredComponentTypes( + IComponentTypes *ComponentTypes) +{ + OutputDebugStringW(L"CScanningTunner::put_PreferredComponentTypes : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::get_SignalStrength( + long *Strength) +{ + OutputDebugStringW(L"CScanningTunner::get_SignalStrength : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::TriggerSignalEvents( + long Interval) +{ + OutputDebugStringW(L"CScanningTunner::TriggerSignalEvents : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +//IScanningTuner +HRESULT +STDMETHODCALLTYPE +CScanningTunner::SeekUp() +{ + OutputDebugStringW(L"CScanningTunner::SeekUp : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::SeekDown() +{ + OutputDebugStringW(L"CScanningTunner::SeekDown : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::ScanUp( + long MillisecondsPause) +{ + OutputDebugStringW(L"CScanningTunner::ScanUp : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::ScanDown( + long MillisecondsPause) +{ + OutputDebugStringW(L"CScanningTunner::ScanDown : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CScanningTunner::AutoProgram() +{ + OutputDebugStringW(L"CScanningTunner::AutoProgram : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +WINAPI +CScanningTunner_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CScanningTunner * handler = new CScanningTunner(); + +#ifdef MSDVBNP_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!handler) + return E_OUTOFMEMORY; + + if (FAILED(handler->QueryInterface(riid, ppv))) + { + /* not supported */ + delete handler; + return E_NOINTERFACE; + } + + return NOERROR; +} Propchange: trunk/reactos/dll/directx/msdvbnp/scanningtuner.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/directx/msvidctl/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Mar 1 16:28:28 2010 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/dll/directx/msvidctl/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/dll/directx/msvidctl/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/dll/directx/msvidctl/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/dll/directx/msvidctl/classfactory.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/class…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/classfactory.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/classfactory.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,106 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msvidctl/classfactory.cpp + * PURPOSE: ClassFactory interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; +const GUID IID_IClassFactory = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; + +class CClassFactory : public IClassFactory +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + delete this; + return 0; + } + return m_Ref; + } + + HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject); + HRESULT WINAPI LockServer(BOOL fLock); + + CClassFactory(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst) : m_Ref(1), m_lpfnCI(lpfnCI), m_IID(riidInst) + {}; + + virtual ~CClassFactory(){}; + +protected: + LONG m_Ref; + LPFNCREATEINSTANCE m_lpfnCI; + IID * m_IID; +}; + +HRESULT +WINAPI +CClassFactory::QueryInterface( + REFIID riid, + LPVOID *ppvObj) +{ + *ppvObj = NULL; + if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory)) + { + *ppvObj = PVOID(this); + InterlockedIncrement(&m_Ref); + return S_OK; + } + return E_NOINTERFACE; +} + +HRESULT +WINAPI +CClassFactory::CreateInstance( + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObject) +{ + *ppvObject = NULL; + + if ( m_IID == NULL || IsEqualCLSID(riid, *m_IID) || IsEqualCLSID(riid, IID_IUnknown)) + { + return m_lpfnCI(pUnkOuter, riid, ppvObject); + } + + return E_NOINTERFACE; +} + +HRESULT +WINAPI +CClassFactory::LockServer( + BOOL fLock) +{ + return E_NOTIMPL; +} + +IClassFactory * +CClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + IID * riidInst) +{ + CClassFactory* factory = new CClassFactory(lpfnCI, pcRefDll, riidInst); + + if (!factory) + return NULL; + + if (pcRefDll) + InterlockedIncrement(pcRefDll); + + return (LPCLASSFACTORY)factory; +} + Propchange: trunk/reactos/dll/directx/msvidctl/classfactory.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/enumtuningspaces.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/enumt…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/enumtuningspaces.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/enumtuningspaces.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,142 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msvidctl/tuningspace.cpp + * PURPOSE: ITuningSpace interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +class CEnumTuningSpaces : public IEnumTuningSpaces +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + //delete this; + return 0; + } + return m_Ref; + } + + // IEnumTuningSpaces methods + HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched); + HRESULT STDMETHODCALLTYPE Skip(ULONG celt); + HRESULT STDMETHODCALLTYPE Reset(); + HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum); + + CEnumTuningSpaces() : m_Ref(0){}; + + virtual ~CEnumTuningSpaces(){}; + +protected: + LONG m_Ref; +}; + +HRESULT +STDMETHODCALLTYPE +CEnumTuningSpaces::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_IEnumTuningSpaces)) + { + *Output = (IEnumTuningSpaces*)this; + reinterpret_cast<IEnumTuningSpaces*>(*Output)->AddRef(); + return NOERROR; + } + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IEnumTuningSpaces +// +HRESULT +STDMETHODCALLTYPE +CEnumTuningSpaces::Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched) +{ + OutputDebugStringW(L"CEnumTuningSpaces::Next : stub\n"); + return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)rgelt); + +} + +HRESULT +STDMETHODCALLTYPE +CEnumTuningSpaces::Skip(ULONG celt) +{ + OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CEnumTuningSpaces::Reset() +{ + OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CEnumTuningSpaces::Clone(IEnumTuningSpaces **ppEnum) +{ + OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +WINAPI +CEnumTuningSpaces_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces(); + +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!tuningspaces) + return E_OUTOFMEMORY; + + if (FAILED(tuningspaces->QueryInterface(riid, ppv))) + { + /* not supported */ + delete tuningspaces; + return E_NOINTERFACE; + } + + return NOERROR; +} + Propchange: trunk/reactos/dll/directx/msvidctl/enumtuningspaces.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/msvidctl.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/msvid…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/msvidctl.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/msvidctl.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,106 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS DVB + * FILE: dll/directx/msvidctl/msvidctl.cpp + * PURPOSE: ReactOS DVB Initialization + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ + +#include "precomp.h" + +static INTERFACE_TABLE InterfaceTable[] = +{ + {&CLSID_SystemTuningSpaces, CTuningSpaceContainer_fnConstructor}, + {NULL, NULL} +}; + +extern "C" +BOOL +WINAPI +DllMain( + HINSTANCE hInstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + CoInitialize(NULL); + +#ifdef MSDVBNP_TRACE + OutputDebugStringW(L"MSVIDCTL::DllMain()\n"); +#endif + + DisableThreadLibraryCalls(hInstDLL); + break; + default: + break; + } + + return TRUE; +} + + +extern "C" +KSDDKAPI +HRESULT +WINAPI +DllUnregisterServer(void) +{ + return S_OK; +} + +extern "C" +KSDDKAPI +HRESULT +WINAPI +DllRegisterServer(void) +{ + return S_OK; +} + +KSDDKAPI +HRESULT +WINAPI +DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID *ppv) +{ + UINT i; + HRESULT hres = E_OUTOFMEMORY; + IClassFactory * pcf = NULL; + + if (!ppv) + return E_INVALIDARG; + + *ppv = NULL; + + for (i = 0; InterfaceTable[i].riid; i++) + { + if (IsEqualIID(*InterfaceTable[i].riid, rclsid)) + { + pcf = CClassFactory_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL); + break; + } + } + + if (!pcf) + { + return CLASS_E_CLASSNOTAVAILABLE; + } + + hres = pcf->QueryInterface(riid, ppv); + pcf->Release(); + + return hres; +} + +KSDDKAPI +HRESULT +WINAPI +DllCanUnloadNow(void) +{ + return S_OK; +} Propchange: trunk/reactos/dll/directx/msvidctl/msvidctl.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/msvidctl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/msvid…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/msvidctl.rbuild (added) +++ trunk/reactos/dll/directx/msvidctl/msvidctl.rbuild [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,30 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="msvidctl" type="win32dll" baseaddress="${BASEADDRESS_MSVIDCTL}" installbase="system32" installname="msvidctl.dll"> + <importlibrary definition="msvidctl.spec" /> + <include base="msvidctl">.</include> + <library>ntdll</library> + <library>kernel32</library> + <library>advapi32</library> + <library>ole32</library> + <library>advapi32</library> + <library>msvcrt</library> + <library>strmiids</library> + <group compilerset="gcc"> + <compilerflag compiler="cxx">-fno-exceptions</compilerflag> + <compilerflag compiler="cxx">-fno-rtti</compilerflag> + </group> + <group compilerset="msc"> + <compilerflag compiler="cxx">/GR-</compilerflag> + </group> + + <file>classfactory.cpp</file> + <file>enumtuningspaces.cpp</file> + <file>msvidctl.cpp</file> + <file>msvidctl.rc</file> + <file>tunerequest.cpp</file> + <file>tuningspace.cpp</file> + <file>tuningspace_container.cpp</file> +</module> +</group> Propchange: trunk/reactos/dll/directx/msvidctl/msvidctl.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/msvidctl.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/msvid…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/msvidctl.rc (added) +++ trunk/reactos/dll/directx/msvidctl/msvidctl.rc [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,12 @@ +#include <windows.h> + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS ActiveX Control for Streaming Video\0" +#define REACTOS_STR_INTERNAL_NAME "MSVidCtl\0" +#define REACTOS_STR_ORIGINAL_FILENAME "MSVidCtl\0" +#define REACTOS_STR_PRODUCT_VERSION "6.05.2600.3264\0" +#define REACTOS_STR_FILE_VERSION "6.05.2600.3264\0" + +#include <reactos/version.rc> Propchange: trunk/reactos/dll/directx/msvidctl/msvidctl.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/msvidctl.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/msvid…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/msvidctl.spec (added) +++ trunk/reactos/dll/directx/msvidctl/msvidctl.spec [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,4 @@ +@ stdcall DllCanUnloadNow() +@ stdcall DllGetClassObject(ptr ptr ptr) +@ stdcall DllRegisterServer() +@ stdcall DllUnregisterServer() Propchange: trunk/reactos/dll/directx/msvidctl/msvidctl.spec ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/preco…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/precomp.h (added) +++ trunk/reactos/dll/directx/msvidctl/precomp.h [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,72 @@ +#ifndef PRECOMP_H__ +#define PRECOMP_H__ + +#define MSVIDCTL_TRACE +#define BUILDING_KS +#define _KSDDK_ +#include <dshow.h> +//#include <streams.h> +#include <ks.h> +#define __STREAMS__ +#include <ksproxy.h> +#include <stdio.h> +#include <wchar.h> +#include <tchar.h> +#include <uuids.h> +#include <bdatypes.h> +#include <bdaiface.h> +#include <bdamedia.h> +#include <tuner.h> +#include <assert.h> + +typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); + +typedef struct +{ + const GUID* riid; + LPFNCREATEINSTANCE lpfnCI; +} INTERFACE_TABLE; + +/* classfactory.cpp */ +IClassFactory * +CClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + IID * riidInst); + +/* tuningspace_container.cpp */ +HRESULT +WINAPI +CTuningSpaceContainer_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv); + +/* tuningspace.cpp */ +HRESULT +WINAPI +CTuningSpace_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv); + +/* tunerequest.cpp */ +HRESULT +WINAPI +CTuneRequest_fnConstructor( + IUnknown *pUnknown, + ITuningSpace * TuningSpace, + REFIID riid, + LPVOID * ppv); + +/* enumtuningspaces.cpp */ +HRESULT +WINAPI +CEnumTuningSpaces_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv); + + + +#endif Propchange: trunk/reactos/dll/directx/msvidctl/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/tunerequest.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/tuner…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/tunerequest.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/tunerequest.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,331 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msvidctl/tuningspace.cpp + * PURPOSE: ITuningRequest interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +class CTuneRequest : public IDVBTuneRequest +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + OutputDebugStringW(L"CTuneRequest::Release : delete\n"); + + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace); + OutputDebugStringW(Buffer); + + + m_TuningSpace->Release(); + //delete this; + return 0; + } + return m_Ref; + } + + //IDispatch methods + HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + //ITuneRequest methods + HRESULT STDMETHODCALLTYPE get_TuningSpace(ITuningSpace **TuningSpace); + HRESULT STDMETHODCALLTYPE get_Components(IComponents **Components); + HRESULT STDMETHODCALLTYPE Clone(ITuneRequest **NewTuneRequest); + HRESULT STDMETHODCALLTYPE get_Locator(ILocator **Locator); + HRESULT STDMETHODCALLTYPE put_Locator(ILocator *Locator); + + //IDVBTuneRequest methods + HRESULT STDMETHODCALLTYPE get_ONID(long *ONID); + HRESULT STDMETHODCALLTYPE put_ONID(long ONID); + HRESULT STDMETHODCALLTYPE get_TSID(long *TSID); + HRESULT STDMETHODCALLTYPE put_TSID(long TSID); + HRESULT STDMETHODCALLTYPE get_SID(long *SID); + HRESULT STDMETHODCALLTYPE put_SID(long SID); + + CTuneRequest(ITuningSpace * TuningSpace) : m_Ref(0), m_ONID(-1), m_TSID(-1), m_SID(-1), m_Locator(0), m_TuningSpace(TuningSpace) + { + m_TuningSpace->AddRef(); + }; + + CTuneRequest(ITuningSpace * TuningSpace, LONG ONID, LONG TSID, LONG SID, ILocator * Locator) : m_Ref(1), m_ONID(ONID), m_TSID(TSID), m_SID(SID), m_Locator(Locator), m_TuningSpace(TuningSpace) + { + if (m_Locator) + m_Locator->AddRef(); + + m_TuningSpace->AddRef(); + }; + + virtual ~CTuneRequest(){}; + +protected: + LONG m_Ref; + LONG m_ONID; + LONG m_TSID; + LONG m_SID; + ILocator * m_Locator; + ITuningSpace * m_TuningSpace; +}; + + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_ITuneRequest)) + { + *Output = (ITuneRequest*)this; + reinterpret_cast<ITuneRequest*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_IDVBTuneRequest)) + { + *Output = (IDVBTuneRequest*)this; + reinterpret_cast<IDVBTuneRequest*>(*Output)->AddRef(); + return NOERROR; + } + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CTuneRequest::QueryInterface: NoInterface for %s", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IDispatch methods +// +HRESULT +STDMETHODCALLTYPE +CTuneRequest::GetTypeInfoCount(UINT *pctinfo) +{ + OutputDebugStringW(L"CTuneRequest::GetTypeInfoCount : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + OutputDebugStringW(L"CTuneRequest::GetTypeInfo : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuneRequest::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + OutputDebugStringW(L"CTuneRequest::GetIDsOfNames : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuneRequest::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + OutputDebugStringW(L"CTuneRequest::Invoke : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// ITuneRequest interface +// + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_TuningSpace(ITuningSpace **TuningSpace) +{ +#ifdef MSVIDCTL_TRACE + OutputDebugStringW(L"CTuneRequest::get_TuningSpace\n"); +#endif + + *TuningSpace = m_TuningSpace; + m_TuningSpace->AddRef(); + + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_Components(IComponents **Components) +{ + OutputDebugStringW(L"CTuneRequest::get_Components : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::Clone(ITuneRequest **NewTuneRequest) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuneRequest::Clone %p\n", NewTuneRequest); + OutputDebugStringW(Buffer); +#endif + + *NewTuneRequest = new CTuneRequest(m_TuningSpace, m_ONID, m_TSID, m_SID, m_Locator); + + if (!*NewTuneRequest) + return E_OUTOFMEMORY; + + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_Locator(ILocator **Locator) +{ + OutputDebugStringW(L"CTuneRequest::get_Locator : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::put_Locator(ILocator *Locator) +{ + OutputDebugStringW(L"CTuneRequest::put_Locator : stub\n"); + m_Locator = Locator; + + return S_OK; +} + +//------------------------------------------------------------------- +// IDVBTuneRequest interface +// + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_ONID(long *ONID) +{ +#ifdef MSVIDCTL_TRACE + OutputDebugStringW(L"CTuneRequest::get_ONID\n"); +#endif + + *ONID = m_ONID; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::put_ONID(long ONID) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuneRequest::put_ONID : %lu\n", ONID); + OutputDebugStringW(Buffer); +#endif + + m_ONID = ONID; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_TSID(long *TSID) +{ +#ifdef MSVIDCTL_TRACE + OutputDebugStringW(L"CTuneRequest::get_TSID\n"); +#endif + + *TSID = m_TSID; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::put_TSID(long TSID) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuneRequest::put_TSID : %lu\n", TSID); + OutputDebugStringW(Buffer); +#endif + + m_TSID = TSID; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::get_SID(long *SID) +{ +#ifdef MSVIDCTL_TRACE + OutputDebugStringW(L"CTuneRequest::get_SID\n"); +#endif + + *SID = m_SID; + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuneRequest::put_SID(long SID) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuneRequest::put_SID : %lu\n", SID); + OutputDebugStringW(Buffer); +#endif + + m_SID = SID; + return S_OK; +} + +HRESULT +WINAPI +CTuneRequest_fnConstructor( + IUnknown *pUnknown, + ITuningSpace * TuningSpace, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CTuneRequest * request = new CTuneRequest(TuningSpace); + +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!request) + return E_OUTOFMEMORY; + + if (FAILED(request->QueryInterface(riid, ppv))) + { + /* not supported */ + delete request; + return E_NOINTERFACE; + } + + return NOERROR; +} Propchange: trunk/reactos/dll/directx/msvidctl/tunerequest.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/tuningspace.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/tunin…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/tuningspace.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/tuningspace.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,365 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msvidctl/tuningspace.cpp + * PURPOSE: ITuningSpace interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#include "precomp.h" + +const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}}; + +class CTuningSpace : public IDVBTuningSpace +{ +public: + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuningSpace::Release : %p Ref %lu\n", this, m_Ref); + OutputDebugStringW(Buffer); + + if (!m_Ref) + { + //delete this; + return 0; + } + return m_Ref; + } + + // IDispatch methods + HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + + //ITuningSpace methods + HRESULT STDMETHODCALLTYPE get_UniqueName(BSTR *Name); + HRESULT STDMETHODCALLTYPE put_UniqueName(BSTR Name); + HRESULT STDMETHODCALLTYPE get_FriendlyName(BSTR *Name); + HRESULT STDMETHODCALLTYPE put_FriendlyName(BSTR Name); + HRESULT STDMETHODCALLTYPE get_CLSID(BSTR *SpaceCLSID); + HRESULT STDMETHODCALLTYPE get_NetworkType(BSTR *NetworkTypeGuid); + HRESULT STDMETHODCALLTYPE put_NetworkType(BSTR NetworkTypeGuid); + HRESULT STDMETHODCALLTYPE get__NetworkType(GUID *NetworkTypeGuid); + HRESULT STDMETHODCALLTYPE put__NetworkType(REFCLSID NetworkTypeGuid); + HRESULT STDMETHODCALLTYPE CreateTuneRequest(ITuneRequest **TuneRequest); + HRESULT STDMETHODCALLTYPE EnumCategoryGUIDs(IEnumGUID **ppEnum); + HRESULT STDMETHODCALLTYPE EnumDeviceMonikers(IEnumMoniker **ppEnum); + HRESULT STDMETHODCALLTYPE get_DefaultPreferredComponentTypes(IComponentTypes **ComponentTypes); + HRESULT STDMETHODCALLTYPE put_DefaultPreferredComponentTypes(IComponentTypes *NewComponentTypes); + HRESULT STDMETHODCALLTYPE get_FrequencyMapping(BSTR *pMapping); + HRESULT STDMETHODCALLTYPE put_FrequencyMapping(BSTR Mapping); + HRESULT STDMETHODCALLTYPE get_DefaultLocator(ILocator **LocatorVal); + HRESULT STDMETHODCALLTYPE put_DefaultLocator(ILocator *LocatorVal); + HRESULT STDMETHODCALLTYPE Clone(ITuningSpace **NewTS); + // IDVBTuningSpace + HRESULT STDMETHODCALLTYPE get_SystemType(DVBSystemType *SysType); + HRESULT STDMETHODCALLTYPE put_SystemType(DVBSystemType SysType); + + CTuningSpace() : m_Ref(0){}; + + virtual ~CTuningSpace(){}; + +protected: + LONG m_Ref; +}; + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_ITuningSpace)) + { + *Output = (ITuningSpace*)this; + reinterpret_cast<ITuningSpace*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_IDVBTuningSpace)) + { + *Output = (IDVBTuningSpace*)this; + reinterpret_cast<IDVBTuningSpace*>(*Output)->AddRef(); + return NOERROR; + } + + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CTuningSpace::QueryInterface: NoInterface for %s", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IDispatch methods +// +HRESULT +STDMETHODCALLTYPE +CTuningSpace::GetTypeInfoCount(UINT *pctinfo) +{ + OutputDebugStringW(L"CTuningSpace::GetTypeInfoCount : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + OutputDebugStringW(L"CTuningSpace::GetTypeInfo : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpace::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + OutputDebugStringW(L"CTuningSpace::GetIDsOfNames : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpace::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + OutputDebugStringW(L"CTuningSpace::Invoke : NotImplemented\n"); + return E_NOTIMPL; +} + + +//------------------------------------------------------------------- +// ITuningSpace interface +// + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_UniqueName(BSTR *Name) +{ + OutputDebugStringW(L"CTuningSpace::get_UniqueName : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_UniqueName(BSTR Name) +{ + OutputDebugStringW(L"CTuningSpace::put_UniqueName : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_FriendlyName(BSTR *Name) +{ + OutputDebugStringW(L"CTuningSpace::get_FriendlyName : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_FriendlyName(BSTR Name) +{ + OutputDebugStringW(L"CTuningSpace::put_FriendlyName : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_CLSID(BSTR *SpaceCLSID) +{ + OutputDebugStringW(L"CTuningSpace::get_CLSID : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_NetworkType(BSTR *NetworkTypeGuid) +{ + OutputDebugStringW(L"CTuningSpace::get_NetworkType : stub\n"); + return StringFromCLSID(CLSID_DVBTNetworkProvider, (LPOLESTR*)NetworkTypeGuid); + +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_NetworkType(BSTR NetworkTypeGuid) +{ + OutputDebugStringW(L"CTuningSpace::put_NetworkType : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get__NetworkType(GUID *NetworkTypeGuid) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuningSpace::get__NetworkType : %p stub\n", NetworkTypeGuid); + OutputDebugStringW(Buffer); +#endif + + CopyMemory(NetworkTypeGuid, &CLSID_DVBTNetworkProvider, sizeof(GUID)); + OutputDebugStringW(L"CTuningSpace::get__NetworkType : done\n"); + return S_OK; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put__NetworkType(REFCLSID NetworkTypeGuid) +{ + OutputDebugStringW(L"CTuningSpace::put__NetworkType : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::CreateTuneRequest(ITuneRequest **TuneRequest) +{ + OutputDebugStringW(L"CTuningSpace::CreateTuneRequest : stub\n"); + return CTuneRequest_fnConstructor(NULL, (ITuningSpace*)this, IID_ITuneRequest, (void**)TuneRequest); +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::EnumCategoryGUIDs(IEnumGUID **ppEnum) +{ + OutputDebugStringW(L"CTuningSpace::EnumCategoryGUIDs : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::EnumDeviceMonikers(IEnumMoniker **ppEnum) +{ + OutputDebugStringW(L"CTuningSpace::EnumDeviceMonikers : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_DefaultPreferredComponentTypes(IComponentTypes **ComponentTypes) +{ + OutputDebugStringW(L"CTuningSpace::get_DefaultPreferredComponentTypes : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_DefaultPreferredComponentTypes(IComponentTypes *NewComponentTypes) +{ + OutputDebugStringW(L"CTuningSpace::put_DefaultPreferredComponentTypes : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_FrequencyMapping(BSTR *pMapping) +{ + OutputDebugStringW(L"CTuningSpace::get_FrequencyMapping : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_FrequencyMapping(BSTR Mapping) +{ + OutputDebugStringW(L"CTuningSpace::put_FrequencyMapping : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_DefaultLocator(ILocator **LocatorVal) +{ + OutputDebugStringW(L"CTuningSpace::get_DefaultLocator : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_DefaultLocator(ILocator *LocatorVal) +{ + OutputDebugStringW(L"CTuningSpace::put_DefaultLocator : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::Clone(ITuningSpace **NewTS) +{ + OutputDebugStringW(L"CTuningSpace::Clone : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// IDVBTuningSpace +// +HRESULT +STDMETHODCALLTYPE +CTuningSpace::get_SystemType(DVBSystemType *SysType) +{ + OutputDebugStringW(L"CTuningSpace::get_SystemType : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpace::put_SystemType(DVBSystemType SysType) +{ + OutputDebugStringW(L"CTuningSpace::put_SystemType : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +WINAPI +CTuningSpace_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CTuningSpace * space = new CTuningSpace(); + +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CTuningSpace_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!space) + return E_OUTOFMEMORY; + + if (FAILED(space->QueryInterface(riid, ppv))) + { + /* not supported */ + delete space; + return E_NOINTERFACE; + } + + return NOERROR; +} + + Propchange: trunk/reactos/dll/directx/msvidctl/tuningspace.cpp ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/directx/msvidctl/tuningspace_container.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/msvidctl/tunin…
============================================================================== --- trunk/reactos/dll/directx/msvidctl/tuningspace_container.cpp (added) +++ trunk/reactos/dll/directx/msvidctl/tuningspace_container.cpp [iso-8859-1] Mon Mar 1 16:28:28 2010 @@ -1,0 +1,272 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS BDA Proxy + * FILE: dll/directx/msvidctl/tuningspace_container.cpp + * PURPOSE: ITuningSpaceContainer interface + * + * PROGRAMMERS: Johannes Anderwald (janderwald(a)reactos.org) + */ +#define _FORCENAMELESSUNION +#include "precomp.h" + + +class CTuningSpaceContainer : public ITuningSpaceContainer +{ +public: + + STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); + + STDMETHODIMP_(ULONG) AddRef() + { + InterlockedIncrement(&m_Ref); + return m_Ref; + } + STDMETHODIMP_(ULONG) Release() + { + InterlockedDecrement(&m_Ref); + if (!m_Ref) + { + OutputDebugStringW(L"CTuningSpaceContainer::Release : delete\n"); + //delete this; + return 0; + } + return m_Ref; + } + + // IDispatch methods + HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); + HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); + HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); + HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); + + //ITuningSpaceContainer methods + HRESULT STDMETHODCALLTYPE get_Count(long *Count); + HRESULT STDMETHODCALLTYPE get__NewEnum(IEnumVARIANT **NewEnum); + HRESULT STDMETHODCALLTYPE get_Item(VARIANT varIndex, ITuningSpace **TuningSpace); + HRESULT STDMETHODCALLTYPE put_Item(VARIANT varIndex, ITuningSpace *TuningSpace); + HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl); + HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl); + HRESULT STDMETHODCALLTYPE TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl); + HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID); + HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex); + HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum); + HRESULT STDMETHODCALLTYPE Remove(VARIANT Index); + HRESULT STDMETHODCALLTYPE get_MaxCount(long *MaxCount); + HRESULT STDMETHODCALLTYPE put_MaxCount(long MaxCount); + + CTuningSpaceContainer() : m_Ref(0){}; + + virtual ~CTuningSpaceContainer(){}; + +protected: + LONG m_Ref; + +}; + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::QueryInterface( + IN REFIID refiid, + OUT PVOID* Output) +{ + if (IsEqualGUID(refiid, IID_IUnknown)) + { + *Output = PVOID(this); + reinterpret_cast<IUnknown*>(*Output)->AddRef(); + return NOERROR; + } + + if (IsEqualGUID(refiid, IID_ITuningSpaceContainer)) + { + *Output = (ITuningSpaceContainer*)this; + reinterpret_cast<ITuningSpaceContainer*>(*Output)->AddRef(); + return NOERROR; + } + + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(refiid, &lpstr); + swprintf(Buffer, L"CTuningSpaceContainer::QueryInterface: NoInterface for %s", lpstr); + OutputDebugStringW(Buffer); + CoTaskMemFree(lpstr); + + + return E_NOINTERFACE; +} + +//------------------------------------------------------------------- +// IDispatch methods +// +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::GetTypeInfoCount(UINT *pctinfo) +{ + OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfoCount : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfo : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + OutputDebugStringW(L"CTuningSpaceContainer::GetIDsOfNames : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + OutputDebugStringW(L"CTuningSpaceContainer::Invoke : NotImplemented\n"); + return E_NOTIMPL; +} + +//------------------------------------------------------------------- +// ITuningSpaceContainer methods +// + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::get_Count(long *Count) +{ + OutputDebugStringW(L"CTuningSpaceContainer::get_Count : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::get__NewEnum(IEnumVARIANT **NewEnum) +{ + OutputDebugStringW(L"CTuningSpaceContainer::get__NewEnum : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::get_Item(VARIANT varIndex, ITuningSpace **TuningSpace) +{ +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[100]; + swprintf(Buffer, L"CTuningSpaceContainer::get_Item : type %x value %s stub\n", varIndex.vt, varIndex.bstrVal); + OutputDebugStringW(Buffer); +#endif + + return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)TuningSpace); +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::put_Item(VARIANT varIndex, ITuningSpace *TuningSpace) +{ + OutputDebugStringW(L"CTuningSpaceContainer::put_Item : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl) +{ + OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForCLSID : NotImplemented\n"); + return E_NOTIMPL; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::_TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl) +{ + OutputDebugStringW(L"CTuningSpaceContainer::_TuningSpacesForCLSID : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl) +{ + OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForName : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::FindID(ITuningSpace *TuningSpace, long *ID) +{ + OutputDebugStringW(L"CTuningSpaceContainer::FindID : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::Add(ITuningSpace *TuningSpace, VARIANT *NewIndex) +{ + OutputDebugStringW(L"CTuningSpaceContainer::Add : stub\n"); + TuningSpace->AddRef(); + NewIndex->vt = VT_BSTR; + InterlockedIncrement(&m_Ref); + return TuningSpace->get_FriendlyName(&NewIndex->bstrVal);; +} +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum) +{ + OutputDebugStringW(L"CTuningSpaceContainer::get_EnumTuningSpaces : stub\n"); + return CEnumTuningSpaces_fnConstructor(NULL, IID_IEnumTuningSpaces, (void**)ppEnum); +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::Remove(VARIANT Index) +{ + OutputDebugStringW(L"CTuningSpaceContainer::Remove: NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::get_MaxCount(long *MaxCount) +{ + OutputDebugStringW(L"CTuningSpaceContainer::get_MaxCount : NotImplemented\n"); + return E_NOTIMPL; +} + +HRESULT +STDMETHODCALLTYPE +CTuningSpaceContainer::put_MaxCount(long MaxCount) +{ + OutputDebugStringW(L"CTuningSpaceContainer::put_MaxCount : NotImplemented\n"); + return E_NOTIMPL; +} + + +HRESULT +WINAPI +CTuningSpaceContainer_fnConstructor( + IUnknown *pUnknown, + REFIID riid, + LPVOID * ppv) +{ + // construct device control + CTuningSpaceContainer * provider = new CTuningSpaceContainer(); + +#ifdef MSVIDCTL_TRACE + WCHAR Buffer[MAX_PATH]; + LPOLESTR lpstr; + StringFromCLSID(riid, &lpstr); + swprintf(Buffer, L"CTuningSpaceContainer_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown); + OutputDebugStringW(Buffer); +#endif + + if (!provider) + return E_OUTOFMEMORY; + + if (FAILED(provider->QueryInterface(riid, ppv))) + { + /* not supported */ + delete provider; + return E_NOINTERFACE; + } + + return NOERROR; +} Propchange: trunk/reactos/dll/directx/msvidctl/tuningspace_container.cpp ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 9 months
1
0
0
0
[akhaldi] 45745: - Move more stuff to wdm.h - Improve KWAIT_REASON - Group related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 1 15:32:44 2010 New Revision: 45745 URL:
http://svn.reactos.org/svn/reactos?rev=45745&view=rev
Log: - Move more stuff to wdm.h - Improve KWAIT_REASON - Group related definitions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Mon Mar 1 15:32:44 2010 @@ -980,6 +980,47 @@ ProfileLoadLinkedIssues, ProfileMaximum } KPROFILE_SOURCE; + +typedef enum _KWAIT_REASON { + Executive, + FreePage, + PageIn, + PoolAllocation, + DelayExecution, + Suspended, + UserRequest, + WrExecutive, + WrFreePage, + WrPageIn, + WrPoolAllocation, + WrDelayExecution, + WrSuspended, + WrUserRequest, + WrEventPair, + WrQueue, + WrLpcReceive, + WrLpcReply, + WrVirtualMemory, + WrPageOut, + WrRendezvous, + WrKeyedEvent, + WrTerminated, + WrProcessInSwap, + WrCpuRateControl, + WrCalloutStack, + WrKernel, + WrResource, + WrPushLock, + WrMutex, + WrQuantumEnd, + WrDispatchInt, + WrPreempted, + WrYieldExecution, + WrFastMutex, + WrGuardedMutex, + WrRundown, + MaximumWaitReason +} KWAIT_REASON; typedef enum _KD_OPTION { KD_OPTION_SET_BLOCK_ENABLE, @@ -2465,6 +2506,101 @@ #define FILE_DEVICE_BIOMETRIC 0x00000044 #define FILE_DEVICE_PMI 0x00000045 +#define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) + +typedef struct _VPB { + CSHORT Type; + CSHORT Size; + USHORT Flags; + USHORT VolumeLabelLength; + struct _DEVICE_OBJECT *DeviceObject; + struct _DEVICE_OBJECT *RealDevice; + ULONG SerialNumber; + ULONG ReferenceCount; + WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)]; +} VPB, *PVPB; + +typedef struct _DEVICE_OBJECT { + CSHORT Type; + USHORT Size; + LONG ReferenceCount; + struct _DRIVER_OBJECT *DriverObject; + struct _DEVICE_OBJECT *NextDevice; + struct _DEVICE_OBJECT *AttachedDevice; + struct _IRP *CurrentIrp; + PIO_TIMER Timer; + ULONG Flags; + ULONG Characteristics; + volatile PVPB Vpb; + PVOID DeviceExtension; + DEVICE_TYPE DeviceType; + CCHAR StackSize; + union { + LIST_ENTRY ListEntry; + WAIT_CONTEXT_BLOCK Wcb; + } Queue; + ULONG AlignmentRequirement; + KDEVICE_QUEUE DeviceQueue; + KDPC Dpc; + ULONG ActiveThreadCount; + PSECURITY_DESCRIPTOR SecurityDescriptor; + KEVENT DeviceLock; + USHORT SectorSize; + USHORT Spare1; + struct _DEVOBJ_EXTENSION *DeviceObjectExtension; + PVOID Reserved; +} DEVICE_OBJECT, *PDEVICE_OBJECT; + +typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; + +typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { + BOOLEAN Removed; + BOOLEAN Reserved[3]; + volatile LONG IoCount; + KEVENT RemoveEvent; +} IO_REMOVE_LOCK_COMMON_BLOCK; + +typedef struct _IO_REMOVE_LOCK_DBG_BLOCK { + LONG Signature; + LONG HighWatermark; + LONGLONG MaxLockedTicks; + LONG AllocateTag; + LIST_ENTRY LockList; + KSPIN_LOCK Spin; + volatile LONG LowMemoryCount; + ULONG Reserved1[4]; + PVOID Reserved2; + PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks; +} IO_REMOVE_LOCK_DBG_BLOCK; + +typedef struct _IO_REMOVE_LOCK { + IO_REMOVE_LOCK_COMMON_BLOCK Common; +#if DBG + IO_REMOVE_LOCK_DBG_BLOCK Dbg; +#endif +} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK; + +typedef struct _IO_WORKITEM *PIO_WORKITEM; + +typedef VOID +(DDKAPI IO_WORKITEM_ROUTINE)( + IN PDEVICE_OBJECT DeviceObject, + IN PVOID Context); +typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE; + +typedef struct _SHARE_ACCESS { + ULONG OpenCount; + ULONG Readers; + ULONG Writers; + ULONG Deleters; + ULONG SharedRead; + ULONG SharedWrite; + ULONG SharedDelete; +} SHARE_ACCESS, *PSHARE_ACCESS; + + + + typedef struct _PCI_SLOT_NUMBER { union { struct { @@ -3356,8 +3492,6 @@ #define VPB_RAW_MOUNT 0x0010 #define VPB_DIRECT_WRITES_ALLOWED 0x0020 -#define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) - /* IRP.Flags */ #define SL_FORCE_ACCESS_CHECK 0x01 @@ -3489,49 +3623,6 @@ #define IRP_MN_EXECUTE_METHOD 0x09 #define IRP_MN_REGINFO_EX 0x0b - -typedef struct _VPB { - CSHORT Type; - CSHORT Size; - USHORT Flags; - USHORT VolumeLabelLength; - struct _DEVICE_OBJECT *DeviceObject; - struct _DEVICE_OBJECT *RealDevice; - ULONG SerialNumber; - ULONG ReferenceCount; - WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)]; -} VPB, *PVPB; - -typedef struct _DEVICE_OBJECT { - CSHORT Type; - USHORT Size; - LONG ReferenceCount; - struct _DRIVER_OBJECT *DriverObject; - struct _DEVICE_OBJECT *NextDevice; - struct _DEVICE_OBJECT *AttachedDevice; - struct _IRP *CurrentIrp; - PIO_TIMER Timer; - ULONG Flags; - ULONG Characteristics; - volatile PVPB Vpb; - PVOID DeviceExtension; - DEVICE_TYPE DeviceType; - CCHAR StackSize; - union { - LIST_ENTRY ListEntry; - WAIT_CONTEXT_BLOCK Wcb; - } Queue; - ULONG AlignmentRequirement; - KDEVICE_QUEUE DeviceQueue; - KDPC Dpc; - ULONG ActiveThreadCount; - PSECURITY_DESCRIPTOR SecurityDescriptor; - KEVENT DeviceLock; - USHORT SectorSize; - USHORT Spare1; - struct _DEVOBJ_EXTENSION *DeviceObjectExtension; - PVOID Reserved; -} DEVICE_OBJECT, *PDEVICE_OBJECT; typedef struct _FILE_OBJECT { Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Mon Mar 1 15:32:44 2010 @@ -1315,44 +1315,6 @@ SynchronizationEvent } EVENT_TYPE; -typedef enum _KWAIT_REASON { - Executive, - FreePage, - PageIn, - PoolAllocation, - DelayExecution, - Suspended, - UserRequest, - WrExecutive, - WrFreePage, - WrPageIn, - WrPoolAllocation, - WrDelayExecution, - WrSuspended, - WrUserRequest, - WrEventPair, - WrQueue, - WrLpcReceive, - WrLpcReply, - WrVirtualMemory, - WrPageOut, - WrRendezvous, - Spare2, - WrGuardedMutex, - Spare4, - Spare5, - Spare6, - WrKernel, - WrResource, - WrPushLock, - WrMutex, - WrQuantumEnd, - WrDispatchInt, - WrPreempted, - WrYieldExecution, - MaximumWaitReason -} KWAIT_REASON; - typedef struct _KWAIT_BLOCK { LIST_ENTRY WaitListEntry; struct _KTHREAD * RESTRICTED_POINTER Thread; @@ -1362,53 +1324,6 @@ UCHAR WaitType; UCHAR SpareByte; } KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK; - -typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; - -typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { - BOOLEAN Removed; - BOOLEAN Reserved[3]; - volatile LONG IoCount; - KEVENT RemoveEvent; -} IO_REMOVE_LOCK_COMMON_BLOCK; - -typedef struct _IO_REMOVE_LOCK_DBG_BLOCK { - LONG Signature; - LONG HighWatermark; - LONGLONG MaxLockedTicks; - LONG AllocateTag; - LIST_ENTRY LockList; - KSPIN_LOCK Spin; - volatile LONG LowMemoryCount; - ULONG Reserved1[4]; - PVOID Reserved2; - PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks; -} IO_REMOVE_LOCK_DBG_BLOCK; - -typedef struct _IO_REMOVE_LOCK { - IO_REMOVE_LOCK_COMMON_BLOCK Common; -#if DBG - IO_REMOVE_LOCK_DBG_BLOCK Dbg; -#endif -} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK; - -typedef struct _IO_WORKITEM *PIO_WORKITEM; - -typedef VOID -(DDKAPI IO_WORKITEM_ROUTINE)( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context); -typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE; - -typedef struct _SHARE_ACCESS { - ULONG OpenCount; - ULONG Readers; - ULONG Writers; - ULONG Deleters; - ULONG SharedRead; - ULONG SharedWrite; - ULONG SharedDelete; -} SHARE_ACCESS, *PSHARE_ACCESS; typedef enum _KINTERRUPT_MODE { LevelSensitive,
14 years, 9 months
1
0
0
0
[akhaldi] 45744: - Move more stuff to wdm.h - Add PCI_DISABLE_LEVEL_INTERRUPT, PCI_STATUS_DETECTED_PARITY_ERROR, PCI_SUBCLASS_NET_ISDN_CTLR, PCI_SUBCLASS_BR_RACEWAY and several missing PCI_CLASS_* definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 1 15:15:43 2010 New Revision: 45744 URL:
http://svn.reactos.org/svn/reactos?rev=45744&view=rev
Log: - Move more stuff to wdm.h - Add PCI_DISABLE_LEVEL_INTERRUPT, PCI_STATUS_DETECTED_PARITY_ERROR, PCI_SUBCLASS_NET_ISDN_CTLR, PCI_SUBCLASS_BR_RACEWAY and several missing PCI_CLASS_* definitions Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Mon Mar 1 15:15:43 2010 @@ -1586,6 +1586,23 @@ * Configuration Manager Types * ******************************************************************************/ +/* KEY_VALUE_Xxx.Type */ + +#define REG_NONE 0 +#define REG_SZ 1 +#define REG_EXPAND_SZ 2 +#define REG_BINARY 3 +#define REG_DWORD 4 +#define REG_DWORD_LITTLE_ENDIAN 4 +#define REG_DWORD_BIG_ENDIAN 5 +#define REG_LINK 6 +#define REG_MULTI_SZ 7 +#define REG_RESOURCE_LIST 8 +#define REG_FULL_RESOURCE_DESCRIPTOR 9 +#define REG_RESOURCE_REQUIREMENTS_LIST 10 +#define REG_QWORD 11 +#define REG_QWORD_LITTLE_ENDIAN 11 + // // Registry Access Rights // @@ -2157,6 +2174,159 @@ WriteToDevice); } #endif + +/* PCI_COMMON_CONFIG.Command */ + +#define PCI_ENABLE_IO_SPACE 0x0001 +#define PCI_ENABLE_MEMORY_SPACE 0x0002 +#define PCI_ENABLE_BUS_MASTER 0x0004 +#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 +#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 +#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 +#define PCI_ENABLE_PARITY 0x0040 +#define PCI_ENABLE_WAIT_CYCLE 0x0080 +#define PCI_ENABLE_SERR 0x0100 +#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 +#define PCI_DISABLE_LEVEL_INTERRUPT 0x0400 + +/* PCI_COMMON_CONFIG.Status */ + +#define PCI_STATUS_INTERRUPT_PENDING 0x0008 +#define PCI_STATUS_CAPABILITIES_LIST 0x0010 +#define PCI_STATUS_66MHZ_CAPABLE 0x0020 +#define PCI_STATUS_UDF_SUPPORTED 0x0040 +#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 +#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 +#define PCI_STATUS_DEVSEL 0x0600 +#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 +#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 +#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 +#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 +#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 + +/* PCI_COMMON_CONFIG.HeaderType */ + +#define PCI_MULTIFUNCTION 0x80 +#define PCI_DEVICE_TYPE 0x00 +#define PCI_BRIDGE_TYPE 0x01 +#define PCI_CARDBUS_BRIDGE_TYPE 0x02 + +#define PCI_CONFIGURATION_TYPE(PciData) \ + (((PPCI_COMMON_CONFIG) (PciData))->HeaderType & ~PCI_MULTIFUNCTION) + +#define PCI_MULTIFUNCTION_DEVICE(PciData) \ + ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) + +/* PCI device classes */ + +#define PCI_CLASS_PRE_20 0x00 +#define PCI_CLASS_MASS_STORAGE_CTLR 0x01 +#define PCI_CLASS_NETWORK_CTLR 0x02 +#define PCI_CLASS_DISPLAY_CTLR 0x03 +#define PCI_CLASS_MULTIMEDIA_DEV 0x04 +#define PCI_CLASS_MEMORY_CTLR 0x05 +#define PCI_CLASS_BRIDGE_DEV 0x06 +#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07 +#define PCI_CLASS_BASE_SYSTEM_DEV 0x08 +#define PCI_CLASS_INPUT_DEV 0x09 +#define PCI_CLASS_DOCKING_STATION 0x0a +#define PCI_CLASS_PROCESSOR 0x0b +#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c +#define PCI_CLASS_WIRELESS_CTLR 0x0d +#define PCI_CLASS_INTELLIGENT_IO_CTLR 0x0e +#define PCI_CLASS_SATELLITE_COMMS_CTLR 0x0f +#define PCI_CLASS_ENCRYPTION_DECRYPTION 0x10 +#define PCI_CLASS_DATA_ACQ_SIGNAL_PROC 0x11 + +/* PCI device subclasses for class 0 */ + +#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 +#define PCI_SUBCLASS_PRE_20_VGA 0x01 + +/* PCI device subclasses for class 1 (mass storage controllers)*/ + +#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 +#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 +#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 +#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03 +#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04 +#define PCI_SUBCLASS_MSC_OTHER 0x80 + +/* PCI device subclasses for class 2 (network controllers)*/ + +#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 +#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 +#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 +#define PCI_SUBCLASS_NET_ATM_CTLR 0x03 +#define PCI_SUBCLASS_NET_ISDN_CTLR 0x04 +#define PCI_SUBCLASS_NET_OTHER 0x80 + +/* PCI device subclasses for class 3 (display controllers)*/ + +#define PCI_SUBCLASS_VID_VGA_CTLR 0x00 +#define PCI_SUBCLASS_VID_XGA_CTLR 0x01 +#define PCI_SUBCLASS_VID_3D_CTLR 0x02 +#define PCI_SUBCLASS_VID_OTHER 0x80 + +/* PCI device subclasses for class 4 (multimedia device)*/ + +#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 +#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 +#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 +#define PCI_SUBCLASS_MM_OTHER 0x80 + +/* PCI device subclasses for class 5 (memory controller)*/ + +#define PCI_SUBCLASS_MEM_RAM 0x00 +#define PCI_SUBCLASS_MEM_FLASH 0x01 +#define PCI_SUBCLASS_MEM_OTHER 0x80 + +/* PCI device subclasses for class 6 (bridge device)*/ + +#define PCI_SUBCLASS_BR_HOST 0x00 +#define PCI_SUBCLASS_BR_ISA 0x01 +#define PCI_SUBCLASS_BR_EISA 0x02 +#define PCI_SUBCLASS_BR_MCA 0x03 +#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 +#define PCI_SUBCLASS_BR_PCMCIA 0x05 +#define PCI_SUBCLASS_BR_NUBUS 0x06 +#define PCI_SUBCLASS_BR_CARDBUS 0x07 +#define PCI_SUBCLASS_BR_RACEWAY 0x08 +#define PCI_SUBCLASS_BR_OTHER 0x80 + +/* PCI device subclasses for class C (serial bus controller)*/ + +#define PCI_SUBCLASS_SB_IEEE1394 0x00 +#define PCI_SUBCLASS_SB_ACCESS 0x01 +#define PCI_SUBCLASS_SB_SSA 0x02 +#define PCI_SUBCLASS_SB_USB 0x03 +#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04 +#define PCI_SUBCLASS_SB_SMBUS 0x05 + +#define PCI_MAX_DEVICES 32 +#define PCI_MAX_FUNCTION 8 +#define PCI_MAX_BRIDGE_NUMBER 0xFF +#define PCI_INVALID_VENDORID 0xFFFF +#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific)) + +#define PCI_ADDRESS_IO_SPACE 0x00000001 +#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006 +#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008 +#define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc +#define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0 +#define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800 + +#define PCI_TYPE_32BIT 0 +#define PCI_TYPE_20BIT 2 +#define PCI_TYPE_64BIT 4 + +#define POOL_COLD_ALLOCATION 256 +#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 8 +#define POOL_RAISE_IF_ALLOCATION_FAILURE 16 + +#define PCI_TYPE0_ADDRESSES 6 +#define PCI_TYPE1_ADDRESSES 2 +#define PCI_TYPE2_ADDRESSES 5 #define IO_TYPE_ADAPTER 1 #define IO_TYPE_CONTROLLER 2 @@ -2295,6 +2465,17 @@ #define FILE_DEVICE_BIOMETRIC 0x00000044 #define FILE_DEVICE_PMI 0x00000045 +typedef struct _PCI_SLOT_NUMBER { + union { + struct { + ULONG DeviceNumber : 5; + ULONG FunctionNumber : 3; + ULONG Reserved : 24; + } bits; + ULONG AsULONG; + } u; +} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; + typedef struct _IO_STATUS_BLOCK { _ANONYMOUS_UNION union { NTSTATUS Status; Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Mon Mar 1 15:15:43 2010 @@ -1124,27 +1124,6 @@ ULONG UserFlags; } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION; -/* KEY_VALUE_Xxx.Type */ - -#define REG_NONE 0 -#define REG_SZ 1 -#define REG_EXPAND_SZ 2 -#define REG_BINARY 3 -#define REG_DWORD 4 -#define REG_DWORD_LITTLE_ENDIAN 4 -#define REG_DWORD_BIG_ENDIAN 5 -#define REG_LINK 6 -#define REG_MULTI_SZ 7 -#define REG_RESOURCE_LIST 8 -#define REG_FULL_RESOURCE_DESCRIPTOR 9 -#define REG_RESOURCE_REQUIREMENTS_LIST 10 -#define REG_QWORD 11 -#define REG_QWORD_LITTLE_ENDIAN 11 - -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - typedef struct _PCI_COMMON_CONFIG { USHORT VendorID; USHORT DeviceID; @@ -1218,157 +1197,8 @@ UCHAR DeviceSpecific[192]; } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; -/* PCI_COMMON_CONFIG.Command */ - -#define PCI_ENABLE_IO_SPACE 0x0001 -#define PCI_ENABLE_MEMORY_SPACE 0x0002 -#define PCI_ENABLE_BUS_MASTER 0x0004 -#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 -#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 -#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 -#define PCI_ENABLE_PARITY 0x0040 -#define PCI_ENABLE_WAIT_CYCLE 0x0080 -#define PCI_ENABLE_SERR 0x0100 -#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 - -/* PCI_COMMON_CONFIG.Status */ - -#define PCI_STATUS_CAPABILITIES_LIST 0x0010 -#define PCI_STATUS_66MHZ_CAPABLE 0x0020 -#define PCI_STATUS_UDF_SUPPORTED 0x0040 -#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 -#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 -#define PCI_STATUS_DEVSEL 0x0600 -#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 -#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 -#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 -#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 -#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 - -/* PCI_COMMON_CONFIG.HeaderType */ - -#define PCI_MULTIFUNCTION 0x80 -#define PCI_DEVICE_TYPE 0x00 -#define PCI_BRIDGE_TYPE 0x01 -#define PCI_CARDBUS_BRIDGE_TYPE 0x02 - -#define PCI_CONFIGURATION_TYPE(PciData) \ - (((PPCI_COMMON_CONFIG) (PciData))->HeaderType & ~PCI_MULTIFUNCTION) - -#define PCI_MULTIFUNCTION_DEVICE(PciData) \ - ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) - -/* PCI device classes */ - -#define PCI_CLASS_PRE_20 0x00 -#define PCI_CLASS_MASS_STORAGE_CTLR 0x01 -#define PCI_CLASS_NETWORK_CTLR 0x02 -#define PCI_CLASS_DISPLAY_CTLR 0x03 -#define PCI_CLASS_MULTIMEDIA_DEV 0x04 -#define PCI_CLASS_MEMORY_CTLR 0x05 -#define PCI_CLASS_BRIDGE_DEV 0x06 -#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07 -#define PCI_CLASS_BASE_SYSTEM_DEV 0x08 -#define PCI_CLASS_INPUT_DEV 0x09 -#define PCI_CLASS_DOCKING_STATION 0x0a -#define PCI_CLASS_PROCESSOR 0x0b -#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c - -/* PCI device subclasses for class 0 */ - -#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 -#define PCI_SUBCLASS_PRE_20_VGA 0x01 - -/* PCI device subclasses for class 1 (mass storage controllers)*/ - -#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 -#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 -#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 -#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03 -#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04 -#define PCI_SUBCLASS_MSC_OTHER 0x80 - -/* PCI device subclasses for class 2 (network controllers)*/ - -#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 -#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 -#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 -#define PCI_SUBCLASS_NET_ATM_CTLR 0x03 -#define PCI_SUBCLASS_NET_OTHER 0x80 - -/* PCI device subclasses for class 3 (display controllers)*/ - -#define PCI_SUBCLASS_VID_VGA_CTLR 0x00 -#define PCI_SUBCLASS_VID_XGA_CTLR 0x01 -#define PCI_SUBCLASS_VID_3D_CTLR 0x02 -#define PCI_SUBCLASS_VID_OTHER 0x80 - -/* PCI device subclasses for class 4 (multimedia device)*/ - -#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 -#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 -#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 -#define PCI_SUBCLASS_MM_OTHER 0x80 - -/* PCI device subclasses for class 5 (memory controller)*/ - -#define PCI_SUBCLASS_MEM_RAM 0x00 -#define PCI_SUBCLASS_MEM_FLASH 0x01 -#define PCI_SUBCLASS_MEM_OTHER 0x80 - -/* PCI device subclasses for class 6 (bridge device)*/ - -#define PCI_SUBCLASS_BR_HOST 0x00 -#define PCI_SUBCLASS_BR_ISA 0x01 -#define PCI_SUBCLASS_BR_EISA 0x02 -#define PCI_SUBCLASS_BR_MCA 0x03 -#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 -#define PCI_SUBCLASS_BR_PCMCIA 0x05 -#define PCI_SUBCLASS_BR_NUBUS 0x06 -#define PCI_SUBCLASS_BR_CARDBUS 0x07 -#define PCI_SUBCLASS_BR_OTHER 0x80 - -/* PCI device subclasses for class C (serial bus controller)*/ - -#define PCI_SUBCLASS_SB_IEEE1394 0x00 -#define PCI_SUBCLASS_SB_ACCESS 0x01 -#define PCI_SUBCLASS_SB_SSA 0x02 -#define PCI_SUBCLASS_SB_USB 0x03 -#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04 -#define PCI_SUBCLASS_SB_SMBUS 0x05 - -#define PCI_MAX_DEVICES 32 -#define PCI_MAX_FUNCTION 8 -#define PCI_MAX_BRIDGE_NUMBER 0xFF -#define PCI_INVALID_VENDORID 0xFFFF -#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific)) #define PCI_ADDRESS_MEMORY_SPACE 0x00000000 -#define PCI_ADDRESS_IO_SPACE 0x00000001 -#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006 -#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008 -#define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc -#define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0 -#define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800 - -#define PCI_TYPE_32BIT 0 -#define PCI_TYPE_20BIT 2 -#define PCI_TYPE_64BIT 4 - -typedef struct _PCI_SLOT_NUMBER { - union { - struct { - ULONG DeviceNumber : 5; - ULONG FunctionNumber : 3; - ULONG Reserved : 24; - } bits; - ULONG AsULONG; - } u; -} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; - -#define POOL_COLD_ALLOCATION 256 -#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 8 -#define POOL_RAISE_IF_ALLOCATION_FAILURE 16 typedef struct _OSVERSIONINFOA { ULONG dwOSVersionInfoSize;
14 years, 9 months
1
0
0
0
[cwittich] 45743: [MSI] hackfix ITERATE_SelfRegModules not to hang on error
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Mar 1 14:53:34 2010 New Revision: 45743 URL:
http://svn.reactos.org/svn/reactos?rev=45743&view=rev
Log: [MSI] hackfix ITERATE_SelfRegModules not to hang on error Modified: trunk/reactos/dll/win32/msi/action.c Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Mon Mar 1 14:53:34 2010 @@ -3761,7 +3761,7 @@ MSIFILE *file; DWORD len; static const WCHAR ExeStr[] = - {'r','e','g','s','v','r','3','2','.','e','x','e',' ','\"',0}; + {'r','e','g','s','v','r','3','2','.','e','x','e',' ',' /',' s',' ','\"',0}; static const WCHAR close[] = {'\"',0}; STARTUPINFOW si; PROCESS_INFORMATION info; @@ -3840,7 +3840,7 @@ static UINT ITERATE_SelfUnregModules( MSIRECORD *row, LPVOID param ) { static const WCHAR regsvr32[] = - {'r','e','g','s','v','r','3','2','.','e','x','e',' ','/','u',' ','\"',0}; + {'r','e','g','s','v','r','3','2','.','e','x','e',' ','/','u',' ','/','s',' ','\"',0}; static const WCHAR close[] = {'\"',0}; MSIPACKAGE *package = param; LPCWSTR filename;
14 years, 9 months
1
0
0
0
[cwittich] 45742: [MSIEXEC] sync msiexec to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Mar 1 14:42:52 2010 New Revision: 45742 URL:
http://svn.reactos.org/svn/reactos?rev=45742&view=rev
Log: [MSIEXEC] sync msiexec to wine 1.1.39 Modified: trunk/reactos/base/system/msiexec/msiexec.c Modified: trunk/reactos/base/system/msiexec/msiexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/msiexec/msiexe…
============================================================================== --- trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] (original) +++ trunk/reactos/base/system/msiexec/msiexec.c [iso-8859-1] Mon Mar 1 14:42:52 2010 @@ -47,6 +47,7 @@ " Install a product:\n" " msiexec {package|productcode} [property]\n" " msiexec /i {package|productcode} [property]\n" +" msiexec /package {package|productcode} [property]\n" " msiexec /a package [property]\n" " Repair an installation:\n" " msiexec /f[p|o|e|d|c|a|u|m|s|v] {package|productcode}\n" @@ -562,12 +563,13 @@ { FunctionUnregServer = TRUE; } - else if(msi_option_prefix(argvW[i], "i")) + else if(msi_option_prefix(argvW[i], "i") || msi_option_prefix(argvW[i], "package")) { LPWSTR argvWi = argvW[i]; + int argLen = (msi_option_prefix(argvW[i], "i") ? 2 : 8); FunctionInstall = TRUE; - if(lstrlenW(argvWi) > 2) - argvWi += 2; + if(lstrlenW(argvW[i]) > argLen) + argvWi += argLen; else { i++;
14 years, 9 months
1
0
0
0
[akhaldi] 45741: - Move more stuff to wdm.h - Group some related definitions - Add IO_TYPE_CSQ_EX - Add some missing _KEY_SET_INFORMATION_CLASS members - KeyUserFlagsInformation -> KeyWow64FlagsInformation
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Mar 1 14:26:33 2010 New Revision: 45741 URL:
http://svn.reactos.org/svn/reactos?rev=45741&view=rev
Log: - Move more stuff to wdm.h - Group some related definitions - Add IO_TYPE_CSQ_EX - Add some missing _KEY_SET_INFORMATION_CLASS members - KeyUserFlagsInformation -> KeyWow64FlagsInformation Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h branches/header-work/include/ndk/cmtypes.h Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Mon Mar 1 14:26:33 2010 @@ -1289,6 +1289,32 @@ * Memory manager Types * ******************************************************************************/ +#define MDL_MAPPED_TO_SYSTEM_VA 0x0001 +#define MDL_PAGES_LOCKED 0x0002 +#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004 +#define MDL_ALLOCATED_FIXED_SIZE 0x0008 +#define MDL_PARTIAL 0x0010 +#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020 +#define MDL_IO_PAGE_READ 0x0040 +#define MDL_WRITE_OPERATION 0x0080 +#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100 +#define MDL_FREE_EXTRA_PTES 0x0200 +#define MDL_DESCRIBES_AWE 0x0400 +#define MDL_IO_SPACE 0x0800 +#define MDL_NETWORK_HEADER 0x1000 +#define MDL_MAPPING_CAN_FAIL 0x2000 +#define MDL_ALLOCATED_MUST_SUCCEED 0x4000 +#define MDL_INTERNAL 0x8000 + +#define MDL_MAPPING_FLAGS ( \ + MDL_MAPPED_TO_SYSTEM_VA | \ + MDL_PAGES_LOCKED | \ + MDL_SOURCE_IS_NONPAGED_POOL | \ + MDL_PARTIAL_HAS_BEEN_MAPPED | \ + MDL_PARENT_MAPPED_SYSTEM_VA | \ + MDL_SYSTEM_VA | \ + MDL_IO_SPACE) + typedef struct _MDL { struct _MDL *Next; CSHORT Size; @@ -1336,6 +1362,704 @@ IN SIZE_T Length); #endif + +/****************************************************************************** + * Security Manager Types * + ******************************************************************************/ + +// +// Access/Security Stuff +// +typedef ULONG ACCESS_MASK, *PACCESS_MASK; +typedef PVOID PACCESS_TOKEN; + +#define DELETE 0x00010000L +#define READ_CONTROL 0x00020000L +#define WRITE_DAC 0x00040000L +#define WRITE_OWNER 0x00080000L +#define SYNCHRONIZE 0x00100000L +#define STANDARD_RIGHTS_REQUIRED 0x000F0000L +#define STANDARD_RIGHTS_READ READ_CONTROL +#define STANDARD_RIGHTS_WRITE READ_CONTROL +#define STANDARD_RIGHTS_EXECUTE READ_CONTROL +#define STANDARD_RIGHTS_ALL 0x001F0000L +#define SPECIFIC_RIGHTS_ALL 0x0000FFFFL +#define ACCESS_SYSTEM_SECURITY 0x01000000L +#define MAXIMUM_ALLOWED 0x02000000L +#define GENERIC_READ 0x80000000L +#define GENERIC_WRITE 0x40000000L +#define GENERIC_EXECUTE 0x20000000L +#define GENERIC_ALL 0x10000000L + +typedef struct _GENERIC_MAPPING { + ACCESS_MASK GenericRead; + ACCESS_MASK GenericWrite; + ACCESS_MASK GenericExecute; + ACCESS_MASK GenericAll; +} GENERIC_MAPPING, *PGENERIC_MAPPING; + +#define ACL_REVISION 2 +#define ACL_REVISION_DS 4 + +#define ACL_REVISION1 1 +#define ACL_REVISION2 2 +#define ACL_REVISION3 3 +#define ACL_REVISION4 4 +#define MIN_ACL_REVISION ACL_REVISION2 +#define MAX_ACL_REVISION ACL_REVISION4 + +typedef struct _ACL { + UCHAR AclRevision; + UCHAR Sbz1; + USHORT AclSize; + USHORT AceCount; + USHORT Sbz2; +} ACL, *PACL; + +// +// Current security descriptor revision value +// +#define SECURITY_DESCRIPTOR_REVISION (1) +#define SECURITY_DESCRIPTOR_REVISION1 (1) + +// +// Privilege attributes +// +#define SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001L) +#define SE_PRIVILEGE_ENABLED (0x00000002L) +#define SE_PRIVILEGE_REMOVED (0X00000004L) +#define SE_PRIVILEGE_USED_FOR_ACCESS (0x80000000L) + +#define SE_PRIVILEGE_VALID_ATTRIBUTES (SE_PRIVILEGE_ENABLED_BY_DEFAULT | \ + SE_PRIVILEGE_ENABLED | \ + SE_PRIVILEGE_REMOVED | \ + SE_PRIVILEGE_USED_FOR_ACCESS) + +#include <pshpack4.h> +typedef struct _LUID_AND_ATTRIBUTES { + LUID Luid; + ULONG Attributes; +} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES; +#include <poppack.h> + +typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; +typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY; + +// +// Privilege sets +// +#define PRIVILEGE_SET_ALL_NECESSARY (1) + +typedef struct _PRIVILEGE_SET { + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; +} PRIVILEGE_SET,*PPRIVILEGE_SET; + +typedef enum _SECURITY_IMPERSONATION_LEVEL { + SecurityAnonymous, + SecurityIdentification, + SecurityImpersonation, + SecurityDelegation +} SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL; + +#define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation +#define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous +#define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation +#define VALID_IMPERSONATION_LEVEL(Level) (((Level) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((Level) <= SECURITY_MAX_IMPERSONATION_LEVEL)) + +#define SECURITY_DYNAMIC_TRACKING (TRUE) +#define SECURITY_STATIC_TRACKING (FALSE) + +typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE; + +typedef struct _SECURITY_QUALITY_OF_SERVICE { + ULONG Length; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; + BOOLEAN EffectiveOnly; +} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE; + +typedef struct _SE_IMPERSONATION_STATE { + PACCESS_TOKEN Token; + BOOLEAN CopyOnOpen; + BOOLEAN EffectiveOnly; + SECURITY_IMPERSONATION_LEVEL Level; +} SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE; + +#define OWNER_SECURITY_INFORMATION (0x00000001L) +#define GROUP_SECURITY_INFORMATION (0x00000002L) +#define DACL_SECURITY_INFORMATION (0x00000004L) +#define SACL_SECURITY_INFORMATION (0x00000008L) +#define LABEL_SECURITY_INFORMATION (0x00000010L) + +#define PROTECTED_DACL_SECURITY_INFORMATION (0x80000000L) +#define PROTECTED_SACL_SECURITY_INFORMATION (0x40000000L) +#define UNPROTECTED_DACL_SECURITY_INFORMATION (0x20000000L) +#define UNPROTECTED_SACL_SECURITY_INFORMATION (0x10000000L) + +typedef enum _SECURITY_OPERATION_CODE { + SetSecurityDescriptor, + QuerySecurityDescriptor, + DeleteSecurityDescriptor, + AssignSecurityDescriptor +} SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE; + +#define INITIAL_PRIVILEGE_COUNT 3 + +typedef struct _INITIAL_PRIVILEGE_SET { + ULONG PrivilegeCount; + ULONG Control; + LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT]; +} INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET; + +#define SE_MIN_WELL_KNOWN_PRIVILEGE 2 +#define SE_CREATE_TOKEN_PRIVILEGE 2 +#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3 +#define SE_LOCK_MEMORY_PRIVILEGE 4 +#define SE_INCREASE_QUOTA_PRIVILEGE 5 +#define SE_MACHINE_ACCOUNT_PRIVILEGE 6 +#define SE_TCB_PRIVILEGE 7 +#define SE_SECURITY_PRIVILEGE 8 +#define SE_TAKE_OWNERSHIP_PRIVILEGE 9 +#define SE_LOAD_DRIVER_PRIVILEGE 10 +#define SE_SYSTEM_PROFILE_PRIVILEGE 11 +#define SE_SYSTEMTIME_PRIVILEGE 12 +#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13 +#define SE_INC_BASE_PRIORITY_PRIVILEGE 14 +#define SE_CREATE_PAGEFILE_PRIVILEGE 15 +#define SE_CREATE_PERMANENT_PRIVILEGE 16 +#define SE_BACKUP_PRIVILEGE 17 +#define SE_RESTORE_PRIVILEGE 18 +#define SE_SHUTDOWN_PRIVILEGE 19 +#define SE_DEBUG_PRIVILEGE 20 +#define SE_AUDIT_PRIVILEGE 21 +#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22 +#define SE_CHANGE_NOTIFY_PRIVILEGE 23 +#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24 +#define SE_UNDOCK_PRIVILEGE 25 +#define SE_SYNC_AGENT_PRIVILEGE 26 +#define SE_ENABLE_DELEGATION_PRIVILEGE 27 +#define SE_MANAGE_VOLUME_PRIVILEGE 28 +#define SE_IMPERSONATE_PRIVILEGE 29 +#define SE_CREATE_GLOBAL_PRIVILEGE 30 +#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31 +#define SE_RELABEL_PRIVILEGE 32 +#define SE_INC_WORKING_SET_PRIVILEGE 33 +#define SE_TIME_ZONE_PRIVILEGE 34 +#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35 +#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE + +typedef struct _SECURITY_SUBJECT_CONTEXT { + PACCESS_TOKEN ClientToken; + SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; + PACCESS_TOKEN PrimaryToken; + PVOID ProcessAuditId; +} SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; + +#include <pshpack4.h> +typedef struct _ACCESS_STATE { + LUID OperationID; + BOOLEAN SecurityEvaluated; + BOOLEAN GenerateAudit; + BOOLEAN GenerateOnClose; + BOOLEAN PrivilegesAllocated; + ULONG Flags; + ACCESS_MASK RemainingDesiredAccess; + ACCESS_MASK PreviouslyGrantedAccess; + ACCESS_MASK OriginalDesiredAccess; + SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; + PSECURITY_DESCRIPTOR SecurityDescriptor; + PVOID AuxData; + union { + INITIAL_PRIVILEGE_SET InitialPrivilegeSet; + PRIVILEGE_SET PrivilegeSet; + } Privileges; + + BOOLEAN AuditPrivileges; + UNICODE_STRING ObjectName; + UNICODE_STRING ObjectTypeName; +} ACCESS_STATE, *PACCESS_STATE; +#include <poppack.h> + +/****************************************************************************** + * Configuration Manager Types * + ******************************************************************************/ + +// +// Registry Access Rights +// +#define KEY_QUERY_VALUE (0x0001) +#define KEY_SET_VALUE (0x0002) +#define KEY_CREATE_SUB_KEY (0x0004) +#define KEY_ENUMERATE_SUB_KEYS (0x0008) +#define KEY_NOTIFY (0x0010) +#define KEY_CREATE_LINK (0x0020) +#define KEY_WOW64_32KEY (0x0200) +#define KEY_WOW64_64KEY (0x0100) +#define KEY_WOW64_RES (0x0300) + +#define KEY_READ ((STANDARD_RIGHTS_READ |\ + KEY_QUERY_VALUE |\ + KEY_ENUMERATE_SUB_KEYS |\ + KEY_NOTIFY) \ + & \ + (~SYNCHRONIZE)) + +#define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\ + KEY_SET_VALUE |\ + KEY_CREATE_SUB_KEY) \ + & \ + (~SYNCHRONIZE)) + +#define KEY_EXECUTE ((KEY_READ) \ + & \ + (~SYNCHRONIZE)) + +#define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\ + KEY_QUERY_VALUE |\ + KEY_SET_VALUE |\ + KEY_CREATE_SUB_KEY |\ + KEY_ENUMERATE_SUB_KEYS |\ + KEY_NOTIFY |\ + KEY_CREATE_LINK) \ + & \ + (~SYNCHRONIZE)) + +// +// Registry Open/Create Options +// +#define REG_OPTION_RESERVED (0x00000000L) +#define REG_OPTION_NON_VOLATILE (0x00000000L) +#define REG_OPTION_VOLATILE (0x00000001L) +#define REG_OPTION_CREATE_LINK (0x00000002L) +#define REG_OPTION_BACKUP_RESTORE (0x00000004L) +#define REG_OPTION_OPEN_LINK (0x00000008L) + +#define REG_LEGAL_OPTION \ + (REG_OPTION_RESERVED |\ + REG_OPTION_NON_VOLATILE |\ + REG_OPTION_VOLATILE |\ + REG_OPTION_CREATE_LINK |\ + REG_OPTION_BACKUP_RESTORE |\ + REG_OPTION_OPEN_LINK) + +// +// Key creation/open disposition +// +#define REG_CREATED_NEW_KEY (0x00000001L) +#define REG_OPENED_EXISTING_KEY (0x00000002L) + +// +// Key restore & hive load flags +// +#define REG_WHOLE_HIVE_VOLATILE (0x00000001L) +#define REG_REFRESH_HIVE (0x00000002L) +#define REG_NO_LAZY_FLUSH (0x00000004L) +#define REG_FORCE_RESTORE (0x00000008L) +#define REG_APP_HIVE (0x00000010L) +#define REG_PROCESS_PRIVATE (0x00000020L) +#define REG_START_JOURNAL (0x00000040L) +#define REG_HIVE_EXACT_FILE_GROWTH (0x00000080L) +#define REG_HIVE_NO_RM (0x00000100L) +#define REG_HIVE_SINGLE_LOG (0x00000200L) + +// +// Unload Flags +// +#define REG_FORCE_UNLOAD 1 + +// +// Notify Filter Values +// +#define REG_NOTIFY_CHANGE_NAME (0x00000001L) +#define REG_NOTIFY_CHANGE_ATTRIBUTES (0x00000002L) +#define REG_NOTIFY_CHANGE_LAST_SET (0x00000004L) +#define REG_NOTIFY_CHANGE_SECURITY (0x00000008L) + +#define REG_LEGAL_CHANGE_FILTER \ + (REG_NOTIFY_CHANGE_NAME |\ + REG_NOTIFY_CHANGE_ATTRIBUTES |\ + REG_NOTIFY_CHANGE_LAST_SET |\ + REG_NOTIFY_CHANGE_SECURITY) + +typedef struct _CM_FLOPPY_DEVICE_DATA { + USHORT Version; + USHORT Revision; + CHAR Size[8]; + ULONG MaxDensity; + ULONG MountDensity; + UCHAR StepRateHeadUnloadTime; + UCHAR HeadLoadTime; + UCHAR MotorOffTime; + UCHAR SectorLengthCode; + UCHAR SectorPerTrack; + UCHAR ReadWriteGapLength; + UCHAR DataTransferLength; + UCHAR FormatGapLength; + UCHAR FormatFillCharacter; + UCHAR HeadSettleTime; + UCHAR MotorSettleTime; + UCHAR MaximumTrackValue; + UCHAR DataTransferRate; +} CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA; + +#include <pshpack4.h> +typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { + UCHAR Type; + UCHAR ShareDisposition; + USHORT Flags; + union { + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Generic; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Port; + struct { + ULONG Level; + ULONG Vector; + KAFFINITY Affinity; + } Interrupt; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct { + __GNU_EXTENSION union { + struct { + USHORT Reserved; + USHORT MessageCount; + ULONG Vector; + KAFFINITY Affinity; + } Raw; + struct { + ULONG Level; + ULONG Vector; + KAFFINITY Affinity; + } Translated; + }; + } MessageInterrupt; +#endif + struct { + PHYSICAL_ADDRESS Start; + ULONG Length; + } Memory; + struct { + ULONG Channel; + ULONG Port; + ULONG Reserved1; + } Dma; + struct { + ULONG Data[3]; + } DevicePrivate; + struct { + ULONG Start; + ULONG Length; + ULONG Reserved; + } BusNumber; + struct { + ULONG DataSize; + ULONG Reserved1; + ULONG Reserved2; + } DeviceSpecificData; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + struct { + PHYSICAL_ADDRESS Start; + ULONG Length40; + } Memory40; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length48; + } Memory48; + struct { + PHYSICAL_ADDRESS Start; + ULONG Length64; + } Memory64; +#endif + } u; +} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; +#include <poppack.h> + +#include <pshpack1.h> +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */ + +#define CmResourceTypeNull 0 +#define CmResourceTypePort 1 +#define CmResourceTypeInterrupt 2 +#define CmResourceTypeMemory 3 +#define CmResourceTypeDma 4 +#define CmResourceTypeDeviceSpecific 5 +#define CmResourceTypeBusNumber 6 +#define CmResourceTypeMemoryLarge 7 +#define CmResourceTypeNonArbitrated 128 +#define CmResourceTypeConfigData 128 +#define CmResourceTypeDevicePrivate 129 +#define CmResourceTypePcCardConfig 130 +#define CmResourceTypeMfCardConfig 131 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */ + +typedef enum _CM_SHARE_DISPOSITION { + CmResourceShareUndetermined, + CmResourceShareDeviceExclusive, + CmResourceShareDriverExclusive, + CmResourceShareShared +} CM_SHARE_DISPOSITION; + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */ + +#define CM_RESOURCE_PORT_MEMORY 0x0000 +#define CM_RESOURCE_PORT_IO 0x0001 +#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 +#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 +#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 +#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 +#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 +#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 +#define CM_RESOURCE_PORT_BAR 0x0100 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */ + +#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000 +#define CM_RESOURCE_INTERRUPT_LATCHED 0x0001 +#define CM_RESOURCE_INTERRUPT_MESSAGE 0x0002 +#define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x0004 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */ + +#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 +#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 +#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 +#define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003 +#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 +#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 +#define CM_RESOURCE_MEMORY_24 0x0010 +#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 +#define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040 +#define CM_RESOURCE_MEMORY_BAR 0x0080 +#define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100 + +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */ + +#define CM_RESOURCE_DMA_8 0x0000 +#define CM_RESOURCE_DMA_16 0x0001 +#define CM_RESOURCE_DMA_32 0x0002 +#define CM_RESOURCE_DMA_8_AND_16 0x0004 +#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 +#define CM_RESOURCE_DMA_TYPE_A 0x0010 +#define CM_RESOURCE_DMA_TYPE_B 0x0020 +#define CM_RESOURCE_DMA_TYPE_F 0x0040 + +typedef struct _CM_PARTIAL_RESOURCE_LIST { + USHORT Version; + USHORT Revision; + ULONG Count; + CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; +} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; + +typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { + INTERFACE_TYPE InterfaceType; + ULONG BusNumber; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; +} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; + +typedef struct _CM_RESOURCE_LIST { + ULONG Count; + CM_FULL_RESOURCE_DESCRIPTOR List[1]; +} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; + +typedef struct _CM_INT13_DRIVE_PARAMETER { + USHORT DriveSelect; + ULONG MaxCylinders; + USHORT SectorsPerTrack; + USHORT MaxHeads; + USHORT NumberDrives; +} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER; + +typedef struct _CM_PNP_BIOS_DEVICE_NODE +{ + USHORT Size; + UCHAR Node; + ULONG ProductId; + UCHAR DeviceType[3]; + USHORT DeviceAttributes; +} CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE; + +typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK +{ + UCHAR Signature[4]; + UCHAR Revision; + UCHAR Length; + USHORT ControlField; + UCHAR Checksum; + ULONG EventFlagAddress; + USHORT RealModeEntryOffset; + USHORT RealModeEntrySegment; + USHORT ProtectedModeEntryOffset; + ULONG ProtectedModeCodeBaseAddress; + ULONG OemDeviceId; + USHORT RealModeDataBaseAddress; + ULONG ProtectedModeDataBaseAddress; +} CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK; + +#include <poppack.h> + +typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA +{ + ULONG BytesPerSector; + ULONG NumberOfCylinders; + ULONG SectorsPerTrack; + ULONG NumberOfHeads; +} CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA; + +typedef struct _CM_KEYBOARD_DEVICE_DATA { + USHORT Version; + USHORT Revision; + UCHAR Type; + UCHAR Subtype; + USHORT KeyboardFlags; +} CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA; + +typedef struct _CM_MCA_POS_DATA { + USHORT AdapterId; + UCHAR PosData1; + UCHAR PosData2; + UCHAR PosData3; + UCHAR PosData4; +} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; + +#if (NTDDI_VERSION >= NTDDI_WINXP) +typedef struct CM_Power_Data_s { + ULONG PD_Size; + DEVICE_POWER_STATE PD_MostRecentPowerState; + ULONG PD_Capabilities; + ULONG PD_D1Latency; + ULONG PD_D2Latency; + ULONG PD_D3Latency; + DEVICE_POWER_STATE PD_PowerStateMapping[PowerSystemMaximum]; + SYSTEM_POWER_STATE PD_DeepestSystemWake; +} CM_POWER_DATA, *PCM_POWER_DATA; + +#define PDCAP_D0_SUPPORTED 0x00000001 +#define PDCAP_D1_SUPPORTED 0x00000002 +#define PDCAP_D2_SUPPORTED 0x00000004 +#define PDCAP_D3_SUPPORTED 0x00000008 +#define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 +#define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 +#define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 +#define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 +#define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 + +#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ + +typedef struct _CM_SCSI_DEVICE_DATA { + USHORT Version; + USHORT Revision; + UCHAR HostIdentifier; +} CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA; + +typedef struct _CM_SERIAL_DEVICE_DATA { + USHORT Version; + USHORT Revision; + ULONG BaudClock; +} CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA; + +typedef enum _KEY_INFORMATION_CLASS { + KeyBasicInformation, + KeyNodeInformation, + KeyFullInformation, + KeyNameInformation, + KeyCachedInformation, + KeyFlagsInformation +} KEY_INFORMATION_CLASS; + +typedef struct _KEY_BASIC_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG NameLength; + WCHAR Name[1]; +} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; + +typedef struct _KEY_FULL_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG ClassOffset; + ULONG ClassLength; + ULONG SubKeys; + ULONG MaxNameLen; + ULONG MaxClassLen; + ULONG Values; + ULONG MaxValueNameLen; + ULONG MaxValueDataLen; + WCHAR Class[1]; +} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; + +typedef struct _KEY_NODE_INFORMATION { + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG ClassOffset; + ULONG ClassLength; + ULONG NameLength; + WCHAR Name[1]; +} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION; + +typedef struct _KEY_VALUE_BASIC_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG NameLength; + WCHAR Name[1]; +} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION; + +typedef struct _KEY_VALUE_FULL_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG DataOffset; + ULONG DataLength; + ULONG NameLength; + WCHAR Name[1]; +} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; + +typedef struct _KEY_VALUE_PARTIAL_INFORMATION { + ULONG TitleIndex; + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; +} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; + +typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 { + ULONG Type; + ULONG DataLength; + UCHAR Data[1]; +} KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64; + +typedef struct _KEY_VALUE_ENTRY { + PUNICODE_STRING ValueName; + ULONG DataLength; + ULONG DataOffset; + ULONG Type; +} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; + +typedef enum _KEY_VALUE_INFORMATION_CLASS { + KeyValueBasicInformation, + KeyValueFullInformation, + KeyValuePartialInformation, + KeyValueFullInformationAlign64, + KeyValuePartialInformationAlign64 +} KEY_VALUE_INFORMATION_CLASS; + +typedef struct _KEY_WRITE_TIME_INFORMATION { + LARGE_INTEGER LastWriteTime; +} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION; + +typedef enum _KEY_SET_INFORMATION_CLASS { + KeyWriteTimeInformation, + KeyWow64FlagsInformation, + KeyControlFlagsInformation, + KeySetVirtualizationInformation, + KeySetDebugInformation, + KeySetHandleTagsInformation, + MaxKeySetInfoClass +} KEY_SET_INFORMATION_CLASS; /****************************************************************************** * I/O Manager Functions * @@ -1433,6 +2157,24 @@ WriteToDevice); } #endif + +#define IO_TYPE_ADAPTER 1 +#define IO_TYPE_CONTROLLER 2 +#define IO_TYPE_DEVICE 3 +#define IO_TYPE_DRIVER 4 +#define IO_TYPE_FILE 5 +#define IO_TYPE_IRP 6 +#define IO_TYPE_MASTER_ADAPTER 7 +#define IO_TYPE_OPEN_PACKET 8 +#define IO_TYPE_TIMER 9 +#define IO_TYPE_VPB 10 +#define IO_TYPE_ERROR_LOG 11 +#define IO_TYPE_ERROR_MESSAGE 12 +#define IO_TYPE_DEVICE_OBJECT_EXTENSION 13 + +#define IO_TYPE_CSQ_IRP_CONTEXT 1 +#define IO_TYPE_CSQ 2 +#define IO_TYPE_CSQ_EX 3 /* IO_RESOURCE_DESCRIPTOR.Option */ @@ -2777,33 +3519,6 @@ #endif -#define MDL_MAPPED_TO_SYSTEM_VA 0x0001 -#define MDL_PAGES_LOCKED 0x0002 -#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004 -#define MDL_ALLOCATED_FIXED_SIZE 0x0008 -#define MDL_PARTIAL 0x0010 -#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020 -#define MDL_IO_PAGE_READ 0x0040 -#define MDL_WRITE_OPERATION 0x0080 -#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100 -#define MDL_FREE_EXTRA_PTES 0x0200 -#define MDL_DESCRIBES_AWE 0x0400 -#define MDL_IO_SPACE 0x0800 -#define MDL_NETWORK_HEADER 0x1000 -#define MDL_MAPPING_CAN_FAIL 0x2000 -#define MDL_ALLOCATED_MUST_SUCCEED 0x4000 -#define MDL_INTERNAL 0x8000 - - -#define MDL_MAPPING_FLAGS ( \ - MDL_MAPPED_TO_SYSTEM_VA | \ - MDL_PAGES_LOCKED | \ - MDL_SOURCE_IS_NONPAGED_POOL | \ - MDL_PARTIAL_HAS_BEEN_MAPPED | \ - MDL_PARENT_MAPPED_SYSTEM_VA | \ - MDL_SYSTEM_VA | \ - MDL_IO_SPACE) - typedef NTSTATUS (DDKAPI DRIVER_ADD_DEVICE)( IN struct _DRIVER_OBJECT *DriverObject, @@ -3182,584 +3897,278 @@ (DDKAPI *PKSYNCHRONIZE_ROUTINE)( IN PVOID SynchronizeContext); -/****************************************************************************** - * Security Manager Types * - ******************************************************************************/ - -// -// Access/Security Stuff -// -typedef ULONG ACCESS_MASK, *PACCESS_MASK; -typedef PVOID PACCESS_TOKEN; - -#define DELETE 0x00010000L -#define READ_CONTROL 0x00020000L -#define WRITE_DAC 0x00040000L -#define WRITE_OWNER 0x00080000L -#define SYNCHRONIZE 0x00100000L -#define STANDARD_RIGHTS_REQUIRED 0x000F0000L -#define STANDARD_RIGHTS_READ READ_CONTROL -#define STANDARD_RIGHTS_WRITE READ_CONTROL -#define STANDARD_RIGHTS_EXECUTE READ_CONTROL -#define STANDARD_RIGHTS_ALL 0x001F0000L -#define SPECIFIC_RIGHTS_ALL 0x0000FFFFL -#define ACCESS_SYSTEM_SECURITY 0x01000000L -#define MAXIMUM_ALLOWED 0x02000000L -#define GENERIC_READ 0x80000000L -#define GENERIC_WRITE 0x40000000L -#define GENERIC_EXECUTE 0x20000000L -#define GENERIC_ALL 0x10000000L - -typedef struct _GENERIC_MAPPING { - ACCESS_MASK GenericRead; - ACCESS_MASK GenericWrite; - ACCESS_MASK GenericExecute; - ACCESS_MASK GenericAll; -} GENERIC_MAPPING, *PGENERIC_MAPPING; - -#define ACL_REVISION 2 -#define ACL_REVISION_DS 4 - -#define ACL_REVISION1 1 -#define ACL_REVISION2 2 -#define ACL_REVISION3 3 -#define ACL_REVISION4 4 -#define MIN_ACL_REVISION ACL_REVISION2 -#define MAX_ACL_REVISION ACL_REVISION4 - -typedef struct _ACL { - UCHAR AclRevision; - UCHAR Sbz1; - USHORT AclSize; - USHORT AceCount; - USHORT Sbz2; -} ACL, *PACL; - - - -// -// Current security descriptor revision value -// -#define SECURITY_DESCRIPTOR_REVISION (1) -#define SECURITY_DESCRIPTOR_REVISION1 (1) - -// -// Privilege attributes -// -#define SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001L) -#define SE_PRIVILEGE_ENABLED (0x00000002L) -#define SE_PRIVILEGE_REMOVED (0X00000004L) -#define SE_PRIVILEGE_USED_FOR_ACCESS (0x80000000L) - -#define SE_PRIVILEGE_VALID_ATTRIBUTES (SE_PRIVILEGE_ENABLED_BY_DEFAULT | \ - SE_PRIVILEGE_ENABLED | \ - SE_PRIVILEGE_REMOVED | \ - SE_PRIVILEGE_USED_FOR_ACCESS) - +typedef struct _IO_SECURITY_CONTEXT { + PSECURITY_QUALITY_OF_SERVICE SecurityQos; + PACCESS_STATE AccessState; + ACCESS_MASK DesiredAccess; + ULONG FullCreateOptions; +} IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT; + +struct _IO_CSQ; + +typedef struct _IO_CSQ_IRP_CONTEXT { + ULONG Type; + struct _IRP *Irp; + struct _IO_CSQ *Csq; +} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; + +typedef VOID +(DDKAPI *PIO_CSQ_INSERT_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef VOID +(DDKAPI *PIO_CSQ_REMOVE_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef PIRP +(DDKAPI *PIO_CSQ_PEEK_NEXT_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp, + IN PVOID PeekContext); + +typedef VOID +(DDKAPI *PIO_CSQ_ACQUIRE_LOCK)( + IN struct _IO_CSQ *Csq, + OUT PKIRQL Irql); + +typedef VOID +(DDKAPI *PIO_CSQ_RELEASE_LOCK)( + IN struct _IO_CSQ *Csq, + IN KIRQL Irql); + +typedef VOID +(DDKAPI *PIO_CSQ_COMPLETE_CANCELED_IRP)( + IN struct _IO_CSQ *Csq, + IN PIRP Irp); + +typedef struct _IO_CSQ { + ULONG Type; + PIO_CSQ_INSERT_IRP CsqInsertIrp; + PIO_CSQ_REMOVE_IRP CsqRemoveIrp; + PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; + PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; + PIO_CSQ_RELEASE_LOCK CsqReleaseLock; + PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; + PVOID ReservePointer; +} IO_CSQ, *PIO_CSQ; + +typedef enum _BUS_QUERY_ID_TYPE { + BusQueryDeviceID, + BusQueryHardwareIDs, + BusQueryCompatibleIDs, + BusQueryInstanceID, + BusQueryDeviceSerialNumber +} BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE; + +typedef enum _DEVICE_TEXT_TYPE { + DeviceTextDescription, + DeviceTextLocationInformation +} DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; + +#if !defined(_ALPHA_) #include <pshpack4.h> -typedef struct _LUID_AND_ATTRIBUTES { - LUID Luid; - ULONG Attributes; -} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES; +#endif +typedef struct _IO_STACK_LOCATION { + UCHAR MajorFunction; + UCHAR MinorFunction; + UCHAR Flags; + UCHAR Control; + union { + struct { + PIO_SECURITY_CONTEXT SecurityContext; + ULONG Options; + USHORT POINTER_ALIGNMENT FileAttributes; + USHORT ShareAccess; + ULONG POINTER_ALIGNMENT EaLength; + } Create; + struct { + ULONG Length; + ULONG POINTER_ALIGNMENT Key; + LARGE_INTEGER ByteOffset; + } Read; + struct { + ULONG Length; + ULONG POINTER_ALIGNMENT Key; + LARGE_INTEGER ByteOffset; + } Write; + struct { + ULONG Length; + PUNICODE_STRING FileName; + FILE_INFORMATION_CLASS FileInformationClass; + ULONG FileIndex; + } QueryDirectory; + struct { + ULONG Length; + ULONG CompletionFilter; + } NotifyDirectory; + struct { + ULONG Length; + FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; + } QueryFile; + struct { + ULONG Length; + FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; + PFILE_OBJECT FileObject; + _ANONYMOUS_UNION union { + _ANONYMOUS_STRUCT struct { + BOOLEAN ReplaceIfExists; + BOOLEAN AdvanceOnly; + } DUMMYSTRUCTNAME; + ULONG ClusterCount; + HANDLE DeleteHandle; + } DUMMYUNIONNAME; + } SetFile; + struct { + ULONG Length; + PVOID EaList; + ULONG EaListLength; + ULONG EaIndex; + } QueryEa; + struct { + ULONG Length; + } SetEa; + struct { + ULONG Length; + FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; + } QueryVolume; + struct { + ULONG Length; + FS_INFORMATION_CLASS FsInformationClass; + } SetVolume; + struct { + ULONG OutputBufferLength; + ULONG InputBufferLength; + ULONG FsControlCode; + PVOID Type3InputBuffer; + } FileSystemControl; + struct { + PLARGE_INTEGER Length; + ULONG Key; + LARGE_INTEGER ByteOffset; + } LockControl; + struct { + ULONG OutputBufferLength; + ULONG POINTER_ALIGNMENT InputBufferLength; + ULONG POINTER_ALIGNMENT IoControlCode; + PVOID Type3InputBuffer; + } DeviceIoControl; + struct { + SECURITY_INFORMATION SecurityInformation; + ULONG POINTER_ALIGNMENT Length; + } QuerySecurity; + struct { + SECURITY_INFORMATION SecurityInformation; + PSECURITY_DESCRIPTOR SecurityDescriptor; + } SetSecurity; + struct { + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; + } MountVolume; + struct { + PVPB Vpb; + PDEVICE_OBJECT DeviceObject; + } VerifyVolume; + struct { + struct _SCSI_REQUEST_BLOCK *Srb; + } Scsi; + struct { + ULONG Length; + PSID StartSid; + struct _FILE_GET_QUOTA_INFORMATION *SidList; + ULONG SidListLength; + } QueryQuota; + struct { + ULONG Length; + } SetQuota; + struct { + DEVICE_RELATION_TYPE Type; + } QueryDeviceRelations; + struct { + CONST GUID *InterfaceType; + USHORT Size; + USHORT Version; + PINTERFACE Interface; + PVOID InterfaceSpecificData; + } QueryInterface; + struct { + PDEVICE_CAPABILITIES Capabilities; + } DeviceCapabilities; + struct { + PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; + } FilterResourceRequirements; + struct { + ULONG WhichSpace; + PVOID Buffer; + ULONG Offset; + ULONG POINTER_ALIGNMENT Length; + } ReadWriteConfig; + struct { + BOOLEAN Lock; + } SetLock; + struct { + BUS_QUERY_ID_TYPE IdType; + } QueryId; + struct { + DEVICE_TEXT_TYPE DeviceTextType; + LCID POINTER_ALIGNMENT LocaleId; + } QueryDeviceText; + struct { + BOOLEAN InPath; + BOOLEAN Reserved[3]; + DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; + } UsageNotification; + struct { + SYSTEM_POWER_STATE PowerState; + } WaitWake; + struct { + PPOWER_SEQUENCE PowerSequence; + } PowerSequence; + struct { + ULONG SystemContext; + POWER_STATE_TYPE POINTER_ALIGNMENT Type; + POWER_STATE POINTER_ALIGNMENT State; + POWER_ACTION POINTER_ALIGNMENT ShutdownType; + } Power; + struct { + PCM_RESOURCE_LIST AllocatedResources; + PCM_RESOURCE_LIST AllocatedResourcesTranslated; + } StartDevice; + struct { + ULONG_PTR ProviderId; + PVOID DataPath; + ULONG BufferSize; + PVOID Buffer; + } WMI; + struct { + PVOID Argument1; + PVOID Argument2; + PVOID Argument3; + PVOID Argument4; + } Others; + } Parameters; + PDEVICE_OBJECT DeviceObject; + PFILE_OBJECT FileObject; + PIO_COMPLETION_ROUTINE CompletionRoutine; + PVOID Context; +} IO_STACK_LOCATION, *PIO_STACK_LOCATION; +#if !defined(_ALPHA_) #include <poppack.h> -typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; -typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY; - - - -// -// Privilege sets -// -#define PRIVILEGE_SET_ALL_NECESSARY (1) - -typedef struct _PRIVILEGE_SET { - ULONG PrivilegeCount; - ULONG Control; - LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; -} PRIVILEGE_SET,*PPRIVILEGE_SET; - -typedef enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous, - SecurityIdentification, - SecurityImpersonation, - SecurityDelegation -} SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL; - -#define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation -#define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous -#define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation -#define VALID_IMPERSONATION_LEVEL(Level) (((Level) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((Level) <= SECURITY_MAX_IMPERSONATION_LEVEL)) - -#define SECURITY_DYNAMIC_TRACKING (TRUE) -#define SECURITY_STATIC_TRACKING (FALSE) - -typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, *PSECURITY_CONTEXT_TRACKING_MODE; - -typedef struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; - BOOLEAN EffectiveOnly; -} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE; - -typedef struct _SE_IMPERSONATION_STATE { - PACCESS_TOKEN Token; - BOOLEAN CopyOnOpen; - BOOLEAN EffectiveOnly; - SECURITY_IMPERSONATION_LEVEL Level; -} SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE; - -#define OWNER_SECURITY_INFORMATION (0x00000001L) -#define GROUP_SECURITY_INFORMATION (0x00000002L) -#define DACL_SECURITY_INFORMATION (0x00000004L) -#define SACL_SECURITY_INFORMATION (0x00000008L) -#define LABEL_SECURITY_INFORMATION (0x00000010L) - -#define PROTECTED_DACL_SECURITY_INFORMATION (0x80000000L) -#define PROTECTED_SACL_SECURITY_INFORMATION (0x40000000L) -#define UNPROTECTED_DACL_SECURITY_INFORMATION (0x20000000L) -#define UNPROTECTED_SACL_SECURITY_INFORMATION (0x10000000L) - -typedef enum _SECURITY_OPERATION_CODE { - SetSecurityDescriptor, - QuerySecurityDescriptor, - DeleteSecurityDescriptor, - AssignSecurityDescriptor -} SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE; - -#define INITIAL_PRIVILEGE_COUNT 3 - -typedef struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount; - ULONG Control; - LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT]; -} INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET; - -#define SE_MIN_WELL_KNOWN_PRIVILEGE 2 -#define SE_CREATE_TOKEN_PRIVILEGE 2 -#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE 3 -#define SE_LOCK_MEMORY_PRIVILEGE 4 -#define SE_INCREASE_QUOTA_PRIVILEGE 5 -#define SE_MACHINE_ACCOUNT_PRIVILEGE 6 -#define SE_TCB_PRIVILEGE 7 -#define SE_SECURITY_PRIVILEGE 8 -#define SE_TAKE_OWNERSHIP_PRIVILEGE 9 -#define SE_LOAD_DRIVER_PRIVILEGE 10 -#define SE_SYSTEM_PROFILE_PRIVILEGE 11 -#define SE_SYSTEMTIME_PRIVILEGE 12 -#define SE_PROF_SINGLE_PROCESS_PRIVILEGE 13 -#define SE_INC_BASE_PRIORITY_PRIVILEGE 14 -#define SE_CREATE_PAGEFILE_PRIVILEGE 15 -#define SE_CREATE_PERMANENT_PRIVILEGE 16 -#define SE_BACKUP_PRIVILEGE 17 -#define SE_RESTORE_PRIVILEGE 18 -#define SE_SHUTDOWN_PRIVILEGE 19 -#define SE_DEBUG_PRIVILEGE 20 -#define SE_AUDIT_PRIVILEGE 21 -#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE 22 -#define SE_CHANGE_NOTIFY_PRIVILEGE 23 -#define SE_REMOTE_SHUTDOWN_PRIVILEGE 24 -#define SE_UNDOCK_PRIVILEGE 25 -#define SE_SYNC_AGENT_PRIVILEGE 26 -#define SE_ENABLE_DELEGATION_PRIVILEGE 27 -#define SE_MANAGE_VOLUME_PRIVILEGE 28 -#define SE_IMPERSONATE_PRIVILEGE 29 -#define SE_CREATE_GLOBAL_PRIVILEGE 30 -#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE 31 -#define SE_RELABEL_PRIVILEGE 32 -#define SE_INC_WORKING_SET_PRIVILEGE 33 -#define SE_TIME_ZONE_PRIVILEGE 34 -#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE 35 -#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_CREATE_SYMBOLIC_LINK_PRIVILEGE - -typedef struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - PACCESS_TOKEN PrimaryToken; - PVOID ProcessAuditId; -} SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; - -/****************************************************************************** - * Configuration Manager Types * - ******************************************************************************/ - -// -// Registry Access Rights -// -#define KEY_QUERY_VALUE (0x0001) -#define KEY_SET_VALUE (0x0002) -#define KEY_CREATE_SUB_KEY (0x0004) -#define KEY_ENUMERATE_SUB_KEYS (0x0008) -#define KEY_NOTIFY (0x0010) -#define KEY_CREATE_LINK (0x0020) -#define KEY_WOW64_32KEY (0x0200) -#define KEY_WOW64_64KEY (0x0100) -#define KEY_WOW64_RES (0x0300) - -#define KEY_READ ((STANDARD_RIGHTS_READ |\ - KEY_QUERY_VALUE |\ - KEY_ENUMERATE_SUB_KEYS |\ - KEY_NOTIFY) \ - & \ - (~SYNCHRONIZE)) - -#define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\ - KEY_SET_VALUE |\ - KEY_CREATE_SUB_KEY) \ - & \ - (~SYNCHRONIZE)) - -#define KEY_EXECUTE ((KEY_READ) \ - & \ - (~SYNCHRONIZE)) - -#define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\ - KEY_QUERY_VALUE |\ - KEY_SET_VALUE |\ - KEY_CREATE_SUB_KEY |\ - KEY_ENUMERATE_SUB_KEYS |\ - KEY_NOTIFY |\ - KEY_CREATE_LINK) \ - & \ - (~SYNCHRONIZE)) - -// -// Registry Open/Create Options -// -#define REG_OPTION_RESERVED (0x00000000L) -#define REG_OPTION_NON_VOLATILE (0x00000000L) -#define REG_OPTION_VOLATILE (0x00000001L) -#define REG_OPTION_CREATE_LINK (0x00000002L) -#define REG_OPTION_BACKUP_RESTORE (0x00000004L) -#define REG_OPTION_OPEN_LINK (0x00000008L) - -#define REG_LEGAL_OPTION \ - (REG_OPTION_RESERVED |\ - REG_OPTION_NON_VOLATILE |\ - REG_OPTION_VOLATILE |\ - REG_OPTION_CREATE_LINK |\ - REG_OPTION_BACKUP_RESTORE |\ - REG_OPTION_OPEN_LINK) - -// -// Key creation/open disposition -// -#define REG_CREATED_NEW_KEY (0x00000001L) -#define REG_OPENED_EXISTING_KEY (0x00000002L) - -// -// Key restore & hive load flags -// -#define REG_WHOLE_HIVE_VOLATILE (0x00000001L) -#define REG_REFRESH_HIVE (0x00000002L) -#define REG_NO_LAZY_FLUSH (0x00000004L) -#define REG_FORCE_RESTORE (0x00000008L) -#define REG_APP_HIVE (0x00000010L) -#define REG_PROCESS_PRIVATE (0x00000020L) -#define REG_START_JOURNAL (0x00000040L) -#define REG_HIVE_EXACT_FILE_GROWTH (0x00000080L) -#define REG_HIVE_NO_RM (0x00000100L) -#define REG_HIVE_SINGLE_LOG (0x00000200L) - -// -// Unload Flags -// -#define REG_FORCE_UNLOAD 1 - -// -// Notify Filter Values -// -#define REG_NOTIFY_CHANGE_NAME (0x00000001L) -#define REG_NOTIFY_CHANGE_ATTRIBUTES (0x00000002L) -#define REG_NOTIFY_CHANGE_LAST_SET (0x00000004L) -#define REG_NOTIFY_CHANGE_SECURITY (0x00000008L) - -#define REG_LEGAL_CHANGE_FILTER \ - (REG_NOTIFY_CHANGE_NAME |\ - REG_NOTIFY_CHANGE_ATTRIBUTES |\ - REG_NOTIFY_CHANGE_LAST_SET |\ - REG_NOTIFY_CHANGE_SECURITY) - -typedef struct _CM_FLOPPY_DEVICE_DATA { - USHORT Version; - USHORT Revision; - CHAR Size[8]; - ULONG MaxDensity; - ULONG MountDensity; - UCHAR StepRateHeadUnloadTime; - UCHAR HeadLoadTime; - UCHAR MotorOffTime; - UCHAR SectorLengthCode; - UCHAR SectorPerTrack; - UCHAR ReadWriteGapLength; - UCHAR DataTransferLength; - UCHAR FormatGapLength; - UCHAR FormatFillCharacter; - UCHAR HeadSettleTime; - UCHAR MotorSettleTime; - UCHAR MaximumTrackValue; - UCHAR DataTransferRate; -} CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA; - -#include <pshpack4.h> -typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type; - UCHAR ShareDisposition; - USHORT Flags; - union { - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Generic; - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Port; - struct { - ULONG Level; - ULONG Vector; - KAFFINITY Affinity; - } Interrupt; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - struct { - __GNU_EXTENSION union { - struct { - USHORT Reserved; - USHORT MessageCount; - ULONG Vector; - KAFFINITY Affinity; - } Raw; - struct { - ULONG Level; - ULONG Vector; - KAFFINITY Affinity; - } Translated; - }; - } MessageInterrupt; #endif - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Memory; - struct { - ULONG Channel; - ULONG Port; - ULONG Reserved1; - } Dma; - struct { - ULONG Data[3]; - } DevicePrivate; - struct { - ULONG Start; - ULONG Length; - ULONG Reserved; - } BusNumber; - struct { - ULONG DataSize; - ULONG Reserved1; - ULONG Reserved2; - } DeviceSpecificData; -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - struct { - PHYSICAL_ADDRESS Start; - ULONG Length40; - } Memory40; - struct { - PHYSICAL_ADDRESS Start; - ULONG Length48; - } Memory48; - struct { - PHYSICAL_ADDRESS Start; - ULONG Length64; - } Memory64; -#endif - } u; -} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; -#include <poppack.h> - -#include <pshpack1.h> -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */ - -#define CmResourceTypeNull 0 -#define CmResourceTypePort 1 -#define CmResourceTypeInterrupt 2 -#define CmResourceTypeMemory 3 -#define CmResourceTypeDma 4 -#define CmResourceTypeDeviceSpecific 5 -#define CmResourceTypeBusNumber 6 -#define CmResourceTypeMemoryLarge 7 -#define CmResourceTypeNonArbitrated 128 -#define CmResourceTypeConfigData 128 -#define CmResourceTypeDevicePrivate 129 -#define CmResourceTypePcCardConfig 130 -#define CmResourceTypeMfCardConfig 131 - -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */ - -typedef enum _CM_SHARE_DISPOSITION { - CmResourceShareUndetermined, - CmResourceShareDeviceExclusive, - CmResourceShareDriverExclusive, - CmResourceShareShared -} CM_SHARE_DISPOSITION; - -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */ - -#define CM_RESOURCE_PORT_MEMORY 0x0000 -#define CM_RESOURCE_PORT_IO 0x0001 -#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 -#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 -#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 -#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 -#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 -#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 -#define CM_RESOURCE_PORT_BAR 0x0100 - -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */ - -#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000 -#define CM_RESOURCE_INTERRUPT_LATCHED 0x0001 -#define CM_RESOURCE_INTERRUPT_MESSAGE 0x0002 -#define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x0004 - -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */ - -#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 -#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 -#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 -#define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003 -#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 -#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 -#define CM_RESOURCE_MEMORY_24 0x0010 -#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 -#define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040 -#define CM_RESOURCE_MEMORY_BAR 0x0080 -#define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100 - -/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */ - -#define CM_RESOURCE_DMA_8 0x0000 -#define CM_RESOURCE_DMA_16 0x0001 -#define CM_RESOURCE_DMA_32 0x0002 -#define CM_RESOURCE_DMA_8_AND_16 0x0004 -#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 -#define CM_RESOURCE_DMA_TYPE_A 0x0010 -#define CM_RESOURCE_DMA_TYPE_B 0x0020 -#define CM_RESOURCE_DMA_TYPE_F 0x0040 - -typedef struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version; - USHORT Revision; - ULONG Count; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; -} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; - -typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType; - ULONG BusNumber; - CM_PARTIAL_RESOURCE_LIST PartialResourceList; -} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; - -typedef struct _CM_RESOURCE_LIST { - ULONG Count; - CM_FULL_RESOURCE_DESCRIPTOR List[1]; -} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; - -typedef struct _CM_INT13_DRIVE_PARAMETER { - USHORT DriveSelect; - ULONG MaxCylinders; - USHORT SectorsPerTrack; - USHORT MaxHeads; - USHORT NumberDrives; -} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER; - -typedef struct _CM_PNP_BIOS_DEVICE_NODE -{ - USHORT Size; - UCHAR Node; - ULONG ProductId; - UCHAR DeviceType[3]; - USHORT DeviceAttributes; -} CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE; - -typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK -{ - UCHAR Signature[4]; - UCHAR Revision; - UCHAR Length; - USHORT ControlField; - UCHAR Checksum; - ULONG EventFlagAddress; - USHORT RealModeEntryOffset; - USHORT RealModeEntrySegment; - USHORT ProtectedModeEntryOffset; - ULONG ProtectedModeCodeBaseAddress; - ULONG OemDeviceId; - USHORT RealModeDataBaseAddress; - ULONG ProtectedModeDataBaseAddress; -} CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK; - -#include <poppack.h> - -typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA -{ - ULONG BytesPerSector; - ULONG NumberOfCylinders; - ULONG SectorsPerTrack; - ULONG NumberOfHeads; -} CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA; - -typedef struct _CM_KEYBOARD_DEVICE_DATA { - USHORT Version; - USHORT Revision; - UCHAR Type; - UCHAR Subtype; - USHORT KeyboardFlags; -} CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA; - -typedef struct _CM_MCA_POS_DATA { - USHORT AdapterId; - UCHAR PosData1; - UCHAR PosData2; - UCHAR PosData3; - UCHAR PosData4; -} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef struct CM_Power_Data_s { - ULONG PD_Size; - DEVICE_POWER_STATE PD_MostRecentPowerState; - ULONG PD_Capabilities; - ULONG PD_D1Latency; - ULONG PD_D2Latency; - ULONG PD_D3Latency; - DEVICE_POWER_STATE PD_PowerStateMapping[PowerSystemMaximum]; - SYSTEM_POWER_STATE PD_DeepestSystemWake; -} CM_POWER_DATA, *PCM_POWER_DATA; - -#define PDCAP_D0_SUPPORTED 0x00000001 -#define PDCAP_D1_SUPPORTED 0x00000002 -#define PDCAP_D2_SUPPORTED 0x00000004 -#define PDCAP_D3_SUPPORTED 0x00000008 -#define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 -#define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 -#define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 -#define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 -#define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 - -#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ - -typedef struct _CM_SCSI_DEVICE_DATA { - USHORT Version; - USHORT Revision; - UCHAR HostIdentifier; -} CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA; - -typedef struct _CM_SERIAL_DEVICE_DATA { - USHORT Version; - USHORT Revision; - ULONG BaudClock; -} CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA; + +/* IO_STACK_LOCATION.Control */ + +#define SL_PENDING_RETURNED 0x01 +#define SL_ERROR_RETURNED 0x02 +#define SL_INVOKE_ON_CANCEL 0x20 +#define SL_INVOKE_ON_SUCCESS 0x40 +#define SL_INVOKE_ON_ERROR 0x80 + +/* IO_STACK_LOCATION.Parameters.ReadWriteControl.WhichSpace */ + +#define PCI_WHICHSPACE_CONFIG 0x0 +#define PCI_WHICHSPACE_ROM 0x52696350 /* 'PciR' */ /****************************************************************************** * RTL Types * Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
============================================================================== --- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Mon Mar 1 14:26:33 2010 @@ -407,19 +407,6 @@ IN PVOID Context, IN ULONG Count); -typedef enum _BUS_QUERY_ID_TYPE { - BusQueryDeviceID, - BusQueryHardwareIDs, - BusQueryCompatibleIDs, - BusQueryInstanceID, - BusQueryDeviceSerialNumber -} BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE; - -typedef enum _DEVICE_TEXT_TYPE { - DeviceTextDescription, - DeviceTextLocationInformation -} DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; - typedef BOOLEAN (DDKAPI *PKTRANSFER_ROUTINE)( VOID); @@ -1133,404 +1120,9 @@ #define SE_UNSOLICITED_INPUT_PRIVILEGE 6 -#include <pshpack4.h> -typedef struct _ACCESS_STATE { - LUID OperationID; - BOOLEAN SecurityEvaluated; - BOOLEAN GenerateAudit; - BOOLEAN GenerateOnClose; - BOOLEAN PrivilegesAllocated; - ULONG Flags; - ACCESS_MASK RemainingDesiredAccess; - ACCESS_MASK PreviouslyGrantedAccess; - ACCESS_MASK OriginalDesiredAccess; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; - PSECURITY_DESCRIPTOR SecurityDescriptor; - PVOID AuxData; - union { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet; - PRIVILEGE_SET PrivilegeSet; - } Privileges; - - BOOLEAN AuditPrivileges; - UNICODE_STRING ObjectName; - UNICODE_STRING ObjectTypeName; -} ACCESS_STATE, *PACCESS_STATE; -#include <poppack.h> - -typedef struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos; - PACCESS_STATE AccessState; - ACCESS_MASK DesiredAccess; - ULONG FullCreateOptions; -} IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT; - -#define IO_TYPE_ADAPTER 1 -#define IO_TYPE_CONTROLLER 2 -#define IO_TYPE_DEVICE 3 -#define IO_TYPE_DRIVER 4 -#define IO_TYPE_FILE 5 -#define IO_TYPE_IRP 6 -#define IO_TYPE_MASTER_ADAPTER 7 -#define IO_TYPE_OPEN_PACKET 8 -#define IO_TYPE_TIMER 9 -#define IO_TYPE_VPB 10 -#define IO_TYPE_ERROR_LOG 11 -#define IO_TYPE_ERROR_MESSAGE 12 -#define IO_TYPE_DEVICE_OBJECT_EXTENSION 13 - -#define IO_TYPE_CSQ_IRP_CONTEXT 1 -#define IO_TYPE_CSQ 2 - -struct _IO_CSQ; - -typedef struct _IO_CSQ_IRP_CONTEXT { - ULONG Type; - struct _IRP *Irp; - struct _IO_CSQ *Csq; -} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; - -typedef VOID -(DDKAPI *PIO_CSQ_INSERT_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); - -typedef VOID -(DDKAPI *PIO_CSQ_REMOVE_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); - -typedef PIRP -(DDKAPI *PIO_CSQ_PEEK_NEXT_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp, - IN PVOID PeekContext); - -typedef VOID -(DDKAPI *PIO_CSQ_ACQUIRE_LOCK)( - IN struct _IO_CSQ *Csq, - OUT PKIRQL Irql); - -typedef VOID -(DDKAPI *PIO_CSQ_RELEASE_LOCK)( - IN struct _IO_CSQ *Csq, - IN KIRQL Irql); - -typedef VOID -(DDKAPI *PIO_CSQ_COMPLETE_CANCELED_IRP)( - IN struct _IO_CSQ *Csq, - IN PIRP Irp); - -typedef struct _IO_CSQ { - ULONG Type; - PIO_CSQ_INSERT_IRP CsqInsertIrp; - PIO_CSQ_REMOVE_IRP CsqRemoveIrp; - PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; - PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; - PIO_CSQ_RELEASE_LOCK CsqReleaseLock; - PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; - PVOID ReservePointer; -} IO_CSQ, *PIO_CSQ; - -#if !defined(_ALPHA_) -#include <pshpack4.h> -#endif -typedef struct _IO_STACK_LOCATION { - UCHAR MajorFunction; - UCHAR MinorFunction; - UCHAR Flags; - UCHAR Control; - union { - struct { - PIO_SECURITY_CONTEXT SecurityContext; - ULONG Options; - USHORT POINTER_ALIGNMENT FileAttributes; - USHORT ShareAccess; - ULONG POINTER_ALIGNMENT EaLength; - } Create; - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - } Read; - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - } Write; - struct { - ULONG Length; - PUNICODE_STRING FileName; - FILE_INFORMATION_CLASS FileInformationClass; - ULONG FileIndex; - } QueryDirectory; - struct { - ULONG Length; - ULONG CompletionFilter; - } NotifyDirectory; - struct { - ULONG Length; - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; - } QueryFile; - struct { - ULONG Length; - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; - PFILE_OBJECT FileObject; - _ANONYMOUS_UNION union { - _ANONYMOUS_STRUCT struct { - BOOLEAN ReplaceIfExists; - BOOLEAN AdvanceOnly; - } DUMMYSTRUCTNAME; - ULONG ClusterCount; - HANDLE DeleteHandle; - } DUMMYUNIONNAME; - } SetFile; - struct { - ULONG Length; - PVOID EaList; - ULONG EaListLength; - ULONG EaIndex; - } QueryEa; - struct { - ULONG Length; - } SetEa; - struct { - ULONG Length; - FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; - } QueryVolume; - struct { - ULONG Length; - FS_INFORMATION_CLASS FsInformationClass; - } SetVolume; - struct { - ULONG OutputBufferLength; - ULONG InputBufferLength; - ULONG FsControlCode; - PVOID Type3InputBuffer; - } FileSystemControl; - struct { - PLARGE_INTEGER Length; - ULONG Key; - LARGE_INTEGER ByteOffset; - } LockControl; - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - PVOID Type3InputBuffer; - } DeviceIoControl; - struct { - SECURITY_INFORMATION SecurityInformation; - ULONG POINTER_ALIGNMENT Length; - } QuerySecurity; - struct { - SECURITY_INFORMATION SecurityInformation; - PSECURITY_DESCRIPTOR SecurityDescriptor; - } SetSecurity; - struct { - PVPB Vpb; - PDEVICE_OBJECT DeviceObject; - } MountVolume; - struct { - PVPB Vpb; - PDEVICE_OBJECT DeviceObject; - } VerifyVolume; - struct { - struct _SCSI_REQUEST_BLOCK *Srb; - } Scsi; - struct { - ULONG Length; - PSID StartSid; - struct _FILE_GET_QUOTA_INFORMATION *SidList; - ULONG SidListLength; - } QueryQuota; - struct { - ULONG Length; - } SetQuota; - struct { - DEVICE_RELATION_TYPE Type; - } QueryDeviceRelations; - struct { - CONST GUID *InterfaceType; - USHORT Size; - USHORT Version; - PINTERFACE Interface; - PVOID InterfaceSpecificData; - } QueryInterface; - struct { - PDEVICE_CAPABILITIES Capabilities; - } DeviceCapabilities; - struct { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; - } FilterResourceRequirements; - struct { - ULONG WhichSpace; - PVOID Buffer; - ULONG Offset; - ULONG POINTER_ALIGNMENT Length; - } ReadWriteConfig; - struct { - BOOLEAN Lock; - } SetLock; - struct { - BUS_QUERY_ID_TYPE IdType; - } QueryId; - struct { - DEVICE_TEXT_TYPE DeviceTextType; - LCID POINTER_ALIGNMENT LocaleId; - } QueryDeviceText; - struct { - BOOLEAN InPath; - BOOLEAN Reserved[3]; - DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; - } UsageNotification; - struct { - SYSTEM_POWER_STATE PowerState; - } WaitWake; - struct { - PPOWER_SEQUENCE PowerSequence; - } PowerSequence; - struct { - ULONG SystemContext; - POWER_STATE_TYPE POINTER_ALIGNMENT Type; - POWER_STATE POINTER_ALIGNMENT State; - POWER_ACTION POINTER_ALIGNMENT ShutdownType; - } Power; - struct { - PCM_RESOURCE_LIST AllocatedResources; - PCM_RESOURCE_LIST AllocatedResourcesTranslated; - } StartDevice; - struct { - ULONG_PTR ProviderId; - PVOID DataPath; - ULONG BufferSize; - PVOID Buffer; - } WMI; - struct { - PVOID Argument1; - PVOID Argument2; - PVOID Argument3; - PVOID Argument4; - } Others; - } Parameters; - PDEVICE_OBJECT DeviceObject; - PFILE_OBJECT FileObject; - PIO_COMPLETION_ROUTINE CompletionRoutine; - PVOID Context; -} IO_STACK_LOCATION, *PIO_STACK_LOCATION; -#if !defined(_ALPHA_) -#include <poppack.h> -#endif - -/* IO_STACK_LOCATION.Control */ - -#define SL_PENDING_RETURNED 0x01 -#define SL_ERROR_RETURNED 0x02 -#define SL_INVOKE_ON_CANCEL 0x20 -#define SL_INVOKE_ON_SUCCESS 0x40 -#define SL_INVOKE_ON_ERROR 0x80 - -/* IO_STACK_LOCATION.Parameters.ReadWriteControl.WhichSpace */ - -#define PCI_WHICHSPACE_CONFIG 0x0 -#define PCI_WHICHSPACE_ROM 0x52696350 /* 'PciR' */ - -typedef enum _KEY_INFORMATION_CLASS { - KeyBasicInformation, - KeyNodeInformation, - KeyFullInformation, - KeyNameInformation, - KeyCachedInformation, - KeyFlagsInformation -} KEY_INFORMATION_CLASS; - -typedef struct _KEY_BASIC_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG NameLength; - WCHAR Name[1]; -} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; - -typedef struct _KEY_FULL_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG ClassOffset; - ULONG ClassLength; - ULONG SubKeys; - ULONG MaxNameLen; - ULONG MaxClassLen; - ULONG Values; - ULONG MaxValueNameLen; - ULONG MaxValueDataLen; - WCHAR Class[1]; -} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; - -typedef struct _KEY_NODE_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG ClassOffset; - ULONG ClassLength; - ULONG NameLength; - WCHAR Name[1]; -} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION; - -typedef struct _KEY_VALUE_BASIC_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG NameLength; - WCHAR Name[1]; -} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION; - -typedef struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG DataOffset; - ULONG DataLength; - ULONG NameLength; - WCHAR Name[1]; -} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; - -typedef struct _KEY_VALUE_PARTIAL_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG DataLength; - UCHAR Data[1]; -} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; - -typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 { - ULONG Type; - ULONG DataLength; - UCHAR Data[1]; -} KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64; - -typedef struct _KEY_VALUE_ENTRY { - PUNICODE_STRING ValueName; - ULONG DataLength; - ULONG DataOffset; - ULONG Type; -} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; - -typedef enum _KEY_VALUE_INFORMATION_CLASS { - KeyValueBasicInformation, - KeyValueFullInformation, - KeyValuePartialInformation, - KeyValueFullInformationAlign64, - KeyValuePartialInformationAlign64 -} KEY_VALUE_INFORMATION_CLASS; - -typedef struct _KEY_WRITE_TIME_INFORMATION { - LARGE_INTEGER LastWriteTime; -} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION; - typedef struct _KEY_USER_FLAGS_INFORMATION { ULONG UserFlags; } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION; - -typedef enum _KEY_SET_INFORMATION_CLASS { - KeyWriteTimeInformation, - KeyUserFlagsInformation, - MaxKeySetInfoClass -} KEY_SET_INFORMATION_CLASS; /* KEY_VALUE_Xxx.Type */ Modified: branches/header-work/include/ndk/cmtypes.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ndk/cmtypes…
============================================================================== --- branches/header-work/include/ndk/cmtypes.h [iso-8859-1] (original) +++ branches/header-work/include/ndk/cmtypes.h [iso-8859-1] Mon Mar 1 14:26:33 2010 @@ -142,11 +142,14 @@ KeyValuePartialInformationAlign64 } KEY_VALUE_INFORMATION_CLASS; -typedef enum _KEY_SET_INFORMATION_CLASS -{ - KeyWriteTimeInformation, - KeyUserFlagsInformation, - MaxKeySetInfoClass +typedef enum _KEY_SET_INFORMATION_CLASS { + KeyWriteTimeInformation, + KeyWow64FlagsInformation, + KeyControlFlagsInformation, + KeySetVirtualizationInformation, + KeySetDebugInformation, + KeySetHandleTagsInformation, + MaxKeySetInfoClass } KEY_SET_INFORMATION_CLASS; #endif
14 years, 9 months
1
0
0
0
[janderwald] 45740: [MMIXER] - Silence warning for Christoph
by janderwald@svn.reactos.org
Author: janderwald Date: Mon Mar 1 13:08:36 2010 New Revision: 45740 URL:
http://svn.reactos.org/svn/reactos?rev=45740&view=rev
Log: [MMIXER] - Silence warning for Christoph Modified: trunk/reactos/lib/drivers/sound/mmixer/filter.c Modified: trunk/reactos/lib/drivers/sound/mmixer/filter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/f…
============================================================================== --- trunk/reactos/lib/drivers/sound/mmixer/filter.c [iso-8859-1] (original) +++ trunk/reactos/lib/drivers/sound/mmixer/filter.c [iso-8859-1] Mon Mar 1 13:08:36 2010 @@ -203,7 +203,9 @@ UNIMPLEMENTED; return MIXERCONTROL_CONTROLTYPE_VOLUME; } - UNIMPLEMENTED + //TODO + //check for other supported node types + //UNIMPLEMENTED return 0; }
14 years, 9 months
1
0
0
0
[cwittich] 45739: [MSI_WINETEST] sync msi_winetest to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Mar 1 13:03:29 2010 New Revision: 45739 URL:
http://svn.reactos.org/svn/reactos?rev=45739&view=rev
Log: [MSI_WINETEST] sync msi_winetest to wine 1.1.39 Modified: trunk/rostests/winetests/msi/automation.c trunk/rostests/winetests/msi/db.c trunk/rostests/winetests/msi/install.c trunk/rostests/winetests/msi/msi.c Modified: trunk/rostests/winetests/msi/automation.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/automation.…
============================================================================== --- trunk/rostests/winetests/msi/automation.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/automation.c [iso-8859-1] Mon Mar 1 13:03:29 2010 @@ -1863,7 +1863,11 @@ /* Session::Mode, get */ hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool); ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); - todo_wine ok(!bool, "Reboot at end session mode is %d\n", bool); + ok(!bool, "Reboot at end session mode is %d\n", bool); + + hr = Session_ModeGet(pSession, MSIRUNMODE_MAINTENANCE, &bool); + ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); + ok(!bool, "Maintenance mode is %d\n", bool); /* Session::Mode, put */ hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE); @@ -1873,6 +1877,17 @@ ok(bool, "Reboot at end session mode is %d, expected 1\n", bool); hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE); /* set it again so we don't reboot */ ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, TRUE); + todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool); + ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); + ok(bool, "Reboot now mode is %d, expected 1\n", bool); + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, FALSE); /* set it again so we don't reboot */ + todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); + + hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, TRUE); + ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr); /* Session::Database, get */ hr = Session_Database(pSession, &pDatabase); Modified: trunk/rostests/winetests/msi/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/db.c?rev=45…
============================================================================== --- trunk/rostests/winetests/msi/db.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/db.c [iso-8859-1] Mon Mar 1 13:03:29 2010 @@ -683,6 +683,30 @@ r = try_query( hdb, "select * from 'c'"); ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n"); + r = try_query( hdb, "CREATE TABLE `\5a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "SELECT * FROM \5a" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "CREATE TABLE `a\5` (`b` CHAR NOT NULL PRIMARY KEY `b`)" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "SELECT * FROM a\5" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "CREATE TABLE `-a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "SELECT * FROM -a" ); + todo_wine ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "CREATE TABLE `a-` (`b` CHAR NOT NULL PRIMARY KEY `b`)" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + + r = try_query( hdb, "SELECT * FROM a-" ); + ok( r == ERROR_SUCCESS , "query failed: %u\n", r ); + r = MsiCloseHandle( hdb ); ok(r == ERROR_SUCCESS , "Failed to close database transact\n"); @@ -1387,7 +1411,7 @@ static void test_streamtable(void) { - MSIHANDLE hdb = 0, rec, view; + MSIHANDLE hdb = 0, rec, view, hsi; char file[MAX_PATH]; char buf[MAX_PATH]; DWORD size; @@ -1431,6 +1455,46 @@ ok( check_record( rec, 2, "Data"), "wrong record type\n"); MsiCloseHandle( rec ); + + r = MsiDatabaseOpenView( hdb, + "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &view ); + ok( r == ERROR_SUCCESS, "Failed to open database view: %u\n", r ); + + r = MsiViewExecute( view, 0 ); + ok( r == ERROR_SUCCESS, "Failed to execute view: %u\n", r ); + + r = MsiViewFetch( view, &rec ); + ok( r == ERROR_NO_MORE_ITEMS, "Unexpected result: %u\n", r ); + + MsiCloseHandle( rec ); + MsiViewClose( view ); + MsiCloseHandle( view ); + + /* create a summary information stream */ + r = MsiGetSummaryInformationA( hdb, NULL, 1, &hsi ); + ok( r == ERROR_SUCCESS, "Failed to get summary information handle: %u\n", r ); + + r = MsiSummaryInfoSetPropertyA( hsi, PID_SECURITY, VT_I4, 2, NULL, NULL ); + ok( r == ERROR_SUCCESS, "Failed to set property: %u\n", r ); + + r = MsiSummaryInfoPersist( hsi ); + ok( r == ERROR_SUCCESS, "Failed to save summary information: %u\n", r ); + + MsiCloseHandle( hsi ); + + r = MsiDatabaseOpenView( hdb, + "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &view ); + ok( r == ERROR_SUCCESS, "Failed to open database view: %u\n", r ); + + r = MsiViewExecute( view, 0 ); + ok( r == ERROR_SUCCESS, "Failed to execute view: %u\n", r ); + + r = MsiViewFetch( view, &rec ); + ok( r == ERROR_SUCCESS, "Unexpected result: %u\n", r ); + + MsiCloseHandle( rec ); + MsiViewClose( view ); + MsiCloseHandle( view ); /* insert a file into the _Streams table */ create_file( "test.txt" ); Modified: trunk/rostests/winetests/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/install.c?r…
============================================================================== --- trunk/rostests/winetests/msi/install.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/install.c [iso-8859-1] Mon Mar 1 13:03:29 2010 @@ -1091,7 +1091,7 @@ static const CHAR cf_create_folders_dat[] = "Directory_\tComponent_\n" "s72\ts72\n" "CreateFolder\tDirectory_\tComponent_\n" - "MSITESTDIR\tOne\n"; + "FIRSTDIR\tOne\n"; static const CHAR cf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" "s72\tS255\tI2\n" @@ -1169,6 +1169,289 @@ "InstallValidate\t\t1400\n" "LaunchConditions\t\t100\n"; +static const CHAR font_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n" + "i2\ti4\tL64\tS255\tS32\tS72\n" + "Media\tDiskId\n" + "1\t3\t\t\tDISK1\t\n"; + +static const CHAR font_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "font.ttf\tfonts\tfont.ttf\t1000\t\t\t8192\t1\n"; + +static const CHAR font_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "fonts\t\t\tfont feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR font_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "fonts\t{F5920ED0-1183-4B8F-9330-86CE56557C05}\tMSITESTDIR\t0\t\tfont.ttf\n"; + +static const CHAR font_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "fonts\tfonts\n"; + +static const CHAR font_dat[] = "File_\tFontTitle\n" + "s72\tS128\n" + "Font\tFile_\n" + "font.ttf\tmsi test font\n"; + +static const CHAR font_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "ValidateProductID\t\t700\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "UnpublishFeatures\t\t1800\n" + "RemoveFiles\t\t3500\n" + "InstallFiles\t\t4000\n" + "RegisterFonts\t\t4100\n" + "UnregisterFonts\t\t4200\n" + "RegisterUser\t\t6000\n" + "RegisterProduct\t\t6100\n" + "PublishFeatures\t\t6300\n" + "PublishProduct\t\t6400\n" + "InstallFinalize\t\t6600"; + +static const CHAR vp_property_dat[] = "Property\tValue\n" + "s72\tl0\n" + "Property\tProperty\n" + "HASUIRUN\t0\n" + "INSTALLLEVEL\t3\n" + "InstallMode\tTypical\n" + "Manufacturer\tWine\n" + "PIDTemplate\t###-#######\n" + "ProductCode\t{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}\n" + "ProductLanguage\t1033\n" + "ProductName\tMSITEST\n" + "ProductVersion\t1.1.1\n" + "UpgradeCode\t{4C0EAA15-0264-4E5A-8758-609EF142B92D}\n"; + +static const CHAR vp_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n" + "s72\ti2\tS64\tS0\tS255\n" + "CustomAction\tAction\n" + "SetProductID1\t51\tProductID\t1\t\n" + "SetProductID2\t51\tProductID\t2\t\n" + "TestProductID1\t19\t\t\tHalts installation\n" + "TestProductID2\t19\t\t\tHalts installation\n"; + +static const CHAR vp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "SetProductID1\tSET_PRODUCT_ID=1\t3000\n" + "SetProductID2\tSET_PRODUCT_ID=2\t3100\n" + "ValidateProductID\t\t3200\n" + "InstallExecute\t\t3300\n" + "TestProductID1\tProductID=1\t3400\n" + "TestProductID2\tProductID=\"123-1234567\"\t3500\n" + "InstallFiles\t\t4000\n" + "InstallFinalize\t\t6000\n"; + +static const CHAR odbc_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "ODBCdriver.dll\todbc\tODBCdriver.dll\t1000\t\t\t8192\t1\n" + "ODBCdriver2.dll\todbc\tODBCdriver2.dll\t1000\t\t\t8192\t2\n" + "ODBCtranslator.dll\todbc\tODBCtranslator.dll\t1000\t\t\t8192\t3\n" + "ODBCtranslator2.dll\todbc\tODBCtranslator2.dll\t1000\t\t\t8192\t4\n" + "ODBCsetup.dll\todbc\tODBCsetup.dll\t1000\t\t\t8192\t5\n"; + +static const CHAR odbc_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "odbc\t\t\todbc feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR odbc_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "odbc\todbc\n"; + +static const CHAR odbc_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n"; + +static const CHAR odbc_driver_dat[] = "Driver\tComponent_\tDescription\tFile_\tFile_Setup\n" + "s72\ts72\ts255\ts72\tS72\n" + "ODBCDriver\tDriver\n" + "ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n" + "ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n"; + +static const CHAR odbc_translator_dat[] = "Translator\tComponent_\tDescription\tFile_\tFile_Setup\n" + "s72\ts72\ts255\ts72\tS72\n" + "ODBCTranslator\tTranslator\n" + "ODBC test translator\todbc\tODBC test translator\tODBCtranslator.dll\t\n" + "ODBC test translator2\todbc\tODBC test translator2\tODBCtranslator2.dll\tODBCsetup.dll\n"; + +static const CHAR odbc_datasource_dat[] = "DataSource\tComponent_\tDescription\tDriverDescription\tRegistration\n" + "s72\ts72\ts255\ts255\ti2\n" + "ODBCDataSource\tDataSource\n" + "ODBC data source\todbc\tODBC data source\tODBC driver\t0\n"; + +static const CHAR odbc_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "InstallODBC\t\t3000\n" + "RemoveODBC\t\t3100\n" + "InstallFiles\t\t4000\n" + "InstallFinalize\t\t6000\n"; + +static const CHAR odbc_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n" + "i2\ti4\tL64\tS255\tS32\tS72\n" + "Media\tDiskId\n" + "1\t5\t\t\tDISK1\t\n"; + +static const CHAR tl_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "typelib.dll\ttypelib\ttypelib.dll\t1000\t\t\t8192\t1\n"; + +static const CHAR tl_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "typelib\t\t\ttypelib feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR tl_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "typelib\ttypelib\n"; + +static const CHAR tl_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "typelib\t{BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0}\tMSITESTDIR\t0\t\ttypelib.dll\n"; + +static const CHAR tl_typelib_dat[] = "LibID\tLanguage\tComponent_\tVersion\tDescription\tDirectory_\tFeature_\tCost\n" + "s38\ti2\ts72\tI4\tL128\tS72\ts38\tI4\n" + "TypeLib\tLibID\tLanguage\tComponent_\n" + "{EAC5166A-9734-4D91-878F-1DD02304C66C}\t0\ttypelib\t1793\t\tMSITESTDIR\ttypelib\t\n"; + +static const CHAR tl_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "RemoveFiles\t\t1700\n" + "InstallFiles\t\t2000\n" + "RegisterTypeLibraries\tREGISTER_TYPELIB=1\t3000\n" + "UnregisterTypeLibraries\t\t3100\n" + "RegisterProduct\t\t5100\n" + "PublishFeatures\t\t5200\n" + "PublishProduct\t\t5300\n" + "InstallFinalize\t\t6000\n"; + +static const CHAR crs_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "target.txt\tshortcut\ttarget.txt\t1000\t\t\t8192\t1\n"; + +static const CHAR crs_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "shortcut\t\t\tshortcut feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR crs_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "shortcut\tshortcut\n"; + +static const CHAR crs_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "shortcut\t{5D20E3C6-7206-498F-AC28-87AF2F9AD4CC}\tMSITESTDIR\t0\t\ttarget.txt\n"; + +static const CHAR crs_shortcut_dat[] = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n" + "s72\ts72\tl128\ts72\ts72\tL255\tL255\tI2\tS72\tI2\tI2\tS72\n" + "Shortcut\tShortcut\n" + "shortcut\tMSITESTDIR\tshortcut\tshortcut\t[MSITESTDIR]target.txt\t\t\t\t\t\t\t\n"; + +static const CHAR crs_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "RemoveFiles\t\t1700\n" + "InstallFiles\t\t2000\n" + "RemoveShortcuts\t\t3000\n" + "CreateShortcuts\t\t3100\n" + "RegisterProduct\t\t5000\n" + "PublishFeatures\t\t5100\n" + "PublishProduct\t\t5200\n" + "InstallFinalize\t\t6000\n"; + +static const CHAR pub_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" + "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" + "File\tFile\n" + "english.txt\tpublish\tenglish.txt\t1000\t\t\t8192\t1\n"; + +static const CHAR pub_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" + "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" + "Feature\tFeature\n" + "publish\t\t\tpublish feature\t1\t2\tMSITESTDIR\t0\n"; + +static const CHAR pub_feature_comp_dat[] = "Feature_\tComponent_\n" + "s38\ts72\n" + "FeatureComponents\tFeature_\tComponent_\n" + "publish\tpublish\n"; + +static const CHAR pub_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" + "s72\tS38\ts72\ti2\tS255\tS72\n" + "Component\tComponent\n" + "publish\t{B4EA0ACF-6238-426E-9C6D-7869F0F9C768}\tMSITESTDIR\t0\t\tenglish.txt\n"; + +static const CHAR pub_publish_component_dat[] = "ComponentId\tQualifier\tComponent_\tAppData\tFeature_\n" + "s38\ts255\ts72\tL255\ts38\n" + "PublishComponent\tComponentId\tQualifier\tComponent_\n" + "{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}\tenglish.txt\tpublish\t\tpublish\n"; + +static const CHAR pub_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "LaunchConditions\t\t100\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "RemoveFiles\t\t1700\n" + "InstallFiles\t\t2000\n" + "PublishComponents\t\t3000\n" + "UnpublishComponents\t\t3100\n" + "RegisterProduct\t\t5000\n" + "PublishFeatures\t\t5100\n" + "PublishProduct\t\t5200\n" + "InstallFinalize\t\t6000\n"; + typedef struct _msi_table { const CHAR *filename; @@ -1935,6 +2218,86 @@ ADD_TABLE(file), ADD_TABLE(sr_selfreg), ADD_TABLE(sr_install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + +static const msi_table font_tables[] = +{ + ADD_TABLE(font_component), + ADD_TABLE(directory), + ADD_TABLE(font_feature), + ADD_TABLE(font_feature_comp), + ADD_TABLE(font_file), + ADD_TABLE(font), + ADD_TABLE(font_install_exec_seq), + ADD_TABLE(font_media), + ADD_TABLE(property) +}; + +static const msi_table vp_tables[] = +{ + ADD_TABLE(component), + ADD_TABLE(directory), + ADD_TABLE(feature), + ADD_TABLE(feature_comp), + ADD_TABLE(file), + ADD_TABLE(vp_custom_action), + ADD_TABLE(vp_install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(vp_property) +}; + +static const msi_table odbc_tables[] = +{ + ADD_TABLE(odbc_component), + ADD_TABLE(directory), + ADD_TABLE(odbc_feature), + ADD_TABLE(odbc_feature_comp), + ADD_TABLE(odbc_file), + ADD_TABLE(odbc_driver), + ADD_TABLE(odbc_translator), + ADD_TABLE(odbc_datasource), + ADD_TABLE(odbc_install_exec_seq), + ADD_TABLE(odbc_media), + ADD_TABLE(property) +}; + +static const msi_table tl_tables[] = +{ + ADD_TABLE(tl_component), + ADD_TABLE(directory), + ADD_TABLE(tl_feature), + ADD_TABLE(tl_feature_comp), + ADD_TABLE(tl_file), + ADD_TABLE(tl_typelib), + ADD_TABLE(tl_install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + +static const msi_table crs_tables[] = +{ + ADD_TABLE(crs_component), + ADD_TABLE(directory), + ADD_TABLE(crs_feature), + ADD_TABLE(crs_feature_comp), + ADD_TABLE(crs_file), + ADD_TABLE(crs_shortcut), + ADD_TABLE(crs_install_exec_seq), + ADD_TABLE(media), + ADD_TABLE(property) +}; + +static const msi_table pub_tables[] = +{ + ADD_TABLE(directory), + ADD_TABLE(pub_component), + ADD_TABLE(pub_feature), + ADD_TABLE(pub_feature_comp), + ADD_TABLE(pub_file), + ADD_TABLE(pub_publish_component), + ADD_TABLE(pub_install_exec_seq), ADD_TABLE(media), ADD_TABLE(property) }; @@ -7242,23 +7605,43 @@ static void process_pending_renames(HKEY hkey) { - char *buf, *src, *dst; - DWORD size; + char *buf, *src, *dst, *buf2, *buf2ptr; + DWORD size, buf2len = 0; LONG ret; + BOOL found = FALSE; ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size); buf = HeapAlloc(GetProcessHeap(), 0, size); + buf2ptr = buf2 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); buf[0] = 0; ret = RegQueryValueExA(hkey, rename_ops, NULL, NULL, (LPBYTE)buf, &size); ok(!ret, "RegQueryValueExA failed %d (%u)\n", ret, GetLastError()); - ok(strstr(buf, "msitest\\maximus") != NULL, "Unexpected value \"%s\"\n", buf); for (src = buf; *src; src = dst + strlen(dst) + 1) { DWORD flags = MOVEFILE_COPY_ALLOWED; dst = src + strlen(src) + 1; + + if (!strstr(src, "msitest")) + { + lstrcpyA(buf2ptr, src); + buf2len += strlen(src) + 1; + buf2ptr += strlen(src) + 1; + if (*dst) + { + lstrcpyA(buf2ptr, dst); + buf2ptr += strlen(dst) + 1; + buf2len += strlen(dst) + 1; + } + buf2ptr++; + buf2len++; + continue; + } + + found = TRUE; + if (*dst == '!') { flags |= MOVEFILE_REPLACE_EXISTING; @@ -7273,8 +7656,19 @@ else ok(DeleteFileA(src), "Failed to delete file %s (%u)\n", src, GetLastError()); } + + ok(found, "Expected a 'msitest' entry\n"); + + if (*buf2) + { + buf2len++; + RegSetValueExA(hkey, rename_ops, 0, REG_MULTI_SZ, (LPBYTE)buf2, buf2len); + } + else + RegDeleteValueA(hkey, rename_ops); + HeapFree(GetProcessHeap(), 0, buf); - RegDeleteValueA(hkey, rename_ops); + HeapFree(GetProcessHeap(), 0, buf2); } static BOOL file_matches_data(LPCSTR file, LPCSTR data) @@ -7298,7 +7692,6 @@ static void test_file_in_use(void) { UINT r; - DWORD size; HANDLE file; HKEY hkey; char path[MAX_PATH]; @@ -7310,11 +7703,6 @@ } RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey); - if (!RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size)) - { - skip("Pending file rename operations, skipping test\n"); - return; - } CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); @@ -7351,7 +7739,6 @@ static void test_file_in_use_cab(void) { UINT r; - DWORD size; HANDLE file; HKEY hkey; char path[MAX_PATH]; @@ -7363,11 +7750,6 @@ } RegOpenKeyExA(HKEY_LOCAL_MACHINE, session_manager, 0, KEY_ALL_ACCESS, &hkey); - if (!RegQueryValueExA(hkey, rename_ops, NULL, NULL, NULL, &size)) - { - skip("Pending file rename operations, skipping test\n"); - return; - } CreateDirectoryA("msitest", NULL); create_file("maximus", 500); @@ -7532,21 +7914,9 @@ ok(!delete_pf("msitest\\filename", TRUE), "File installed\n"); ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n"); ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n"); - todo_wine ok(!delete_pf("msitest", FALSE), "Directory created\n"); - - delete_test_files(); -} - -static void test_remove_folder(void) -{ - UINT r; - - create_test_files(); - create_database(msifile, rf_tables, sizeof(rf_tables) / sizeof(msi_table)); - - MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - - r = MsiInstallProductA(msifile, NULL); + ok(!delete_pf("msitest", FALSE), "Directory created\n"); + + r = MsiInstallProductA(msifile, "LOCAL=Two"); ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n"); @@ -7565,6 +7935,50 @@ delete_test_files(); } +static void test_remove_folder(void) +{ + UINT r; + + create_test_files(); + create_database(msifile, rf_tables, sizeof(rf_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\first", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\filename", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n"); + ok(!delete_pf("msitest", FALSE), "Directory created\n"); + + r = MsiInstallProductA(msifile, "LOCAL=Two"); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\cabout\\four.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\cabout", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\changed\\three.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\changed", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\first\\two.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\first", FALSE), "Directory created\n"); + ok(!delete_pf("msitest\\filename", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\one.txt", TRUE), "File installed\n"); + ok(!delete_pf("msitest\\service.exe", TRUE), "File installed\n"); + ok(!delete_pf("msitest", FALSE), "Directory created\n"); + + delete_test_files(); +} + static void test_start_services(void) { UINT r; @@ -7697,6 +8111,194 @@ ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); + delete_test_files(); +} + +static void test_register_font(void) +{ + static const char regfont1[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"; + static const char regfont2[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Fonts"; + LONG ret; + HKEY key; + UINT r; + + create_test_files(); + create_file("msitest\\font.ttf", 1000); + create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, regfont1, &key); + if (ret) + RegOpenKeyA(HKEY_LOCAL_MACHINE, regfont2, &key); + + ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL); + ok(ret != ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n"); + + ret = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", ret); + + RegDeleteValueA(key, "msi test font"); + RegCloseKey(key); + delete_test_files(); +} + +static void test_validate_product_id(void) +{ + UINT r; + + create_test_files(); + create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=1"); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + r = MsiInstallProductA(msifile, "SET_PRODUCT_ID=2"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiInstallProductA(msifile, "PIDKEY=123-1234567"); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\changed", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\first", FALSE), "Directory not created\n"); + ok(delete_pf("msitest\\filename", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\one.txt", TRUE), "File not installed\n"); + ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n"); + ok(delete_pf("msitest", FALSE), "Directory not created\n"); + + delete_test_files(); +} + +static void test_install_remove_odbc(void) +{ + UINT r; + + create_test_files(); + create_file("msitest\\ODBCdriver.dll", 1000); + create_file("msitest\\ODBCdriver2.dll", 1000); + create_file("msitest\\ODBCtranslator.dll", 1000); + create_file("msitest\\ODBCtranslator2.dll", 1000); + create_file("msitest\\ODBCsetup.dll", 1000); + create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(delete_pf("msitest\\ODBCdriver.dll", TRUE), "file not created\n"); + ok(delete_pf("msitest\\ODBCdriver2.dll", TRUE), "file not created\n"); + ok(delete_pf("msitest\\ODBCtranslator.dll", TRUE), "file not created\n"); + ok(delete_pf("msitest\\ODBCtranslator2.dll", TRUE), "file not created\n"); + ok(delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not created\n"); + ok(delete_pf("msitest", FALSE), "directory not created\n"); + + delete_test_files(); +} + +static void test_register_typelib(void) +{ + UINT r; + + create_test_files(); + create_file("msitest\\typelib.dll", 1000); + create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, "REGISTER_TYPELIB=1"); + ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(!delete_pf("msitest\\typelib.dll", TRUE), "file not removed\n"); + todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n"); + + delete_test_files(); +} + +static void test_create_remove_shortcut(void) +{ + UINT r; + + create_test_files(); + create_file("msitest\\target.txt", 1000); + create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(pf_exists("msitest\\target.txt"), "file not created\n"); + ok(pf_exists("msitest\\shortcut.lnk"), "file not created\n"); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + ok(!delete_pf("msitest\\shortcut.lnk", TRUE), "file not removed\n"); + ok(!delete_pf("msitest\\target.txt", TRUE), "file not removed\n"); + todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n"); + + delete_test_files(); +} + +static void test_publish_components(void) +{ + static char keypath[] = + "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA"; + + UINT r; + LONG res; + HKEY key; + + create_test_files(); + create_file("msitest\\english.txt", 1000); + create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key); + ok(res == ERROR_SUCCESS, "components key not created %d\n", res); + + res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL); + ok(res == ERROR_SUCCESS, "value not found %d\n", res); + RegCloseKey(key); + + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + + res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key); + ok(res == ERROR_FILE_NOT_FOUND, "unexpected result %d\n", res); + + ok(!delete_pf("msitest\\english.txt", TRUE), "file not removed\n"); + todo_wine ok(!delete_pf("msitest", FALSE), "directory not removed\n"); delete_test_files(); } @@ -7796,6 +8398,12 @@ test_start_services(); test_delete_services(); test_self_registration(); + test_register_font(); + test_validate_product_id(); + test_install_remove_odbc(); + test_register_typelib(); + test_create_remove_shortcut(); + test_publish_components(); DeleteFileA(log_file); Modified: trunk/rostests/winetests/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msi/msi.c?rev=4…
============================================================================== --- trunk/rostests/winetests/msi/msi.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msi/msi.c [iso-8859-1] Mon Mar 1 13:03:29 2010 @@ -10888,6 +10888,183 @@ LocalFree(usersid); } +static void test_MsiGetPatchInfo(void) +{ + UINT r; + char prod_code[MAX_PATH], prod_squashed[MAX_PATH], val[MAX_PATH]; + char patch_code[MAX_PATH], patch_squashed[MAX_PATH], keypath[MAX_PATH]; + WCHAR valW[MAX_PATH], patch_codeW[MAX_PATH]; + HKEY hkey_product, hkey_patch, hkey_patches, hkey_udprops, hkey_udproduct; + HKEY hkey_udpatch, hkey_udpatches, hkey_udproductpatches, hkey_udproductpatch; + DWORD size; + LONG res; + + create_test_guid(patch_code, patch_squashed); + create_test_guid(prod_code, prod_squashed); + MultiByteToWideChar(CP_ACP, 0, patch_code, -1, patch_codeW, MAX_PATH); + + r = MsiGetPatchInfoA(NULL, NULL, NULL, NULL); + ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiGetPatchInfoA(patch_code, NULL, NULL, NULL); + ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, NULL, NULL); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r); + + size = 0; + r = MsiGetPatchInfoA(patch_code, NULL, NULL, &size); + ok(r == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiGetPatchInfoA(patch_code, "", NULL, &size); + ok(r == ERROR_UNKNOWN_PROPERTY, "expected ERROR_UNKNOWN_PROPERTY, got %u\n", r); + + lstrcpyA(keypath, "Software\\Classes\\Installer\\Products\\"); + lstrcatA(keypath, prod_squashed); + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &hkey_product); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* product key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged, got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + res = RegCreateKeyA(hkey_product, "Patches", &hkey_patches); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* patches key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + res = RegCreateKeyA(hkey_patches, patch_squashed, &hkey_patch); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* patch key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"); + lstrcatA(keypath, "\\UserData\\S-1-5-18\\Products\\"); + lstrcatA(keypath, prod_squashed); + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &hkey_udproduct); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", res); + + /* UserData product key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + res = RegCreateKeyA(hkey_udproduct, "InstallProperties", &hkey_udprops); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* InstallProperties key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged, got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + res = RegCreateKeyA(hkey_udproduct, "Patches", &hkey_udpatches); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* UserData Patches key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + res = RegCreateKeyA(hkey_udproduct, "Patches", &hkey_udproductpatches); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + res = RegCreateKeyA(hkey_udproductpatches, patch_squashed, &hkey_udproductpatch); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + /* UserData product patch key exists */ + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected val to be unchanged got \"%s\"\n", val); + ok(size == MAX_PATH, "expected size to be unchanged got %u\n", size); + + lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"); + lstrcatA(keypath, "\\UserData\\S-1-5-18\\Patches\\"); + lstrcatA(keypath, patch_squashed); + + res = RegCreateKeyA(HKEY_LOCAL_MACHINE, keypath, &hkey_udpatch); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + res = RegSetValueExA(hkey_udpatch, "LocalPackage", 0, REG_SZ, (const BYTE *)"c:\\test.msp", 12); + ok(res == ERROR_SUCCESS, "expected ERROR_SUCCESS got %d\n", res); + + /* UserData Patch key exists */ + size = 0; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", r); + ok(!lstrcmpA(val, "apple"), "expected \"apple\", got \"%s\"\n", val); + ok(size == 11, "expected 11 got %u\n", size); + + size = MAX_PATH; + lstrcpyA(val, "apple"); + r = MsiGetPatchInfoA(patch_code, INSTALLPROPERTY_LOCALPACKAGEA, val, &size); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS got %u\n", r); + ok(!lstrcmpA(val, "c:\\test.msp"), "expected \"c:\\test.msp\", got \"%s\"\n", val); + ok(size == 11, "expected 11 got %u\n", size); + + size = 0; + valW[0] = 0; + r = MsiGetPatchInfoW(patch_codeW, INSTALLPROPERTY_LOCALPACKAGEW, valW, &size); + ok(r == ERROR_MORE_DATA, "expected ERROR_MORE_DATA got %u\n", r); + ok(!valW[0], "expected 0 got %u\n", valW[0]); + ok(size == 11, "expected 11 got %u\n", size); + + size = MAX_PATH; + valW[0] = 0; + r = MsiGetPatchInfoW(patch_codeW, INSTALLPROPERTY_LOCALPACKAGEW, valW, &size); + ok(r == ERROR_SUCCESS, "expected ERROR_SUCCESS got %u\n", r); + ok(valW[0], "expected > 0 got %u\n", valW[0]); + ok(size == 11, "expected 11 got %u\n", size); + + RegDeleteKeyA(hkey_udproductpatch, ""); + RegCloseKey(hkey_udproductpatch); + RegDeleteKeyA(hkey_udproductpatches, ""); + RegCloseKey(hkey_udproductpatches); + RegDeleteKeyA(hkey_udpatch, ""); + RegCloseKey(hkey_udpatch); + RegDeleteKeyA(hkey_patches, ""); + RegCloseKey(hkey_patches); + RegDeleteKeyA(hkey_product, ""); + RegCloseKey(hkey_product); + RegDeleteKeyA(hkey_patch, ""); + RegCloseKey(hkey_patch); + RegDeleteKeyA(hkey_udpatches, ""); + RegCloseKey(hkey_udpatches); + RegDeleteKeyA(hkey_udprops, ""); + RegCloseKey(hkey_udprops); + RegDeleteKeyA(hkey_udproduct, ""); + RegCloseKey(hkey_udproduct); +} + static void test_MsiEnumProducts(void) { UINT r; @@ -10985,6 +11162,7 @@ test_MsiEnumPatchesEx(); test_MsiEnumPatches(); test_MsiGetPatchInfoEx(); + test_MsiGetPatchInfo(); test_MsiEnumProducts(); }
14 years, 9 months
1
0
0
0
[cwittich] 45738: [MSI] sync msi to wine 1.1.39
by cwittich@svn.reactos.org
Author: cwittich Date: Mon Mar 1 13:01:30 2010 New Revision: 45738 URL:
http://svn.reactos.org/svn/reactos?rev=45738&view=rev
Log: [MSI] sync msi to wine 1.1.39 Modified: trunk/reactos/dll/win32/msi/action.c trunk/reactos/dll/win32/msi/classes.c trunk/reactos/dll/win32/msi/database.c trunk/reactos/dll/win32/msi/events.c trunk/reactos/dll/win32/msi/files.c trunk/reactos/dll/win32/msi/font.c trunk/reactos/dll/win32/msi/helpers.c trunk/reactos/dll/win32/msi/install.c trunk/reactos/dll/win32/msi/msi.c trunk/reactos/dll/win32/msi/msi.spec trunk/reactos/dll/win32/msi/msi_It.rc trunk/reactos/dll/win32/msi/msipriv.h trunk/reactos/dll/win32/msi/msiserver.idl trunk/reactos/dll/win32/msi/package.c trunk/reactos/dll/win32/msi/streams.c trunk/reactos/dll/win32/msi/suminfo.c trunk/reactos/dll/win32/msi/table.c trunk/reactos/dll/win32/msi/tokenize.c trunk/reactos/include/psdk/msi.h Modified: trunk/reactos/dll/win32/msi/action.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/action.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/action.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/action.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -886,10 +886,24 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - LPCWSTR dir; + LPCWSTR dir, component; LPWSTR full_path; MSIRECORD *uirow; MSIFOLDER *folder; + MSICOMPONENT *comp; + + component = MSI_RecordGetString(row, 2); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_LOCAL; dir = MSI_RecordGetString(row,1); if (!dir) @@ -951,7 +965,7 @@ /* create all the folders required by the components are going to install */ LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) { - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) + if (comp->ActionRequest != INSTALLSTATE_LOCAL) continue; msi_create_directory( package, comp->Directory ); } @@ -983,10 +997,24 @@ static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param ) { MSIPACKAGE *package = param; - LPCWSTR dir; + LPCWSTR dir, component; LPWSTR full_path; MSIRECORD *uirow; MSIFOLDER *folder; + MSICOMPONENT *comp; + + component = MSI_RecordGetString(row, 2); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal: %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; dir = MSI_RecordGetString( row, 1 ); if (!dir) @@ -2231,16 +2259,12 @@ if (!comp) return ERROR_SUCCESS; - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) - { - TRACE("Skipping write due to disabled component %s\n", - debugstr_w(component)); - + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); comp->Action = comp->Installed; - - return ERROR_SUCCESS; - } - + return ERROR_SUCCESS; + } comp->Action = INSTALLSTATE_LOCAL; name = MSI_RecordGetString(row, 4); @@ -2623,7 +2647,7 @@ { ComponentList *cl; - if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_LOCAL )) + if (feature->ActionRequest != INSTALLSTATE_LOCAL) continue; LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) @@ -2638,7 +2662,7 @@ { ComponentList *cl; - if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ABSENT )) + if (feature->ActionRequest != INSTALLSTATE_ABSENT) continue; LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) @@ -2704,8 +2728,8 @@ debugstr_w(comp->FullKeypath), comp->RefCount); - if (ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL) || - ACTION_VerifyComponentForAction( comp, INSTALLSTATE_SOURCE)) + if (comp->ActionRequest == INSTALLSTATE_LOCAL || + comp->ActionRequest == INSTALLSTATE_SOURCE) { if (!comp->FullKeypath) continue; @@ -2771,7 +2795,7 @@ } RegCloseKey(hkey); } - else if (ACTION_VerifyComponentForAction(comp, INSTALLSTATE_ABSENT)) + else if (comp->ActionRequest == INSTALLSTATE_ABSENT) { if (package->Context == MSIINSTALLCONTEXT_MACHINE) MSIREG_DeleteUserDataComponentKey(comp->ComponentId, szLocalSid); @@ -2862,27 +2886,24 @@ HMODULE module; HRESULT hr; - static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0}; - component = MSI_RecordGetString(row,3); comp = get_loaded_component(package,component); if (!comp) return ERROR_SUCCESS; - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) - { - TRACE("Skipping typelib reg due to disabled component\n"); - + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation: %s\n", debugstr_w(component)); comp->Action = comp->Installed; - - return ERROR_SUCCESS; - } - + return ERROR_SUCCESS; + } comp->Action = INSTALLSTATE_LOCAL; file = get_loaded_file( package, comp->KeyPath ); if (!file) return ERROR_SUCCESS; + + ui_actiondata( package, szRegisterTypeLibraries, row ); module = LoadLibraryExW( file->TargetPath, NULL, LOAD_LIBRARY_AS_DATAFILE ); if (module) @@ -2913,11 +2934,7 @@ ERR("Failed to register type library %s\n", debugstr_w(tl_struct.path)); else - { - ui_actiondata(package,szRegisterTypeLibraries,row); - TRACE("Registered %s\n", debugstr_w(tl_struct.path)); - } ITypeLib_Release(tl_struct.ptLib); msi_free(tl_struct.path); @@ -2935,7 +2952,7 @@ if (FAILED(hr)) { ERR("Failed to load type library: %08x\n", hr); - return ERROR_FUNCTION_FAILED; + return ERROR_INSTALL_FAILURE; } ITypeLib_Release(tlib); @@ -2967,31 +2984,119 @@ return rc; } +static UINT ITERATE_UnregisterTypeLibraries( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPCWSTR component, guid; + MSICOMPONENT *comp; + GUID libid; + UINT version; + LCID language; + SYSKIND syskind; + HRESULT hr; + + component = MSI_RecordGetString( row, 3 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + ui_actiondata( package, szUnregisterTypeLibraries, row ); + + guid = MSI_RecordGetString( row, 1 ); + CLSIDFromString( (LPWSTR)guid, &libid ); + version = MSI_RecordGetInteger( row, 4 ); + language = MSI_RecordGetInteger( row, 2 ); + +#ifdef _WIN64 + syskind = SYS_WIN64; +#else + syskind = SYS_WIN32; +#endif + + hr = UnRegisterTypeLib( &libid, (version >> 8) & 0xffff, version & 0xff, language, syskind ); + if (FAILED(hr)) + { + WARN("Failed to unregister typelib: %08x\n", hr); + } + + return ERROR_SUCCESS; +} + +static UINT ACTION_UnregisterTypeLibraries( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','T','y','p','e','L','i','b','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_UnregisterTypeLibraries, package ); + msiobj_release( &view->hdr ); + return rc; +} + +static WCHAR *get_link_file( MSIPACKAGE *package, MSIRECORD *row ) +{ + static const WCHAR szlnk[] = {'.','l','n','k',0}; + LPCWSTR directory, extension; + LPWSTR link_folder, link_file, filename; + + directory = MSI_RecordGetString( row, 2 ); + link_folder = resolve_folder( package, directory, FALSE, FALSE, TRUE, NULL ); + + /* may be needed because of a bug somewhere else */ + create_full_pathW( link_folder ); + + filename = msi_dup_record_field( row, 3 ); + reduce_to_longfilename( filename ); + + extension = strchrW( filename, '.' ); + if (!extension || strcmpiW( extension, szlnk )) + { + int len = strlenW( filename ); + filename = msi_realloc( filename, len * sizeof(WCHAR) + sizeof(szlnk) ); + memcpy( filename + len, szlnk, sizeof(szlnk) ); + } + link_file = build_directory_name( 2, link_folder, filename ); + msi_free( link_folder ); + msi_free( filename ); + + return link_file; +} + static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param) { MSIPACKAGE *package = param; - LPWSTR target_file, target_folder, filename; - LPCWSTR buffer, extension; + LPWSTR link_file, deformated, path; + LPCWSTR component, target; MSICOMPONENT *comp; - static const WCHAR szlnk[]={'.','l','n','k',0}; IShellLinkW *sl = NULL; IPersistFile *pf = NULL; HRESULT res; - buffer = MSI_RecordGetString(row,4); - comp = get_loaded_component(package,buffer); + component = MSI_RecordGetString(row, 4); + comp = get_loaded_component(package, component); if (!comp) return ERROR_SUCCESS; - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL )) - { - TRACE("Skipping shortcut creation due to disabled component\n"); - + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation %s\n", debugstr_w(component)); comp->Action = comp->Installed; - - return ERROR_SUCCESS; - } - + return ERROR_SUCCESS; + } comp->Action = INSTALLSTATE_LOCAL; ui_actiondata(package,szCreateShortcuts,row); @@ -3012,31 +3117,10 @@ goto err; } - buffer = MSI_RecordGetString(row,2); - target_folder = resolve_folder(package, buffer,FALSE,FALSE,TRUE,NULL); - - /* may be needed because of a bug somewhere else */ - create_full_pathW(target_folder); - - filename = msi_dup_record_field( row, 3 ); - reduce_to_longfilename(filename); - - extension = strchrW(filename,'.'); - if (!extension || strcmpiW(extension,szlnk)) - { - int len = strlenW(filename); - filename = msi_realloc(filename, len * sizeof(WCHAR) + sizeof(szlnk)); - memcpy(filename + len, szlnk, sizeof(szlnk)); - } - target_file = build_directory_name(2, target_folder, filename); - msi_free(target_folder); - msi_free(filename); - - buffer = MSI_RecordGetString(row,5); - if (strchrW(buffer,'[')) - { - LPWSTR deformated; - deformat_string(package,buffer,&deformated); + target = MSI_RecordGetString(row, 5); + if (strchrW(target, '[')) + { + deformat_string(package, target, &deformated); IShellLinkW_SetPath(sl,deformated); msi_free(deformated); } @@ -3048,17 +3132,16 @@ if (!MSI_RecordIsNull(row,6)) { - LPWSTR deformated; - buffer = MSI_RecordGetString(row,6); - deformat_string(package,buffer,&deformated); + LPCWSTR arguments = MSI_RecordGetString(row, 6); + deformat_string(package, arguments, &deformated); IShellLinkW_SetArguments(sl,deformated); msi_free(deformated); } if (!MSI_RecordIsNull(row,7)) { - buffer = MSI_RecordGetString(row,7); - IShellLinkW_SetDescription(sl,buffer); + LPCWSTR description = MSI_RecordGetString(row, 7); + IShellLinkW_SetDescription(sl, description); } if (!MSI_RecordIsNull(row,8)) @@ -3066,20 +3149,18 @@ if (!MSI_RecordIsNull(row,9)) { - LPWSTR Path; INT index; - - buffer = MSI_RecordGetString(row,9); - - Path = build_icon_path(package,buffer); + LPCWSTR icon = MSI_RecordGetString(row, 9); + + path = build_icon_path(package, icon); index = MSI_RecordGetInteger(row,10); /* no value means 0 */ if (index == MSI_NULL_INTEGER) index = 0; - IShellLinkW_SetIconLocation(sl,Path,index); - msi_free(Path); + IShellLinkW_SetIconLocation(sl, path, index); + msi_free(path); } if (!MSI_RecordIsNull(row,11)) @@ -3087,18 +3168,19 @@ if (!MSI_RecordIsNull(row,12)) { - LPWSTR Path; - buffer = MSI_RecordGetString(row,12); - Path = resolve_folder(package, buffer, FALSE, FALSE, TRUE, NULL); - if (Path) - IShellLinkW_SetWorkingDirectory(sl,Path); - msi_free(Path); - } - - TRACE("Writing shortcut to %s\n",debugstr_w(target_file)); - IPersistFile_Save(pf,target_file,FALSE); - - msi_free(target_file); + LPCWSTR wkdir = MSI_RecordGetString(row, 12); + path = resolve_folder(package, wkdir, FALSE, FALSE, TRUE, NULL); + if (path) + IShellLinkW_SetWorkingDirectory(sl, path); + msi_free(path); + } + + link_file = get_link_file(package, row); + + TRACE("Writing shortcut to %s\n", debugstr_w(link_file)); + IPersistFile_Save(pf, link_file, FALSE); + + msi_free(link_file); err: if (pf) @@ -3129,6 +3211,58 @@ if (SUCCEEDED(res)) CoUninitialize(); + + return rc; +} + +static UINT ITERATE_RemoveShortcuts( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPWSTR link_file; + LPCWSTR component; + MSICOMPONENT *comp; + + component = MSI_RecordGetString( row, 4 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } + comp->Action = INSTALLSTATE_ABSENT; + + ui_actiondata( package, szRemoveShortcuts, row ); + + link_file = get_link_file( package, row ); + + TRACE("Removing shortcut file %s\n", debugstr_w( link_file )); + if (!DeleteFileW( link_file )) + { + WARN("Failed to remove shortcut file %u\n", GetLastError()); + } + msi_free( link_file ); + + return ERROR_SUCCESS; +} + +static UINT ACTION_RemoveShortcuts( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','S','h','o','r','t','c','u','t','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveShortcuts, package ); + msiobj_release( &view->hdr ); return rc; } @@ -3510,17 +3644,15 @@ component = MSI_RecordGetString(row, 8); comp = get_loaded_component(package,component); - - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL)) - { - TRACE("Skipping ini file due to disabled component %s\n", - debugstr_w(component)); - + if (!comp) + return ERROR_SUCCESS; + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation %s\n", debugstr_w(component)); comp->Action = comp->Installed; - - return ERROR_SUCCESS; - } - + return ERROR_SUCCESS; + } comp->Action = INSTALLSTATE_LOCAL; identifier = MSI_RecordGetString(row,1); @@ -3818,10 +3950,9 @@ BOOL absent = FALSE; MSIRECORD *uirow; - if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_LOCAL ) && - !ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_SOURCE ) && - !ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ADVERTISED )) - absent = TRUE; + if (feature->ActionRequest != INSTALLSTATE_LOCAL && + feature->ActionRequest != INSTALLSTATE_SOURCE && + feature->ActionRequest != INSTALLSTATE_ADVERTISED) absent = TRUE; size = 1; LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry ) @@ -4359,31 +4490,33 @@ static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param) { MSIPACKAGE *package = param; - LPCWSTR compgroupid=NULL; - LPCWSTR feature=NULL; - LPCWSTR text = NULL; - LPCWSTR qualifier = NULL; - LPCWSTR component = NULL; - LPWSTR advertise = NULL; - LPWSTR output = NULL; + LPCWSTR compgroupid, component, feature, qualifier, text; + LPWSTR advertise = NULL, output = NULL; HKEY hkey; - UINT rc = ERROR_SUCCESS; + UINT rc; MSICOMPONENT *comp; - DWORD sz = 0; + MSIFEATURE *feat; + DWORD sz; MSIRECORD *uirow; - component = MSI_RecordGetString(rec,3); - comp = get_loaded_component(package,component); - - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL ) && - !ACTION_VerifyComponentForAction( comp, INSTALLSTATE_SOURCE ) && - !ACTION_VerifyComponentForAction( comp, INSTALLSTATE_ADVERTISED )) - { - TRACE("Skipping: Component %s not scheduled for install\n", - debugstr_w(component)); - - return ERROR_SUCCESS; - } + feature = MSI_RecordGetString(rec, 5); + feat = get_loaded_feature(package, feature); + if (!feat) + return ERROR_SUCCESS; + + if (feat->ActionRequest != INSTALLSTATE_LOCAL && + feat->ActionRequest != INSTALLSTATE_SOURCE && + feat->ActionRequest != INSTALLSTATE_ADVERTISED) + { + TRACE("Feature %s not scheduled for installation\n", debugstr_w(feature)); + feat->Action = feat->Installed; + return ERROR_SUCCESS; + } + + component = MSI_RecordGetString(rec, 3); + comp = get_loaded_component(package, component); + if (!comp) + return ERROR_SUCCESS; compgroupid = MSI_RecordGetString(rec,1); qualifier = MSI_RecordGetString(rec,2); @@ -4393,8 +4526,6 @@ goto end; text = MSI_RecordGetString(rec,4); - feature = MSI_RecordGetString(rec,5); - advertise = create_component_advertise_string(package, comp, feature); sz = strlenW(advertise); @@ -4452,6 +4583,80 @@ return rc; } +static UINT ITERATE_UnpublishComponent( MSIRECORD *rec, LPVOID param ) +{ + static const WCHAR szInstallerComponents[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'I','n','s','t','a','l','l','e','r','\\', + 'C','o','m','p','o','n','e','n','t','s','\\',0}; + + MSIPACKAGE *package = param; + LPCWSTR compgroupid, component, feature, qualifier; + MSICOMPONENT *comp; + MSIFEATURE *feat; + MSIRECORD *uirow; + WCHAR squashed[GUID_SIZE], keypath[MAX_PATH]; + LONG res; + + feature = MSI_RecordGetString( rec, 5 ); + feat = get_loaded_feature( package, feature ); + if (!feat) + return ERROR_SUCCESS; + + if (feat->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Feature %s not scheduled for removal\n", debugstr_w(feature)); + feat->Action = feat->Installed; + return ERROR_SUCCESS; + } + + component = MSI_RecordGetString( rec, 3 ); + comp = get_loaded_component( package, component ); + if (!comp) + return ERROR_SUCCESS; + + compgroupid = MSI_RecordGetString( rec, 1 ); + qualifier = MSI_RecordGetString( rec, 2 ); + + squash_guid( compgroupid, squashed ); + strcpyW( keypath, szInstallerComponents ); + strcatW( keypath, squashed ); + + res = RegDeleteKeyW( HKEY_CURRENT_USER, keypath ); + if (res != ERROR_SUCCESS) + { + WARN("Unable to delete component key %d\n", res); + } + + uirow = MSI_CreateRecord( 2 ); + MSI_RecordSetStringW( uirow, 1, compgroupid ); + MSI_RecordSetStringW( uirow, 2, qualifier ); + ui_actiondata( package, szUnpublishComponents, uirow ); + msiobj_release( &uirow->hdr ); + + return ERROR_SUCCESS; +} + +static UINT ACTION_UnpublishComponents( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','P','u','b','l','i','s','h', + 'C','o','m','p','o','n','e','n','t','`',0}; + + rc = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_UnpublishComponent, package ); + msiobj_release( &view->hdr ); + + return rc; +} + static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) { MSIPACKAGE *package = param; @@ -4597,7 +4802,7 @@ { MSIPACKAGE *package = param; MSICOMPONENT *comp; - SC_HANDLE scm, service = NULL; + SC_HANDLE scm = NULL, service = NULL; LPCWSTR *vector = NULL; LPWSTR name, args; DWORD event, numargs; @@ -4612,7 +4817,10 @@ event = MSI_RecordGetInteger(rec, 3); if (!(event & msidbServiceControlEventStart)) - return ERROR_SUCCESS; + { + r = ERROR_SUCCESS; + goto done; + } scm = OpenSCManagerW(NULL, NULL, SC_MANAGER_CONNECT); if (!scm) @@ -4893,15 +5101,17 @@ driver_file = msi_find_file(package, MSI_RecordGetString(rec, 4)); setup_file = msi_find_file(package, MSI_RecordGetString(rec, 5)); - if (!driver_file || !setup_file) + if (!driver_file) { ERR("ODBC Driver entry not found!\n"); return ERROR_FUNCTION_FAILED; } - len = lstrlenW(desc) + lstrlenW(driver_fmt) + lstrlenW(driver_file->FileName) + - lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName) + - lstrlenW(usage_fmt) + 1; + len = lstrlenW(desc) + lstrlenW(driver_fmt) + lstrlenW(driver_file->FileName); + if (setup_file) + len += lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName); + len += lstrlenW(usage_fmt) + 1; + driver = msi_alloc(len * sizeof(WCHAR)); if (!driver) return ERROR_OUTOFMEMORY; @@ -4913,8 +5123,11 @@ sprintfW(ptr, driver_fmt, driver_file->FileName); ptr += lstrlenW(ptr) + 1; - sprintfW(ptr, setup_fmt, setup_file->FileName); - ptr += lstrlenW(ptr) + 1; + if (setup_file) + { + sprintfW(ptr, setup_fmt, setup_file->FileName); + ptr += lstrlenW(ptr) + 1; + } lstrcpyW(ptr, usage_fmt); ptr += lstrlenW(ptr) + 1; @@ -4957,14 +5170,16 @@ translator_file = msi_find_file(package, MSI_RecordGetString(rec, 4)); setup_file = msi_find_file(package, MSI_RecordGetString(rec, 5)); - if (!translator_file || !setup_file) + if (!translator_file) { ERR("ODBC Translator entry not found!\n"); return ERROR_FUNCTION_FAILED; } - len = lstrlenW(desc) + lstrlenW(translator_fmt) + lstrlenW(translator_file->FileName) + - lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName) + 1; + len = lstrlenW(desc) + lstrlenW(translator_fmt) + lstrlenW(translator_file->FileName) + 1; + if (setup_file) + len += lstrlenW(setup_fmt) + lstrlenW(setup_file->FileName); + translator = msi_alloc(len * sizeof(WCHAR)); if (!translator) return ERROR_OUTOFMEMORY; @@ -4976,8 +5191,11 @@ sprintfW(ptr, translator_fmt, translator_file->FileName); ptr += lstrlenW(ptr) + 1; - sprintfW(ptr, setup_fmt, setup_file->FileName); - ptr += lstrlenW(ptr) + 1; + if (setup_file) + { + sprintfW(ptr, setup_fmt, setup_file->FileName); + ptr += lstrlenW(ptr) + 1; + } *ptr = '\0'; translator_path = strdupW(translator_file->TargetPath); @@ -5021,8 +5239,8 @@ if (!attrs) return ERROR_OUTOFMEMORY; - sprintfW(attrs, attrs_fmt, desc); - attrs[len - 1] = '\0'; + len = sprintfW(attrs, attrs_fmt, desc); + attrs[len + 1] = 0; if (!SQLConfigDataSourceW(NULL, request, driver, attrs)) { @@ -5072,6 +5290,120 @@ rc = MSI_IterateRecords(view, NULL, ITERATE_InstallODBCDataSource, package); msiobj_release(&view->hdr); + + return rc; +} + +static UINT ITERATE_RemoveODBCDriver( MSIRECORD *rec, LPVOID param ) +{ + DWORD usage; + LPCWSTR desc; + + desc = MSI_RecordGetString( rec, 3 ); + if (!SQLRemoveDriverW( desc, FALSE, &usage )) + { + WARN("Failed to remove ODBC driver\n"); + } + else if (!usage) + { + FIXME("Usage count reached 0\n"); + } + + return ERROR_SUCCESS; +} + +static UINT ITERATE_RemoveODBCTranslator( MSIRECORD *rec, LPVOID param ) +{ + DWORD usage; + LPCWSTR desc; + + desc = MSI_RecordGetString( rec, 3 ); + if (!SQLRemoveTranslatorW( desc, &usage )) + { + WARN("Failed to remove ODBC translator\n"); + } + else if (!usage) + { + FIXME("Usage count reached 0\n"); + } + + return ERROR_SUCCESS; +} + +static UINT ITERATE_RemoveODBCDataSource( MSIRECORD *rec, LPVOID param ) +{ + LPWSTR attrs; + LPCWSTR desc, driver; + WORD request = ODBC_REMOVE_SYS_DSN; + INT registration; + DWORD len; + + static const WCHAR attrs_fmt[] = { + 'D','S','N','=','%','s',0 }; + + desc = MSI_RecordGetString( rec, 3 ); + driver = MSI_RecordGetString( rec, 4 ); + registration = MSI_RecordGetInteger( rec, 5 ); + + if (registration == msidbODBCDataSourceRegistrationPerMachine) request = ODBC_REMOVE_SYS_DSN; + else if (registration == msidbODBCDataSourceRegistrationPerUser) request = ODBC_REMOVE_DSN; + + len = strlenW( attrs_fmt ) + strlenW( desc ) + 1 + 1; + attrs = msi_alloc( len * sizeof(WCHAR) ); + if (!attrs) + return ERROR_OUTOFMEMORY; + + FIXME("Use ODBCSourceAttribute table\n"); + + len = sprintfW( attrs, attrs_fmt, desc ); + attrs[len + 1] = 0; + + if (!SQLConfigDataSourceW( NULL, request, driver, attrs )) + { + WARN("Failed to remove ODBC data source\n"); + } + msi_free( attrs ); + + return ERROR_SUCCESS; +} + +static UINT ACTION_RemoveODBC( MSIPACKAGE *package ) +{ + UINT rc; + MSIQUERY *view; + + static const WCHAR driver_query[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + 'O','D','B','C','D','r','i','v','e','r',0 }; + + static const WCHAR translator_query[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + 'O','D','B','C','T','r','a','n','s','l','a','t','o','r',0 }; + + static const WCHAR source_query[] = { + 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + 'O','D','B','C','D','a','t','a','S','o','u','r','c','e',0 }; + + rc = MSI_DatabaseOpenViewW( package->db, driver_query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveODBCDriver, package ); + msiobj_release( &view->hdr ); + + rc = MSI_DatabaseOpenViewW( package->db, translator_query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveODBCTranslator, package ); + msiobj_release( &view->hdr ); + + rc = MSI_DatabaseOpenViewW( package->db, source_query, &view ); + if (rc != ERROR_SUCCESS) + return ERROR_SUCCESS; + + rc = MSI_IterateRecords( view, NULL, ITERATE_RemoveODBCDataSource, package ); + msiobj_release( &view->hdr ); return rc; } @@ -6125,10 +6457,52 @@ return r; } +static UINT ACTION_ValidateProductID( MSIPACKAGE *package ) +{ + LPWSTR key, template, id; + UINT r = ERROR_SUCCESS; + + id = msi_dup_property( package, szProductID ); + if (id) + { + msi_free( id ); + return ERROR_SUCCESS; + } + template = msi_dup_property( package, szPIDTemplate ); + key = msi_dup_property( package, szPIDKEY ); + + if (key && template) + { + FIXME( "partial stub: template %s key %s\n", debugstr_w(template), debugstr_w(key) ); + r = MSI_SetPropertyW( package, szProductID, key ); + } + msi_free( template ); + msi_free( key ); + return r; +} + static UINT ACTION_ScheduleReboot( MSIPACKAGE *package ) { TRACE("\n"); package->need_reboot = 1; + return ERROR_SUCCESS; +} + +static UINT ACTION_AllocateRegistrySpace( MSIPACKAGE *package ) +{ + TRACE("%p\n", package); + return ERROR_SUCCESS; +} + +static UINT ACTION_DisableRollback( MSIPACKAGE *package ) +{ + FIXME("%p\n", package); + return ERROR_SUCCESS; +} + +static UINT ACTION_InstallAdminPackage( MSIPACKAGE *package ) +{ + FIXME("%p\n", package); return ERROR_SUCCESS; } @@ -6156,12 +6530,6 @@ return ERROR_SUCCESS; } -static UINT ACTION_AllocateRegistrySpace( MSIPACKAGE *package ) -{ - TRACE("%p\n", package); - return ERROR_SUCCESS; -} - static UINT ACTION_RemoveIniValues( MSIPACKAGE *package ) { static const WCHAR table[] = @@ -6194,13 +6562,6 @@ return msi_unimplemented_action_stub( package, "MigrateFeatureStates", table ); } -static UINT ACTION_ValidateProductID( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { - 'P','r','o','d','u','c','t','I','D',0 }; - return msi_unimplemented_action_stub( package, "ValidateProductID", table ); -} - static UINT ACTION_RemoveEnvironmentStrings( MSIPACKAGE *package ) { static const WCHAR table[] = { @@ -6215,12 +6576,6 @@ return msi_unimplemented_action_stub( package, "MsiUnpublishAssemblies", table ); } -static UINT ACTION_UnregisterFonts( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'F','o','n','t',0 }; - return msi_unimplemented_action_stub( package, "UnregisterFonts", table ); -} - static UINT ACTION_RMCCPSearch( MSIPACKAGE *package ) { static const WCHAR table[] = { 'C','C','P','S','e','a','r','c','h',0 }; @@ -6257,36 +6612,18 @@ return msi_unimplemented_action_stub( package, "RemoveExistingProducts", table ); } -static UINT ACTION_RemoveODBC( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'O','D','B','C','D','r','i','v','e','r',0 }; - return msi_unimplemented_action_stub( package, "RemoveODBC", table ); -} - static UINT ACTION_RemoveRegistryValues( MSIPACKAGE *package ) { static const WCHAR table[] = { 'R','e','m','o','v','e','R','e','g','i','s','t','r','y',0 }; return msi_unimplemented_action_stub( package, "RemoveRegistryValues", table ); } -static UINT ACTION_RemoveShortcuts( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'S','h','o','r','t','c','u','t',0 }; - return msi_unimplemented_action_stub( package, "RemoveShortcuts", table ); -} - static UINT ACTION_SetODBCFolders( MSIPACKAGE *package ) { static const WCHAR table[] = { 'D','i','r','e','c','t','o','r','y',0 }; return msi_unimplemented_action_stub( package, "SetODBCFolders", table ); } -static UINT ACTION_UnpublishComponents( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t',0 }; - return msi_unimplemented_action_stub( package, "UnpublishComponents", table ); -} - static UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) { static const WCHAR table[] = { 'A','p','p','I','d',0 }; @@ -6309,12 +6646,6 @@ { static const WCHAR table[] = { 'P','r','o','g','I','d',0 }; return msi_unimplemented_action_stub( package, "UnregisterProgIdInfo", table ); -} - -static UINT ACTION_UnregisterTypeLibraries( MSIPACKAGE *package ) -{ - static const WCHAR table[] = { 'T','y','p','e','L','i','b',0 }; - return msi_unimplemented_action_stub( package, "UnregisterTypeLibraries", table ); } typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*); @@ -6335,13 +6666,13 @@ { szCreateFolders, ACTION_CreateFolders }, { szCreateShortcuts, ACTION_CreateShortcuts }, { szDeleteServices, ACTION_DeleteServices }, - { szDisableRollback, NULL }, + { szDisableRollback, ACTION_DisableRollback }, { szDuplicateFiles, ACTION_DuplicateFiles }, { szExecuteAction, ACTION_ExecuteAction }, { szFileCost, ACTION_FileCost }, { szFindRelatedProducts, ACTION_FindRelatedProducts }, { szForceReboot, ACTION_ForceReboot }, - { szInstallAdminPackage, NULL }, + { szInstallAdminPackage, ACTION_InstallAdminPackage }, { szInstallExecute, ACTION_InstallExecute }, { szInstallExecuteAgain, ACTION_InstallExecute }, { szInstallFiles, ACTION_InstallFiles}, Modified: trunk/reactos/dll/win32/msi/classes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/classes.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/classes.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/classes.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -809,16 +809,17 @@ continue; feature = cls->Feature; + if (!feature) + continue; /* * MSDN says that these are based on Feature not on Component. */ - if (!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_LOCAL ) && - !ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ADVERTISED )) - { - TRACE("Skipping class %s reg due to disabled feature %s\n", - debugstr_w(cls->clsid), debugstr_w(feature->Feature)); - + if (feature->ActionRequest != INSTALLSTATE_LOCAL && + feature->ActionRequest != INSTALLSTATE_ADVERTISED ) + { + TRACE("Feature %s not scheduled for installation, skipping regstration of class %s\n", + debugstr_w(feature->Feature), debugstr_w(cls->clsid)); continue; } @@ -1142,18 +1143,18 @@ continue; feature = ext->Feature; + if (!feature) + continue; /* * yes. MSDN says that these are based on _Feature_ not on * Component. So verify the feature is to be installed */ - if ((!ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_LOCAL )) && - !(install_on_demand && - ACTION_VerifyFeatureForAction( feature, INSTALLSTATE_ADVERTISED ))) - { - TRACE("Skipping extension %s reg due to disabled feature %s\n", - debugstr_w(ext->Extension), debugstr_w(feature->Feature)); - + if (feature->ActionRequest != INSTALLSTATE_LOCAL && + !(install_on_demand && feature->ActionRequest == INSTALLSTATE_ADVERTISED)) + { + TRACE("Feature %s not scheduled for installation, skipping registration of extension %s\n", + debugstr_w(feature->Feature), debugstr_w(ext->Extension)); continue; } Modified: trunk/reactos/dll/win32/msi/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/database.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/database.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -125,20 +125,14 @@ UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm ) { - LPWSTR encname; HRESULT r; - encname = encode_streamname(FALSE, stname); - - TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname)); - - if (clone_open_stream( db, encname, stm ) == ERROR_SUCCESS) - { - msi_free( encname ); + TRACE("%s\n", debugstr_w(stname)); + + if (clone_open_stream( db, stname, stm ) == ERROR_SUCCESS) return ERROR_SUCCESS; - } - - r = IStorage_OpenStream( db->storage, encname, NULL, + + r = IStorage_OpenStream( db->storage, stname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); if( FAILED( r ) ) { @@ -147,14 +141,12 @@ LIST_FOR_EACH_ENTRY( transform, &db->transforms, MSITRANSFORM, entry ) { TRACE("looking for %s in transform storage\n", debugstr_w(stname) ); - r = IStorage_OpenStream( transform->stg, encname, NULL, + r = IStorage_OpenStream( transform->stg, stname, NULL, STGM_READ | STGM_SHARE_EXCLUSIVE, 0, stm ); if (SUCCEEDED(r)) break; } } - - msi_free( encname ); if( SUCCEEDED(r) ) { @@ -181,10 +173,15 @@ ULONG sz, count; IStream *stm = NULL; STATSTG stat; - - r = db_get_raw_stream( db, stname, &stm ); + LPWSTR encname; + + encname = encode_streamname( FALSE, stname ); + r = db_get_raw_stream( db, encname, &stm ); + msi_free( encname ); + if( r != ERROR_SUCCESS) return ret; + r = IStream_Stat(stm, &stat, STATFLAG_NONAME ); if( FAILED( r ) ) { @@ -223,16 +220,6 @@ IStream_Release( stm ); return ret; -} - -void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) -{ - MSITRANSFORM *t; - - t = msi_alloc( sizeof *t ); - t->stg = stg; - IStorage_AddRef( stg ); - list_add_tail( &db->transforms, &t->entry ); } static void free_transforms( MSIDATABASE *db ) @@ -257,6 +244,19 @@ IStream_Release( s->stm ); msi_free( s ); } +} + +void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) +{ + MSITRANSFORM *t; + + t = msi_alloc( sizeof *t ); + t->stg = stg; + IStorage_AddRef( stg ); + list_add_tail( &db->transforms, &t->entry ); + + /* the transform may add or replace streams */ + free_streams( db ); } static VOID MSI_CloseDatabase( MSIOBJECTHDR *arg ) Modified: trunk/reactos/dll/win32/msi/events.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/events.c?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/events.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/events.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -386,9 +386,6 @@ static UINT ControlEvent_ValidateProductID(MSIPACKAGE *package, LPCWSTR argument, msi_dialog *dialog) { - static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0}; - static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0}; - static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0}; LPWSTR key, template; UINT ret = ERROR_SUCCESS; Modified: trunk/reactos/dll/win32/msi/files.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/files.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/files.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/files.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -108,7 +108,7 @@ LIST_FOR_EACH_ENTRY(file, &package->files, MSIFILE, entry) { - if (!ACTION_VerifyComponentForAction(file->Component, INSTALLSTATE_LOCAL)) + if (file->Component->ActionRequest != INSTALLSTATE_LOCAL) { TRACE("File %s is not scheduled for install\n", debugstr_w(file->File)); @@ -358,19 +358,15 @@ component = MSI_RecordGetString(row,2); comp = get_loaded_component(package,component); - - if (!ACTION_VerifyComponentForAction( comp, INSTALLSTATE_LOCAL )) - { - TRACE("Skipping copy due to disabled component %s\n", - debugstr_w(component)); - - /* the action taken was the same as the current install state */ - if (comp) - comp->Action = comp->Installed; - + if (!comp) return ERROR_SUCCESS; - } - + + if (comp->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation %s\n", debugstr_w(component)); + comp->Action = comp->Installed; + return ERROR_SUCCESS; + } comp->Action = INSTALLSTATE_LOCAL; file_key = MSI_RecordGetString(row,3); Modified: trunk/reactos/dll/win32/msi/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/font.c?rev=4…
============================================================================== --- trunk/reactos/dll/win32/msi/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/font.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -66,6 +66,21 @@ static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0}; +static const WCHAR szUnregisterFonts[] = + {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0}; + +static const WCHAR regfont1[] = + {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s',' ','N','T','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'F','o','n','t','s',0}; +static const WCHAR regfont2[] = + {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'F','o','n','t','s',0}; /* * Code based off of code located here @@ -174,20 +189,7 @@ LPWSTR name; LPCWSTR filename; MSIFILE *file; - static const WCHAR regfont1[] = - {'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s',' ','N','T','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'F','o','n','t','s',0}; - static const WCHAR regfont2[] = - {'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', - 'F','o','n','t','s',0}; - HKEY hkey1; - HKEY hkey2; + HKEY hkey1, hkey2; MSIRECORD *uirow; LPWSTR uipath, p; @@ -199,10 +201,9 @@ return ERROR_SUCCESS; } - /* check to make sure that component is installed */ - if (!ACTION_VerifyComponentForAction( file->Component, INSTALLSTATE_LOCAL)) - { - TRACE("Skipping: Component not scheduled for install\n"); + if (file->Component->ActionRequest != INSTALLSTATE_LOCAL) + { + TRACE("Component not scheduled for installation\n"); return ERROR_SUCCESS; } @@ -259,3 +260,81 @@ return ERROR_SUCCESS; } + +static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param ) +{ + MSIPACKAGE *package = param; + LPWSTR name; + LPCWSTR filename; + MSIFILE *file; + HKEY hkey1, hkey2; + MSIRECORD *uirow; + LPWSTR uipath, p; + + filename = MSI_RecordGetString( row, 1 ); + file = get_loaded_file( package, filename ); + if (!file) + { + ERR("Unable to load file\n"); + return ERROR_SUCCESS; + } + + if (file->Component->ActionRequest != INSTALLSTATE_ABSENT) + { + TRACE("Component not scheduled for removal\n"); + return ERROR_SUCCESS; + } + + RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont1, &hkey1 ); + RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont2, &hkey2 ); + + if (MSI_RecordIsNull( row, 2 )) + name = load_ttfname_from( file->TargetPath ); + else + name = msi_dup_record_field( row, 2 ); + + if (name) + { + RegDeleteValueW( hkey1, name ); + RegDeleteValueW( hkey2, name ); + } + + msi_free( name ); + RegCloseKey( hkey1 ); + RegCloseKey( hkey2 ); + + /* the UI chunk */ + uirow = MSI_CreateRecord( 1 ); + uipath = strdupW( file->TargetPath ); + p = strrchrW( uipath,'\\' ); + if (p) p++; + else p = uipath; + MSI_RecordSetStringW( uirow, 1, p ); + ui_actiondata( package, szUnregisterFonts, uirow ); + msiobj_release( &uirow->hdr ); + msi_free( uipath ); + /* FIXME: call ui_progress? */ + + return ERROR_SUCCESS; +} + +UINT ACTION_UnregisterFonts( MSIPACKAGE *package ) +{ + UINT r; + MSIQUERY *view; + static const WCHAR query[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', + '`','F','o','n','t','`',0}; + + r = MSI_DatabaseOpenViewW( package->db, query, &view ); + if (r != ERROR_SUCCESS) + { + TRACE("MSI_DatabaseOpenViewW failed: %u\n", r); + return ERROR_SUCCESS; + } + + MSI_IterateRecords( view, NULL, ITERATE_UnregisterFonts, package ); + msiobj_release( &view->hdr ); + + return ERROR_SUCCESS; +} Modified: trunk/reactos/dll/win32/msi/helpers.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/helpers.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/helpers.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -602,28 +602,6 @@ MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row); msiobj_release(&row->hdr); -} - -BOOL ACTION_VerifyComponentForAction( const MSICOMPONENT* comp, INSTALLSTATE check ) -{ - if (!comp) - return FALSE; - - if (comp->ActionRequest == check) - return TRUE; - else - return FALSE; -} - -BOOL ACTION_VerifyFeatureForAction( const MSIFEATURE* feature, INSTALLSTATE check ) -{ - if (!feature) - return FALSE; - - if (feature->ActionRequest == check) - return TRUE; - else - return FALSE; } void reduce_to_longfilename(WCHAR* filename) Modified: trunk/reactos/dll/win32/msi/install.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/install.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/install.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/install.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -661,6 +661,8 @@ MSIPACKAGE *package; BOOL r = FALSE; + TRACE("%d %d\n", hInstall, iRunMode); + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { @@ -706,8 +708,16 @@ r = package->commit_action_running; break; + case MSIRUNMODE_MAINTENANCE: + r = msi_get_property_int( package, szInstalled, 0 ) != 0; + break; + + case MSIRUNMODE_REBOOTATEND: + r = package->need_reboot; + break; + default: - FIXME("%d %d\n", hInstall, iRunMode); + FIXME("unimplemented run mode: %d\n", iRunMode); r = TRUE; } @@ -719,8 +729,52 @@ */ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) { - FIXME("%d %d %d\n", hInstall, iRunMode, fState); - return ERROR_SUCCESS; + MSIPACKAGE *package; + UINT r; + + TRACE("%d %d %d\n", hInstall, iRunMode, fState); + + package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE ); + if (!package) + { + HRESULT hr; + IWineMsiRemotePackage *remote_package; + + remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall ); + if (!remote_package) + return FALSE; + + hr = IWineMsiRemotePackage_SetMode( remote_package, iRunMode, fState ); + IWineMsiRemotePackage_Release( remote_package ); + + if (FAILED(hr)) + { + if (HRESULT_FACILITY(hr) == FACILITY_WIN32) + return HRESULT_CODE(hr); + + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; + } + + switch (iRunMode) + { + case MSIRUNMODE_REBOOTATEND: + package->need_reboot = 1; + r = ERROR_SUCCESS; + break; + + case MSIRUNMODE_REBOOTNOW: + FIXME("unimplemented run mode: %d\n", iRunMode); + r = ERROR_FUNCTION_FAILED; + break; + + default: + r = ERROR_ACCESS_DENIED; + } + + return r; } /*********************************************************************** Modified: trunk/reactos/dll/win32/msi/msi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.c?rev=45…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -1611,6 +1611,93 @@ RegCloseKey(udprod); return r; +} + +UINT WINAPI MsiGetPatchInfoA( LPCSTR patch, LPCSTR attr, LPSTR buffer, LPDWORD buflen ) +{ + UINT r = ERROR_OUTOFMEMORY; + DWORD size; + LPWSTR patchW = NULL, attrW = NULL, bufferW = NULL; + + TRACE("%s %s %p %p\n", debugstr_a(patch), debugstr_a(attr), buffer, buflen); + + if (!patch || !attr) + return ERROR_INVALID_PARAMETER; + + if (!(patchW = strdupAtoW( patch ))) + goto done; + + if (!(attrW = strdupAtoW( attr ))) + goto done; + + size = 0; + r = MsiGetPatchInfoW( patchW, attrW, NULL, &size ); + if (r != ERROR_SUCCESS) + goto done; + + size++; + if (!(bufferW = msi_alloc( size * sizeof(WCHAR) ))) + { + r = ERROR_OUTOFMEMORY; + goto done; + } + + r = MsiGetPatchInfoW( patchW, attrW, bufferW, &size ); + if (r == ERROR_SUCCESS) + { + int len = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL ); + if (len > *buflen) + r = ERROR_MORE_DATA; + else if (buffer) + WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, *buflen, NULL, NULL ); + + *buflen = len - 1; + } + +done: + msi_free( patchW ); + msi_free( attrW ); + msi_free( bufferW ); + return r; +} + +UINT WINAPI MsiGetPatchInfoW( LPCWSTR patch, LPCWSTR attr, LPWSTR buffer, LPDWORD buflen ) +{ + UINT r; + WCHAR product[GUID_SIZE]; + DWORD index; + + TRACE("%s %s %p %p\n", debugstr_w(patch), debugstr_w(attr), buffer, buflen); + + if (!patch || !attr) + return ERROR_INVALID_PARAMETER; + + if (strcmpW( INSTALLPROPERTY_LOCALPACKAGEW, attr )) + return ERROR_UNKNOWN_PROPERTY; + + index = 0; + while (1) + { + r = MsiEnumProductsW( index, product ); + if (r != ERROR_SUCCESS) + break; + + r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_USERMANAGED, attr, buffer, buflen ); + if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA) + return r; + + r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, attr, buffer, buflen ); + if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA) + return r; + + r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_MACHINE, attr, buffer, buflen ); + if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA) + return r; + + index++; + } + + return ERROR_UNKNOWN_PRODUCT; } UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes) Modified: trunk/reactos/dll/win32/msi/msi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi.spec?rev…
============================================================================== --- trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi.spec [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -171,8 +171,8 @@ 175 stdcall MsiApplyPatchW(wstr wstr long wstr) 176 stdcall MsiAdvertiseScriptA(str long ptr long) 177 stdcall MsiAdvertiseScriptW(wstr long ptr long) -178 stub MsiGetPatchInfoA -179 stub MsiGetPatchInfoW +178 stdcall MsiGetPatchInfoA(str str ptr ptr) +179 stdcall MsiGetPatchInfoW(wstr wstr ptr ptr) 180 stdcall MsiEnumPatchesA(str long ptr ptr ptr) 181 stdcall MsiEnumPatchesW(str long ptr ptr ptr) 182 stdcall -private DllGetVersion(ptr) Modified: trunk/reactos/dll/win32/msi/msi_It.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msi_It.rc?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msi_It.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msi_It.rc [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -20,17 +20,21 @@ #include "windef.h" +/*UTF-8*/ +#pragma code_page(65001) + LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE { - 4 "The specified installation package could not be opened. Please check the file path and try again." + 4 "Impossibile aprire il pacchetto di installazione specificato. Per favore controlla l'indirizzo del file e riprova." 5 "percorso %s non trovato" 9 "inserire disco %s" 10 "parametri incorretti" 11 "immettere il nome della cartella che contiene %s" - 12 "sorgente di installazione per la funzionalità mancante" - 13 "periferica di rete per la funzionalità mancante" - 14 "funzionalità da:" + 12 "sorgente di installazione per la funzionalità mancante" + 13 "periferica di rete per la funzionalità mancante" + 14 "funzionalità da:" 15 "selezionare la cartella che contiene %s" } +#pragma code_page(default) Modified: trunk/reactos/dll/win32/msi/msipriv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msipriv.h?re…
============================================================================== --- trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msipriv.h [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -961,6 +961,7 @@ extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package); extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package); extern UINT ACTION_RegisterFonts(MSIPACKAGE *package); +extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package); /* Helpers */ extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ); @@ -981,8 +982,6 @@ extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR); extern LPWSTR build_directory_name(DWORD , ...); extern BOOL create_full_pathW(const WCHAR *path); -extern BOOL ACTION_VerifyComponentForAction(const MSICOMPONENT*, INSTALLSTATE); -extern BOOL ACTION_VerifyFeatureForAction(const MSIFEATURE*, INSTALLSTATE); extern void reduce_to_longfilename(WCHAR*); extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR); extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature); @@ -1071,6 +1070,11 @@ static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0}; static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0}; static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0}; +static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0}; +static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0}; +static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0}; +static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0}; +static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); Modified: trunk/reactos/dll/win32/msi/msiserver.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/msiserver.id…
============================================================================== --- trunk/reactos/dll/win32/msi/msiserver.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/msiserver.idl [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -64,6 +64,7 @@ HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value ); HRESULT GetSourcePath( [in] BSTR folder, [out] BSTR *value, [out] DWORD *size ); HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret ); + HRESULT SetMode( [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT GetFeatureState( [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT SetFeatureState( [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT GetComponentState( [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); Modified: trunk/reactos/dll/win32/msi/package.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/package.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/package.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/package.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -2104,6 +2104,13 @@ return S_OK; } +static HRESULT WINAPI mrp_SetMode( IWineMsiRemotePackage *iface, MSIRUNMODE mode, BOOL state ) +{ + msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface ); + UINT r = MsiSetMode(This->package, mode, state); + return HRESULT_FROM_WIN32(r); +} + static HRESULT WINAPI mrp_GetFeatureState( IWineMsiRemotePackage *iface, BSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action ) { @@ -2196,6 +2203,7 @@ mrp_SetTargetPath, mrp_GetSourcePath, mrp_GetMode, + mrp_SetMode, mrp_GetFeatureState, mrp_SetFeatureState, mrp_GetComponentState, Modified: trunk/reactos/dll/win32/msi/streams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/streams.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/streams.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -32,6 +32,7 @@ #include "query.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msidb); @@ -486,7 +487,8 @@ STATSTG stat; STREAM *stream = NULL; HRESULT hr; - UINT count = 0, size; + UINT r, count = 0, size; + LPWSTR encname; hr = IStorage_EnumElements(sv->db->storage, 0, NULL, 0, &stgenum); if (FAILED(hr)) @@ -505,7 +507,10 @@ break; if (stat.type != STGTY_STREAM) + { + CoTaskMemFree(stat.pwcsName); continue; + } /* table streams are not in the _Streams table */ if (*stat.pwcsName == 0x4840) @@ -522,13 +527,22 @@ break; } - hr = IStorage_OpenStream(sv->db->storage, stat.pwcsName, 0, - STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stream->stream); + if (!strcmpW(stat.pwcsName, szSumInfo)) + { + /* summary information stream is not encoded */ + r = db_get_raw_stream(sv->db, stat.pwcsName, &stream->stream); + } + else + { + encname = encode_streamname(FALSE, stat.pwcsName); + r = db_get_raw_stream(sv->db, encname, &stream->stream); + msi_free(encname); + } CoTaskMemFree(stat.pwcsName); - if (FAILED(hr)) - { - WARN("failed to open stream: %08x\n", hr); + if (r != ERROR_SUCCESS) + { + WARN("unable to get stream %u\n", r); count = -1; break; } Modified: trunk/reactos/dll/win32/msi/suminfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/suminfo.c?re…
============================================================================== --- trunk/reactos/dll/win32/msi/suminfo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/suminfo.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -86,9 +86,6 @@ #define SECT_HDR_SIZE (sizeof(PROPERTYSECTIONHEADER)) -static const WCHAR szSumInfo[] = { 5 ,'S','u','m','m','a','r','y', - 'I','n','f','o','r','m','a','t','i','o','n',0 }; - static void free_prop( PROPVARIANT *prop ) { if (prop->vt == VT_LPSTR ) Modified: trunk/reactos/dll/win32/msi/table.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/table.c?rev=…
============================================================================== --- trunk/reactos/dll/win32/msi/table.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/table.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -1168,7 +1168,7 @@ { MSITABLEVIEW *tv = (MSITABLEVIEW*)view; UINT r; - LPWSTR full_name = NULL; + LPWSTR encname, full_name = NULL; if( !view->ops->fetch_int ) return ERROR_INVALID_PARAMETER; @@ -1180,11 +1180,13 @@ return r; } - r = db_get_raw_stream( tv->db, full_name, stm ); + encname = encode_streamname( FALSE, full_name ); + r = db_get_raw_stream( tv->db, encname, stm ); if( r ) ERR("fetching stream %s, error = %d\n",debugstr_w(full_name), r); + msi_free( full_name ); - + msi_free( encname ); return r; } Modified: trunk/reactos/dll/win32/msi/tokenize.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/tokenize.c?r…
============================================================================== --- trunk/reactos/dll/win32/msi/tokenize.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msi/tokenize.c [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -166,9 +166,9 @@ */ static const char isIdChar[] = { /* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */ + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1x */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2x */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, /* 2x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, /* 3x */ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4x */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 5x */ Modified: trunk/reactos/include/psdk/msi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/msi.h?rev=457…
============================================================================== --- trunk/reactos/include/psdk/msi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/msi.h [iso-8859-1] Mon Mar 1 13:01:30 2010 @@ -503,6 +503,10 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR, LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, LPCWSTR, LPWSTR, LPDWORD); #define MsiGetPatchInfoEx WINELIB_NAME_AW(MsiGetPatchInfoEx) +UINT WINAPI MsiGetPatchInfoA(LPCSTR, LPCSTR, LPSTR, LPDWORD); +UINT WINAPI MsiGetPatchInfoW(LPCWSTR, LPCWSTR, LPWSTR, LPDWORD); +#define MsiGetPatchInfo WINELIB_NAME_AW(MsiGetPatchInfo) + UINT WINAPI MsiEnableLogA(DWORD, LPCSTR, DWORD); UINT WINAPI MsiEnableLogW(DWORD, LPCWSTR, DWORD); #define MsiEnableLog WINELIB_NAME_AW(MsiEnableLog)
14 years, 9 months
1
0
0
0
← Newer
1
...
86
87
88
89
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200