Author: weiden
Date: Thu Sep 27 00:00:07 2007
New Revision: 29217
URL:
http://svn.reactos.org/svn/reactos?rev=29217&view=rev
Log:
Add initial implementation of the display adapter desk.cpl shell extension
Added:
trunk/reactos/dll/win32/shellext/deskadp/ (with props)
trunk/reactos/dll/win32/shellext/deskadp/deskadp.c (with props)
trunk/reactos/dll/win32/shellext/deskadp/deskadp.h (with props)
trunk/reactos/dll/win32/shellext/deskadp/deskadp.rbuild (with props)
trunk/reactos/dll/win32/shellext/deskadp/deskadp.rc (with props)
trunk/reactos/dll/win32/shellext/deskadp/deskadp.spec (with props)
trunk/reactos/dll/win32/shellext/deskadp/lang/ (with props)
trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc (with props)
trunk/reactos/dll/win32/shellext/deskadp/precomp.h (with props)
trunk/reactos/dll/win32/shellext/deskadp/resource.h (with props)
trunk/reactos/dll/win32/shellext/deskadp/rsrc.rc (with props)
trunk/reactos/dll/win32/shellext/deskadp/shxiface.c (with props)
Modified:
trunk/reactos/baseaddress.rbuild
trunk/reactos/dll/win32/shellext/shellext.rbuild
Modified: trunk/reactos/baseaddress.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=292…
==============================================================================
--- trunk/reactos/baseaddress.rbuild (original)
+++ trunk/reactos/baseaddress.rbuild Thu Sep 27 00:00:07 2007
@@ -55,6 +55,7 @@
<property name="BASEADDRESS_URLMON" value="0x6b3c0000" />
<property name="BASEADDRESS_SERIALUI" value="0x6b3D0000" />
<property name="BASEADDRESS_WINSTA" value="0x6b3D0000" />
+ <property name="BASEADDRESS_DESKADP" value="0x6d410000" />
<property name="BASEADDRESS_WLDAP32" value="0x6e130000" />
<property name="BASEADDRESS_CLB" value="0x6f2b0000" />
<property name="BASEADDRESS_CARDS" value="0x701a0000" />
Propchange: trunk/reactos/dll/win32/shellext/deskadp/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep 27 00:00:07 2007
@@ -1,0 +1,7 @@
+GNUmakefile
+*.vcproj
+*.user
+*.cbp
+*.ncb
+*.suo
+*.sln
Added: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.c (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.c Thu Sep 27 00:00:07 2007
@@ -1,0 +1,218 @@
+#include "precomp.h"
+
+#define NDEBUG
+#include <debug.h>
+
+static HINSTANCE hInstance;
+
+static INT_PTR CALLBACK
+DisplayAdapterDlgProc(HWND hwndDlg,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ PDESKDISPLAYADAPTER This;
+ INT_PTR Ret = 0;
+
+ if (uMsg != WM_INITDIALOG)
+ {
+ This = (PDESKDISPLAYADAPTER)GetWindowLongPtr(hwndDlg,
+ DWL_USER);
+ }
+
+ switch (uMsg)
+ {
+ case WM_INITDIALOG:
+ This = (PDESKDISPLAYADAPTER)((LPCPROPSHEETPAGE)lParam)->lParam;
+ SetWindowLongPtr(hwndDlg,
+ DWL_USER,
+ (LONG_PTR)This);
+
+ Ret = TRUE;
+ break;
+ }
+
+ return Ret;
+}
+
+static VOID
+IDeskDisplayAdapter_Destroy(PDESKDISPLAYADAPTER This)
+{
+ if (This->pdtobj != NULL)
+ {
+ IDataObject_Release(This->pdtobj);
+ This->pdtobj = NULL;
+ }
+
+ if (This->DeskExtInterface != NULL)
+ {
+ LocalFree((HLOCAL)This->DeskExtInterface);
+ This->DeskExtInterface = NULL;
+ }
+}
+
+ULONG
+IDeskDisplayAdapter_AddRef(PDESKDISPLAYADAPTER This)
+{
+ ULONG ret;
+
+ ret = InterlockedIncrement((PLONG)&This->ref);
+ if (ret == 1)
+ InterlockedIncrement(&dll_refs);
+
+ return ret;
+}
+
+ULONG
+IDeskDisplayAdapter_Release(PDESKDISPLAYADAPTER This)
+{
+ ULONG ret;
+
+ ret = InterlockedDecrement((PLONG)&This->ref);
+ if (ret == 0)
+ {
+ IDeskDisplayAdapter_Destroy(This);
+ InterlockedDecrement(&dll_refs);
+
+ HeapFree(GetProcessHeap(),
+ 0,
+ This);
+ }
+
+ return ret;
+}
+
+HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_QueryInterface(PDESKDISPLAYADAPTER This,
+ REFIID iid,
+ PVOID *pvObject)
+{
+ *pvObject = NULL;
+
+ if (IsEqualIID(iid,
+ &IID_IShellPropSheetExt) ||
+ IsEqualIID(iid,
+ &IID_IUnknown))
+ {
+ *pvObject = impl_to_interface(This, IShellPropSheetExt);
+ }
+ else if (IsEqualIID(iid,
+ &IID_IShellExtInit))
+ {
+ *pvObject = impl_to_interface(This, IShellExtInit);
+ }
+ else if (IsEqualIID(iid,
+ &IID_IClassFactory))
+ {
+ *pvObject = impl_to_interface(This, IClassFactory);
+ }
+ else
+ {
+ DPRINT1("IDeskDisplayAdapter::QueryInterface(%p,%p): E_NOINTERFACE\n",
iid, pvObject);
+ return E_NOINTERFACE;
+ }
+
+ IDeskDisplayAdapter_AddRef(This);
+ return S_OK;
+}
+
+HRESULT
+IDeskDisplayAdapter_Initialize(PDESKDISPLAYADAPTER This,
+ LPCITEMIDLIST pidlFolder,
+ IDataObject *pdtobj,
+ HKEY hkeyProgID)
+{
+ DPRINT1("IDeskDisplayAdapter::Initialize(%p,%p,%p)\n", pidlFolder, pdtobj,
hkeyProgID);
+
+ if (pdtobj != NULL)
+ {
+ IDataObject_AddRef(pdtobj);
+ This->pdtobj = pdtobj;
+
+ /* Get a copy of the desk.cpl extension interface */
+ This->DeskExtInterface = QueryDeskCplExtInterface(This->pdtobj);
+ if (This->DeskExtInterface != NULL)
+ return S_OK;
+ }
+
+ return S_FALSE;
+}
+
+HRESULT
+IDeskDisplayAdapter_AddPages(PDESKDISPLAYADAPTER This,
+ LPFNADDPROPSHEETPAGE pfnAddPage,
+ LPARAM lParam)
+{
+ HPROPSHEETPAGE hpsp;
+ PROPSHEETPAGE psp;
+
+ DPRINT1("IDeskDisplayAdapter::AddPages(%p,%p)\n", pfnAddPage, lParam);
+
+ psp.dwSize = sizeof(psp);
+ psp.dwFlags = PSP_DEFAULT;
+ psp.hInstance = hInstance;
+ psp.pszTemplate = MAKEINTRESOURCE(IDD_DISPLAYADAPTER);
+ psp.pfnDlgProc = DisplayAdapterDlgProc;
+ psp.lParam = (LPARAM)This;
+
+ hpsp = CreatePropertySheetPage(&psp);
+ if (hpsp != NULL && pfnAddPage(hpsp, lParam))
+ return S_OK;
+
+ return S_FALSE;
+}
+
+HRESULT
+IDeskDisplayAdapter_ReplacePage(PDESKDISPLAYADAPTER This,
+ EXPPS uPageID,
+ LPFNADDPROPSHEETPAGE pfnReplacePage,
+ LPARAM lParam)
+{
+ DPRINT1("IDeskDisplayAdapter::ReplacePage(%u,%p,%p)\n", uPageID,
pfnReplacePage, lParam);
+ return E_NOTIMPL;
+}
+
+HRESULT
+IDeskDisplayAdapter_Constructor(REFIID riid,
+ LPVOID *ppv)
+{
+ PDESKDISPLAYADAPTER This;
+ HRESULT hRet = E_OUTOFMEMORY;
+
+ DPRINT1("IDeskDisplayAdapter::Constructor(%p,%p)\n", riid, ppv);
+
+ This = HeapAlloc(GetProcessHeap(),
+ 0,
+ sizeof(*This));
+ if (This != NULL)
+ {
+ ZeroMemory(This,
+ sizeof(*This));
+
+ IDeskDisplayAdapter_InitIface(This);
+
+ hRet = IDeskDisplayAdapter_QueryInterface(This,
+ riid,
+ ppv);
+ if (!SUCCEEDED(hRet))
+ IDeskDisplayAdapter_Release(This);
+ }
+
+ return hRet;
+}
+
+BOOL STDCALL
+DllMain(HINSTANCE hinstDLL,
+ DWORD dwReason,
+ LPVOID lpvReserved)
+{
+ switch (dwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ hInstance = hinstDLL;
+ DisableThreadLibraryCalls(hInstance);
+ break;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/dll/win32/shellext/deskadp/deskadp.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.h (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.h Thu Sep 27 00:00:07 2007
@@ -1,0 +1,59 @@
+#ifndef __DESKADP__H
+#define __DESKADP__H
+
+typedef struct _DESKDISPLAYADAPTER
+{
+ const struct IShellPropSheetExtVtbl *lpIShellPropSheetExtVtbl;
+ const struct IShellExtInitVtbl *lpIShellExtInitVtbl;
+ const struct IClassFactoryVtbl *lpIClassFactoryVtbl;
+ DWORD ref;
+
+ PDESK_EXT_INTERFACE DeskExtInterface;
+ IDataObject *pdtobj;
+} DESKDISPLAYADAPTER, *PDESKDISPLAYADAPTER;
+
+extern LONG dll_refs;
+
+#define impl_to_interface(impl,iface) (struct iface *)(&(impl)->lp##iface##Vtbl)
+#define interface_to_impl(instance,iface) ((PDESKDISPLAYADAPTER)((ULONG_PTR)instance -
FIELD_OFFSET(DESKDISPLAYADAPTER,lp##iface##Vtbl)))
+
+HRESULT
+IDeskDisplayAdapter_Constructor(REFIID riid,
+ LPVOID *ppv);
+
+VOID
+IDeskDisplayAdapter_InitIface(PDESKDISPLAYADAPTER This);
+
+HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_QueryInterface(PDESKDISPLAYADAPTER This,
+ REFIID iid,
+ PVOID *pvObject);
+
+ULONG
+IDeskDisplayAdapter_AddRef(PDESKDISPLAYADAPTER This);
+
+ULONG
+IDeskDisplayAdapter_Release(PDESKDISPLAYADAPTER This);
+
+HRESULT
+IDeskDisplayAdapter_Initialize(PDESKDISPLAYADAPTER This,
+ LPCITEMIDLIST pidlFolder,
+ IDataObject *pdtobj,
+ HKEY hkeyProgID);
+
+HRESULT
+IDeskDisplayAdapter_AddPages(PDESKDISPLAYADAPTER This,
+ LPFNADDPROPSHEETPAGE pfnAddPage,
+ LPARAM lParam);
+
+HRESULT
+IDeskDisplayAdapter_ReplacePage(PDESKDISPLAYADAPTER This,
+ EXPPS uPageID,
+ LPFNADDPROPSHEETPAGE pfnReplacePage,
+ LPARAM lParam);
+
+static const GUID CLSID_IDeskDisplayAdapter =
{0x42071712,0x76d4,0x11d1,{0x8b,0x24,0x00,0xa0,0xc9,0x06,0x8f,0xf3}};
+
+ULONG __cdecl DbgPrint(PCCH Format,...);
+
+#endif /* __DESKADP__H */
Propchange: trunk/reactos/dll/win32/shellext/deskadp/deskadp.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/deskadp.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.rbuild (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.rbuild Thu Sep 27 00:00:07 2007
@@ -1,0 +1,21 @@
+<module name="deskadp" type="win32dll"
baseaddress="${BASEADDRESS_DESKADP}" installbase="system32"
installname="deskadp.dll" unicode="yes">
+ <importlibrary definition="deskadp.spec.def" />
+ <include base="deskadp">.</include>
+ <define name="__USE_W32API" />
+ <define name="_WIN32_IE">0x0500</define>
+ <define name="_WIN32_WINNT">0x0600</define>
+ <define name="WINVER">0x0600</define>
+ <library>ntdll</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>gdi32</library>
+ <library>comctl32</library>
+ <library>ole32</library>
+ <library>uuid</library>
+ <library>msvcrt</library>
+ <file>deskadp.c</file>
+ <file>shxiface.c</file>
+ <file>deskadp.rc</file>
+ <file>deskadp.spec</file>
+ <pch>precomp.h</pch>
+</module>
Propchange: trunk/reactos/dll/win32/shellext/deskadp/deskadp.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/deskadp.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.rc (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.rc Thu Sep 27 00:00:07 2007
@@ -1,0 +1,12 @@
+/* $Id: slayer.rc 24931 2006-11-28 19:35:42Z janderwald $ */
+
+#include <windows.h>
+#include "resource.h"
+
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Advanced display adapter
properties\0"
+#define REACTOS_STR_INTERNAL_NAME "deskadp\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "deskadp.dll\0"
+#include <reactos/version.rc>
+
+#include "rsrc.rc"
Propchange: trunk/reactos/dll/win32/shellext/deskadp/deskadp.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/deskadp.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/deskadp.spec (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/deskadp.spec Thu Sep 27 00:00:07 2007
@@ -1,0 +1,4 @@
+# deskadp.dll exports
+
+ 1 stdcall DllCanUnloadNow()
+ 2 stdcall DllGetClassObject(ptr ptr ptr)
Propchange: trunk/reactos/dll/win32/shellext/deskadp/deskadp.spec
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/dll/win32/shellext/deskadp/lang/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep 27 00:00:07 2007
@@ -1,0 +1,7 @@
+GNUmakefile
+*.vcproj
+*.user
+*.cbp
+*.ncb
+*.suo
+*.sln
Added: trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc Thu Sep 27 00:00:07 2007
@@ -1,0 +1,10 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+IDD_DISPLAYADAPTER DIALOGEX 0, 0, 224, 226
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Adapter"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+
+END
+
Propchange: trunk/reactos/dll/win32/shellext/deskadp/lang/en-US.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/precomp.h (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/precomp.h Thu Sep 27 00:00:07 2007
@@ -1,0 +1,11 @@
+#ifndef __PRECOMP__H
+#define __PRECOMP__H
+
+#define COBJMACROS
+#include <windows.h>
+#include <shlobj.h>
+#include <dll/desk/deskcplx.h>
+#include "deskadp.h"
+#include "resource.h"
+
+#endif /* __PRECOMP__H */
Propchange: trunk/reactos/dll/win32/shellext/deskadp/precomp.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/resource.h (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/resource.h Thu Sep 27 00:00:07 2007
@@ -1,0 +1,6 @@
+#ifndef __RESOURCE__H
+#define __RESOURCE__H
+
+#define IDD_DISPLAYADAPTER 100
+
+#endif /* __RESOURCE__H */
Propchange: trunk/reactos/dll/win32/shellext/deskadp/resource.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/rsrc.rc (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/rsrc.rc Thu Sep 27 00:00:07 2007
@@ -1,0 +1,7 @@
+#include <windows.h>
+#include "resource.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#include "lang/en-US.rc"
+
Propchange: trunk/reactos/dll/win32/shellext/deskadp/rsrc.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/shellext/deskadp/shxiface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/deskadp…
==============================================================================
--- trunk/reactos/dll/win32/shellext/deskadp/shxiface.c (added)
+++ trunk/reactos/dll/win32/shellext/deskadp/shxiface.c Thu Sep 27 00:00:07 2007
@@ -1,0 +1,209 @@
+#include "precomp.h"
+
+#define NDEBUG
+#include <debug.h>
+
+LONG dll_refs = 0;
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellPropSheetExt_QueryInterface(IShellPropSheetExt *iface,
+ REFIID iid,
+ PVOID *pvObject)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellPropSheetExt);
+ return IDeskDisplayAdapter_QueryInterface(This,
+ iid,
+ pvObject);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellPropSheetExt_AddRef(IShellPropSheetExt* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellPropSheetExt);
+ return IDeskDisplayAdapter_AddRef(This);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellPropSheetExt_Release(IShellPropSheetExt* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellPropSheetExt);
+ return IDeskDisplayAdapter_Release(This);
+}
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellPropSheetExt_AddPages(IShellPropSheetExt* iface,
+ LPFNADDPROPSHEETPAGE pfnAddPage,
+ LPARAM lParam)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellPropSheetExt);
+ return IDeskDisplayAdapter_AddPages(This,
+ pfnAddPage,
+ lParam);
+}
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellPropSheetExt_ReplacePage(IShellPropSheetExt* iface,
+ EXPPS uPageID,
+ LPFNADDPROPSHEETPAGE pfnReplacePage,
+ LPARAM lParam)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellPropSheetExt);
+ return IDeskDisplayAdapter_ReplacePage(This,
+ uPageID,
+ pfnReplacePage,
+ lParam);
+}
+
+static IShellPropSheetExtVtbl efvtIShellPropSheetExt =
+{
+ IDeskDisplayAdapter_IShellPropSheetExt_QueryInterface,
+ IDeskDisplayAdapter_IShellPropSheetExt_AddRef,
+ IDeskDisplayAdapter_IShellPropSheetExt_Release,
+ IDeskDisplayAdapter_IShellPropSheetExt_AddPages,
+ IDeskDisplayAdapter_IShellPropSheetExt_ReplacePage
+};
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellExtInit_QueryInterface(IShellExtInit *iface,
+ REFIID iid,
+ PVOID *pvObject)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellExtInit);
+ return IDeskDisplayAdapter_QueryInterface(This,
+ iid,
+ pvObject);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellExtInit_AddRef(IShellExtInit* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellExtInit);
+ return IDeskDisplayAdapter_AddRef(This);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellExtInit_Release(IShellExtInit* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellExtInit);
+ return IDeskDisplayAdapter_Release(This);
+}
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IShellExtInit_Initialize(IShellExtInit* iface,
+ LPCITEMIDLIST pidlFolder,
+ IDataObject *pdtobj,
+ HKEY hkeyProgID)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IShellExtInit);
+ return IDeskDisplayAdapter_Initialize(This,
+ pidlFolder,
+ pdtobj,
+ hkeyProgID);
+}
+
+static IShellExtInitVtbl efvtIShellExtInit =
+{
+ IDeskDisplayAdapter_IShellExtInit_QueryInterface,
+ IDeskDisplayAdapter_IShellExtInit_AddRef,
+ IDeskDisplayAdapter_IShellExtInit_Release,
+ IDeskDisplayAdapter_IShellExtInit_Initialize
+};
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IClassFactory_QueryInterface(IClassFactory *iface,
+ REFIID iid,
+ PVOID *pvObject)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IClassFactory);
+ return IDeskDisplayAdapter_QueryInterface(This,
+ iid,
+ pvObject);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IClassFactory_AddRef(IClassFactory* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IClassFactory);
+ return IDeskDisplayAdapter_AddRef(This);
+}
+
+static ULONG STDMETHODCALLTYPE
+IDeskDisplayAdapter_IClassFactory_Release(IClassFactory* iface)
+{
+ PDESKDISPLAYADAPTER This = interface_to_impl(iface, IClassFactory);
+ return IDeskDisplayAdapter_Release(This);
+}
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IClassFactory_CreateInstance(IClassFactory *iface,
+ IUnknown * pUnkOuter,
+ REFIID riid,
+ PVOID *ppvObject)
+{
+ if (pUnkOuter != NULL &&
+ !IsEqualIID(riid,
+ &IID_IUnknown))
+ {
+ return CLASS_E_NOAGGREGATION;
+ }
+
+ return IDeskDisplayAdapter_Constructor(riid,
+ ppvObject);
+}
+
+static HRESULT STDMETHODCALLTYPE
+IDeskDisplayAdapter_IClassFactory_LockServer(IClassFactory *iface,
+ BOOL fLock)
+{
+ if (fLock)
+ InterlockedIncrement(&dll_refs);
+ else
+ InterlockedDecrement(&dll_refs);
+
+ return S_OK;
+}
+
+static IClassFactoryVtbl efvtIClassFactory =
+{
+ IDeskDisplayAdapter_IClassFactory_QueryInterface,
+ IDeskDisplayAdapter_IClassFactory_AddRef,
+ IDeskDisplayAdapter_IClassFactory_Release,
+ IDeskDisplayAdapter_IClassFactory_CreateInstance,
+ IDeskDisplayAdapter_IClassFactory_LockServer,
+};
+
+VOID
+IDeskDisplayAdapter_InitIface(PDESKDISPLAYADAPTER This)
+{
+ This->lpIShellPropSheetExtVtbl = &efvtIShellPropSheetExt;
+ This->lpIShellExtInitVtbl = &efvtIShellExtInit;
+ This->lpIClassFactoryVtbl = &efvtIClassFactory;
+
+ IDeskDisplayAdapter_AddRef(This);
+}
+
+HRESULT WINAPI
+DllGetClassObject(REFCLSID rclsid,
+ REFIID riid,
+ LPVOID *ppv)
+{
+ if (ppv == NULL)
+ return E_INVALIDARG;
+
+ *ppv = NULL;
+ if (IsEqualCLSID(rclsid,
+ &CLSID_IDeskDisplayAdapter))
+ {
+ return IDeskDisplayAdapter_Constructor(riid,
+ ppv);
+ }
+
+ DPRINT1("DllGetClassObject: CLASS_E_CLASSNOTAVAILABLE\n");
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT WINAPI
+DllCanUnloadNow(VOID)
+{
+ return dll_refs == 0 ? S_OK : S_FALSE;
+}
Propchange: trunk/reactos/dll/win32/shellext/deskadp/shxiface.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/shellext/shellext.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shellext/shellex…
==============================================================================
--- trunk/reactos/dll/win32/shellext/shellext.rbuild (original)
+++ trunk/reactos/dll/win32/shellext/shellext.rbuild Thu Sep 27 00:00:07 2007
@@ -4,4 +4,7 @@
<directory name="slayer">
<xi:include href="slayer/slayer.rbuild" />
</directory>
+ <directory name="deskadp">
+ <xi:include href="deskadp/deskadp.rbuild" />
+ </directory>
</group>