reactos/lib/rpcrt4
diff -u -r1.1 -r1.2
--- cproxy.c 4 May 2004 20:06:26 -0000 1.1
+++ cproxy.c 16 Jun 2004 18:21:24 -0000 1.2
@@ -172,7 +172,8 @@
This->PVtbl = vtbl->Vtbl;
This->lpVtbl = &StdProxy_Vtbl;
- This->RefCount = 1;
+ /* 1 reference for the proxy and 1 for the object */
+ This->RefCount = 2;
This->stubless = stubless;
This->piid = vtbl->header.piid;
This->pUnkOuter = pUnkOuter;
@@ -190,6 +191,9 @@
{
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
+ if (This->pChannel)
+ IRpcProxyBuffer_Disconnect(iface);
+
IPSFactoryBuffer_Release(This->pPSFactory);
if (This->thunks) {
HeapFree(GetProcessHeap(),0,This->PVtbl);
@@ -248,6 +252,7 @@
TRACE("(%p)->Connect(%p)\n",This,pChannel);
This->pChannel = pChannel;
+ IRpcChannelBuffer_AddRef(pChannel);
return S_OK;
}
@@ -256,6 +261,7 @@
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
TRACE("(%p)->Disconnect()\n",This);
+ IRpcChannelBuffer_Release(This->pChannel);
This->pChannel = NULL;
}
reactos/lib/rpcrt4
diff -u -r1.1 -r1.2
--- cpsf.c 4 May 2004 20:06:26 -0000 1.1
+++ cpsf.c 16 Jun 2004 18:21:24 -0000 1.2
@@ -159,8 +159,9 @@
const CLSID *pclsid)
{
LPSTR clsid;
- char keyname[120], module[120];
+ char keyname[120], module[MAX_PATH];
HKEY key, subkey;
+ DWORD len;
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
@@ -196,16 +197,18 @@
/* register clsid to point to module */
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
- GetModuleFileNameA(hDll, module, sizeof(module));
- TRACE("registering CLSID %s => %s\n", clsid, module);
- if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
- 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));
- RegCloseKey(subkey);
- }
- RegCloseKey(key);
+ len = GetModuleFileNameA(hDll, module, sizeof(module));
+ if (len && len < sizeof(module)) {
+ TRACE("registering CLSID %s => %s\n", clsid, module);
+ if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
+ 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));
+ RegCloseKey(subkey);
+ }
+ RegCloseKey(key);
+ }
}
/* done */
@@ -221,7 +224,8 @@
const CLSID *pclsid)
{
LPSTR clsid;
- char keyname[120], module[120];
+ char keyname[120], module[MAX_PATH];
+ DWORD len;
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
@@ -246,9 +250,11 @@
/* unregister clsid */
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
- GetModuleFileNameA(hDll, module, sizeof(module));
- TRACE("unregistering CLSID %s <= %s\n", clsid, module);
- RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
+ len = GetModuleFileNameA(hDll, module, sizeof(module));
+ if (len && len < sizeof(module)) {
+ TRACE("unregistering CLSID %s <= %s\n", clsid, module);
+ RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
+ }
/* done */
RpcStringFreeA((unsigned char**)&clsid);
reactos/lib/rpcrt4
diff -u -r1.1 -r1.2
--- rpc_binding.c 4 May 2004 20:06:26 -0000 1.1
+++ rpc_binding.c 16 Jun 2004 18:21:24 -0000 1.2
@@ -1121,7 +1121,7 @@
/***********************************************************************
* RpcNetworkIsProtseqValidA (RPCRT4.@)
*/
-RPC_STATUS RPC_ENTRY RpcNetworkIsProtseqValidA(unsigned char *protseq) {
+RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(unsigned char *protseq) {
UNICODE_STRING protseqW;
if (!protseq) return RPC_S_INVALID_RPC_PROTSEQ; /* ? */
@@ -1143,7 +1143,7 @@
* ncalrpc local-only rpc over LPC (LPC is not really used)
* ncacn_np rpc over named pipes
*/
-RPC_STATUS RPC_ENTRY RpcNetworkIsProtseqValidW(LPWSTR protseq) {
+RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) {
static const WCHAR protseqsW[][15] = {
{'n','c','a','l','r','p','c',0},
{'n','c','a','c','n','_','n','p',0}