Sync to Wine-20050830:
[reactos.git] / reactos / lib / rpcrt4 / cpsf.c
index ba0db03..63ff851 100644 (file)
@@ -22,6 +22,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#define COBJMACROS
+
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
@@ -55,7 +57,7 @@ static HRESULT WINAPI CStdPSFactory_QueryInterface(LPPSFACTORYBUFFER iface,
                                                   REFIID riid,
                                                   LPVOID *obj)
 {
-  ICOM_THIS(CStdPSFactoryBuffer,iface);
+  CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface;
   TRACE("(%p)->QueryInterface(%s,%p)\n",iface,debugstr_guid(riid),obj);
   if (IsEqualGUID(&IID_IUnknown,riid) ||
       IsEqualGUID(&IID_IPSFactoryBuffer,riid)) {
@@ -68,14 +70,14 @@ static HRESULT WINAPI CStdPSFactory_QueryInterface(LPPSFACTORYBUFFER iface,
 
 static ULONG WINAPI CStdPSFactory_AddRef(LPPSFACTORYBUFFER iface)
 {
-  ICOM_THIS(CStdPSFactoryBuffer,iface);
+  CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface;
   TRACE("(%p)->AddRef()\n",iface);
   return ++(This->RefCount);
 }
 
 static ULONG WINAPI CStdPSFactory_Release(LPPSFACTORYBUFFER iface)
 {
-  ICOM_THIS(CStdPSFactoryBuffer,iface);
+  CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface;
   TRACE("(%p)->Release()\n",iface);
   return --(This->RefCount);
 }
@@ -86,7 +88,7 @@ static HRESULT WINAPI CStdPSFactory_CreateProxy(LPPSFACTORYBUFFER iface,
                                                LPRPCPROXYBUFFER *ppProxy,
                                                LPVOID *ppv)
 {
-  ICOM_THIS(CStdPSFactoryBuffer,iface);
+  CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface;
   const ProxyFileInfo *ProxyInfo;
   int Index;
   TRACE("(%p)->CreateProxy(%p,%s,%p,%p)\n",iface,pUnkOuter,
@@ -103,7 +105,7 @@ static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface,
                                               LPUNKNOWN pUnkServer,
                                               LPRPCSTUBBUFFER *ppStub)
 {
-  ICOM_THIS(CStdPSFactoryBuffer,iface);
+  CStdPSFactoryBuffer *This = (CStdPSFactoryBuffer *)iface;
   const ProxyFileInfo *ProxyInfo;
   int Index;
   TRACE("(%p)->CreateStub(%s,%p,%p)\n",iface,debugstr_guid(riid),
@@ -114,9 +116,8 @@ static HRESULT WINAPI CStdPSFactory_CreateStub(LPPSFACTORYBUFFER iface,
                                   ProxyInfo->pStubVtblList[Index], iface, ppStub);
 }
 
-static ICOM_VTABLE(IPSFactoryBuffer) CStdPSFactory_Vtbl =
+static const IPSFactoryBufferVtbl CStdPSFactory_Vtbl =
 {
-  ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
   CStdPSFactory_QueryInterface,
   CStdPSFactory_AddRef,
   CStdPSFactory_Release,
@@ -182,11 +183,11 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
       if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
                           KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) {
         if (name)
-          RegSetValueExA(key, NULL, 0, REG_SZ, name, strlen(name));
+          RegSetValueExA(key, NULL, 0, REG_SZ, (LPBYTE)name, strlen(name));
         if (RegCreateKeyExA(key, "ProxyStubClsid32", 0, NULL, 0,
                             KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) {
           snprintf(module, sizeof(module), "{%s}", clsid);
-          RegSetValueExA(subkey, NULL, 0, REG_SZ, module, strlen(module));
+          RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module));
           RegCloseKey(subkey);
         }
         RegCloseKey(key);
@@ -204,7 +205,7 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
                         KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) {
       if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0,
                           KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) {
-        RegSetValueExA(subkey, NULL, 0, REG_SZ, module, strlen(module));
+        RegSetValueExA(subkey, NULL, 0, REG_SZ, (LPBYTE)module, strlen(module));
         RegCloseKey(subkey);
       }
       RegCloseKey(key);