mirror of
https://github.com/reactos/reactos.git
synced 2024-08-26 13:18:51 +00:00
Sync to Wine-20040615:
Robert Shearman <R.J.Shearman@warwick.ac.uk> - Fix ref count on standard proxy creation. - Release channel buffer in StdMarshal_UnmarshalInterface, since we no longer use it and the proxy should have taken a reference on it. - Add a few comments. Eric Pouech <pouech-eric@wanadoo.fr> - GetModuleFileName[AW] doesn't terminate the string if the buffer is too small. Patrik Stridvall <ps@leissner.se> - Fixed some issues found by winapi_check. svn path=/trunk/; revision=9683
This commit is contained in:
parent
129d08fec4
commit
2b3293eb3a
|
@ -172,7 +172,8 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
|
|||
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 @@ static void WINAPI StdProxy_Destruct(LPRPCPROXYBUFFER iface)
|
|||
{
|
||||
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 @@ static HRESULT WINAPI StdProxy_Connect(LPRPCPROXYBUFFER iface,
|
|||
TRACE("(%p)->Connect(%p)\n",This,pChannel);
|
||||
|
||||
This->pChannel = pChannel;
|
||||
IRpcChannelBuffer_AddRef(pChannel);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -256,6 +261,7 @@ static VOID WINAPI StdProxy_Disconnect(LPRPCPROXYBUFFER iface)
|
|||
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
|
||||
TRACE("(%p)->Disconnect()\n",This);
|
||||
|
||||
IRpcChannelBuffer_Release(This->pChannel);
|
||||
This->pChannel = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,8 +159,9 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
|
|||
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 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
|
|||
|
||||
/* 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 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
|
|||
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 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
|
|||
|
||||
/* 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);
|
||||
|
|
|
@ -1121,7 +1121,7 @@ RPC_STATUS WINAPI I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING
|
|||
/***********************************************************************
|
||||
* 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 @@ RPC_STATUS RPC_ENTRY RpcNetworkIsProtseqValidA(unsigned char *protseq) {
|
|||
* 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}
|
||||
|
|
Loading…
Reference in a new issue