mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +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
3 changed files with 30 additions and 18 deletions
|
@ -172,7 +172,8 @@ HRESULT WINAPI StdProxy_Construct(REFIID riid,
|
||||||
This->PVtbl = vtbl->Vtbl;
|
This->PVtbl = vtbl->Vtbl;
|
||||||
|
|
||||||
This->lpVtbl = &StdProxy_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->stubless = stubless;
|
||||||
This->piid = vtbl->header.piid;
|
This->piid = vtbl->header.piid;
|
||||||
This->pUnkOuter = pUnkOuter;
|
This->pUnkOuter = pUnkOuter;
|
||||||
|
@ -190,6 +191,9 @@ static void WINAPI StdProxy_Destruct(LPRPCPROXYBUFFER iface)
|
||||||
{
|
{
|
||||||
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
|
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
|
||||||
|
|
||||||
|
if (This->pChannel)
|
||||||
|
IRpcProxyBuffer_Disconnect(iface);
|
||||||
|
|
||||||
IPSFactoryBuffer_Release(This->pPSFactory);
|
IPSFactoryBuffer_Release(This->pPSFactory);
|
||||||
if (This->thunks) {
|
if (This->thunks) {
|
||||||
HeapFree(GetProcessHeap(),0,This->PVtbl);
|
HeapFree(GetProcessHeap(),0,This->PVtbl);
|
||||||
|
@ -248,6 +252,7 @@ static HRESULT WINAPI StdProxy_Connect(LPRPCPROXYBUFFER iface,
|
||||||
TRACE("(%p)->Connect(%p)\n",This,pChannel);
|
TRACE("(%p)->Connect(%p)\n",This,pChannel);
|
||||||
|
|
||||||
This->pChannel = pChannel;
|
This->pChannel = pChannel;
|
||||||
|
IRpcChannelBuffer_AddRef(pChannel);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,6 +261,7 @@ static VOID WINAPI StdProxy_Disconnect(LPRPCPROXYBUFFER iface)
|
||||||
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
|
ICOM_THIS_MULTI(StdProxyImpl,lpVtbl,iface);
|
||||||
TRACE("(%p)->Disconnect()\n",This);
|
TRACE("(%p)->Disconnect()\n",This);
|
||||||
|
|
||||||
|
IRpcChannelBuffer_Release(This->pChannel);
|
||||||
This->pChannel = NULL;
|
This->pChannel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,8 +159,9 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
|
||||||
const CLSID *pclsid)
|
const CLSID *pclsid)
|
||||||
{
|
{
|
||||||
LPSTR clsid;
|
LPSTR clsid;
|
||||||
char keyname[120], module[120];
|
char keyname[120], module[MAX_PATH];
|
||||||
HKEY key, subkey;
|
HKEY key, subkey;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
|
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
|
||||||
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
|
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
|
||||||
|
@ -196,16 +197,18 @@ HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll,
|
||||||
|
|
||||||
/* register clsid to point to module */
|
/* register clsid to point to module */
|
||||||
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
|
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
|
||||||
GetModuleFileNameA(hDll, module, sizeof(module));
|
len = GetModuleFileNameA(hDll, module, sizeof(module));
|
||||||
TRACE("registering CLSID %s => %s\n", clsid, module);
|
if (len && len < sizeof(module)) {
|
||||||
if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
|
TRACE("registering CLSID %s => %s\n", clsid, module);
|
||||||
KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) {
|
if (RegCreateKeyExA(HKEY_CLASSES_ROOT, keyname, 0, NULL, 0,
|
||||||
if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0,
|
KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) {
|
||||||
KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) {
|
if (RegCreateKeyExA(key, "InProcServer32", 0, NULL, 0,
|
||||||
RegSetValueExA(subkey, NULL, 0, REG_SZ, module, strlen(module));
|
KEY_WRITE, NULL, &subkey, NULL) == ERROR_SUCCESS) {
|
||||||
RegCloseKey(subkey);
|
RegSetValueExA(subkey, NULL, 0, REG_SZ, module, strlen(module));
|
||||||
}
|
RegCloseKey(subkey);
|
||||||
RegCloseKey(key);
|
}
|
||||||
|
RegCloseKey(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
|
@ -221,7 +224,8 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
|
||||||
const CLSID *pclsid)
|
const CLSID *pclsid)
|
||||||
{
|
{
|
||||||
LPSTR clsid;
|
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));
|
TRACE("(%p,%p,%s)\n", hDll, pProxyFileList, debugstr_guid(pclsid));
|
||||||
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
|
UuidToStringA((UUID*)pclsid, (unsigned char**)&clsid);
|
||||||
|
@ -246,9 +250,11 @@ HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll,
|
||||||
|
|
||||||
/* unregister clsid */
|
/* unregister clsid */
|
||||||
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
|
snprintf(keyname, sizeof(keyname), "CLSID\\{%s}", clsid);
|
||||||
GetModuleFileNameA(hDll, module, sizeof(module));
|
len = GetModuleFileNameA(hDll, module, sizeof(module));
|
||||||
TRACE("unregistering CLSID %s <= %s\n", clsid, module);
|
if (len && len < sizeof(module)) {
|
||||||
RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
|
TRACE("unregistering CLSID %s <= %s\n", clsid, module);
|
||||||
|
RegDeleteKeyA(HKEY_CLASSES_ROOT, keyname);
|
||||||
|
}
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
RpcStringFreeA((unsigned char**)&clsid);
|
RpcStringFreeA((unsigned char**)&clsid);
|
||||||
|
|
|
@ -1121,7 +1121,7 @@ RPC_STATUS WINAPI I_RpcBindingSetAsync( RPC_BINDING_HANDLE Binding, RPC_BLOCKING
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* RpcNetworkIsProtseqValidA (RPCRT4.@)
|
* RpcNetworkIsProtseqValidA (RPCRT4.@)
|
||||||
*/
|
*/
|
||||||
RPC_STATUS RPC_ENTRY RpcNetworkIsProtseqValidA(unsigned char *protseq) {
|
RPC_STATUS WINAPI RpcNetworkIsProtseqValidA(unsigned char *protseq) {
|
||||||
UNICODE_STRING protseqW;
|
UNICODE_STRING protseqW;
|
||||||
|
|
||||||
if (!protseq) return RPC_S_INVALID_RPC_PROTSEQ; /* ? */
|
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)
|
* ncalrpc local-only rpc over LPC (LPC is not really used)
|
||||||
* ncacn_np rpc over named pipes
|
* ncacn_np rpc over named pipes
|
||||||
*/
|
*/
|
||||||
RPC_STATUS RPC_ENTRY RpcNetworkIsProtseqValidW(LPWSTR protseq) {
|
RPC_STATUS WINAPI RpcNetworkIsProtseqValidW(LPWSTR protseq) {
|
||||||
static const WCHAR protseqsW[][15] = {
|
static const WCHAR protseqsW[][15] = {
|
||||||
{'n','c','a','l','r','p','c',0},
|
{'n','c','a','l','r','p','c',0},
|
||||||
{'n','c','a','c','n','_','n','p',0}
|
{'n','c','a','c','n','_','n','p',0}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue