mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
![Joachim Henze](/assets/img/avatar_default.png)
This backports the following commits: 0.4.15-dev-7247-g8f349ab3c2
[NETCFGX] Create only one "Alternative Configuration" tab CORE-19328 0.4.15-dev-7124-g6a7315228c
[NETCFGX] IDD_TCPIP_ALTCF_DLG Fix radiobutton (#6083) CORE-19327 0.4.15-dev-7099-g5012c6a2b0
[NETCFGX] IDD_TCPIP_BASIC_DLG Radiobuttons need 2 arrow-down-presses instead of one (#6049) CORE-19327 *PARTIALLY* 0.4.15-dev-7023-ga95863b132
[NETCFGX] Half-implement TCP/IP alternate configuration (#6009) (I picked only some formatting, and the RC changes from that, not the initialization implementation yet) CORE-19331 0.4.15-dev-7015-g9e42809fc1
[NETCFGX] Use CheckDlgButton/IsDlgButtonChecked instead of BM_GETCHECK/BM_SETCHECK CORE-19331 0.4.15-dev-6990-g4939936165
[NETCFGX] Strip 2x wrong WS_DISABLED style on dlgs (#5987) 0.4.15-dev-6904-g1997c12252
[NETCFGX] 640x480-ify (#5946) 0.4.15-dev-6858-g0177b1af45
[NETCFGX] *.rc 640x480-ify IDD_TCPIP_BASIC_DLG and IDD_TCPIP_ALTCF_DLG (#5902) The binary size shrinks slightly on all branches: master RosBEWin2.2.2 GCC8.4.0 dbg x86 602.112 (0.4.15-dev-7264-ga328886) releases/0.4.14 RosBEWin2.1.6 GCC4.7.2 dbg x86 570.880 -> 568.832 releases/0.4.13 RosBEWin2.1.6 GCC4.7.2 dbg x86 569.344 -> 567.808 releases/0.4.12 RosBEWin2.1.6 GCC4.7.2 dbg x86 548.864 -> 547.328 releases/0.4.11 RosBEWin2.1.6 GCC4.7.2 dbg x86 502.272 -> 500.736 releases/0.4.10 RosBEWin2.1.6 GCC4.7.2 dbg x86 452.096 -> 450.560 releases/0.4. 9 RosBEWin2.1.6 GCC4.7.2 dbg x86 452.096 -> 450.560 releases/0.4. 8 RosBEWin2.1.6 GCC4.7.2 dbg x86 452.096 -> 450.560 releases/0.4. 7 RosBEWin2.1.6 GCC4.7.2 dbg x86 452.096 -> 450.560
125 lines
2.3 KiB
C
125 lines
2.3 KiB
C
#include "precomp.h"
|
|
|
|
typedef struct
|
|
{
|
|
const IClassFactoryVtbl *lpVtbl;
|
|
LONG ref;
|
|
CLSID *rclsid;
|
|
LPFNCREATEINSTANCE lpfnCI;
|
|
const IID * riidInst;
|
|
} IClassFactoryImpl;
|
|
|
|
|
|
static
|
|
HRESULT
|
|
WINAPI
|
|
IClassFactory_fnQueryInterface(
|
|
LPCLASSFACTORY iface,
|
|
REFIID riid,
|
|
LPVOID *ppvObj)
|
|
{
|
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
|
|
|
*ppvObj = NULL;
|
|
if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
|
|
{
|
|
*ppvObj = This;
|
|
InterlockedIncrement(&This->ref);
|
|
return S_OK;
|
|
}
|
|
return E_NOINTERFACE;
|
|
}
|
|
|
|
static
|
|
ULONG
|
|
WINAPI
|
|
IClassFactory_fnAddRef(
|
|
LPCLASSFACTORY iface)
|
|
{
|
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
|
ULONG refCount = InterlockedIncrement(&This->ref);
|
|
|
|
return refCount;
|
|
}
|
|
|
|
static
|
|
ULONG
|
|
WINAPI
|
|
IClassFactory_fnRelease(
|
|
LPCLASSFACTORY iface)
|
|
{
|
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
|
ULONG refCount = InterlockedDecrement(&This->ref);
|
|
|
|
if (!refCount)
|
|
{
|
|
CoTaskMemFree(This);
|
|
return 0;
|
|
}
|
|
return refCount;
|
|
}
|
|
|
|
static
|
|
HRESULT
|
|
WINAPI
|
|
IClassFactory_fnCreateInstance(
|
|
LPCLASSFACTORY iface,
|
|
LPUNKNOWN pUnkOuter,
|
|
REFIID riid,
|
|
LPVOID *ppvObject)
|
|
{
|
|
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
|
|
|
*ppvObject = NULL;
|
|
|
|
if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) || IsEqualCLSID(riid, &IID_IUnknown) )
|
|
{
|
|
return This->lpfnCI(pUnkOuter, riid, ppvObject);
|
|
}
|
|
|
|
return E_NOINTERFACE;
|
|
}
|
|
|
|
static
|
|
HRESULT
|
|
WINAPI IClassFactory_fnLockServer(
|
|
LPCLASSFACTORY iface,
|
|
BOOL fLock)
|
|
{
|
|
//IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
|
return E_NOTIMPL;
|
|
}
|
|
|
|
|
|
static const IClassFactoryVtbl dclfvt =
|
|
{
|
|
IClassFactory_fnQueryInterface,
|
|
IClassFactory_fnAddRef,
|
|
IClassFactory_fnRelease,
|
|
IClassFactory_fnCreateInstance,
|
|
IClassFactory_fnLockServer
|
|
};
|
|
|
|
|
|
IClassFactory *
|
|
IClassFactory_fnConstructor(
|
|
LPFNCREATEINSTANCE lpfnCI,
|
|
PLONG pcRefDll,
|
|
REFIID riidInst)
|
|
{
|
|
IClassFactoryImpl* lpclf;
|
|
|
|
lpclf = CoTaskMemAlloc(sizeof(IClassFactoryImpl));
|
|
lpclf->ref = 1;
|
|
lpclf->lpVtbl = &dclfvt;
|
|
lpclf->lpfnCI = lpfnCI;
|
|
|
|
if (pcRefDll)
|
|
InterlockedIncrement(pcRefDll);
|
|
lpclf->riidInst = riidInst;
|
|
|
|
return (LPCLASSFACTORY)lpclf;
|
|
}
|
|
|
|
|