Huw Davies (@huw) commented about programs/rpcss/rpcss_main.c:
> }
>
> +/* Generates a new OXID suitable for use by an apartment.
> + * Each call to this function returns a distinct OXID.
> + * This function should not be invoked directly - use rpcss_get_new_apartment_oxid
> + * instead. */
> +HRESULT __cdecl irpcss_get_new_apartment_oxid(handle_t h, OXID *oxid)
> +{
> + HRESULT status;
> + ULONG oxid_upper_bits;
> +
> + static LONG oxid_lower_bits;
> +
> + status = I_RpcBindingInqLocalClientPID(h, &oxid_upper_bits);
> + ERR("Got client PID: %ld", oxid_upper_bits);
> + if (status != S_OK) {
Please put the opening brace on a new line.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2059#note_22594
Huw Davies (@huw) commented about programs/rpcss/rpcss_main.c:
> return S_OK;
> }
>
> +/* Generates a new OXID suitable for use by an apartment.
> + * Each call to this function returns a distinct OXID.
> + * This function should not be invoked directly - use rpcss_get_new_apartment_oxid
> + * instead. */
> +HRESULT __cdecl irpcss_get_new_apartment_oxid(handle_t h, OXID *oxid)
> +{
> + HRESULT status;
> + ULONG oxid_upper_bits;
> +
> + static LONG oxid_lower_bits;
> +
> + status = I_RpcBindingInqLocalClientPID(h, &oxid_upper_bits);
> + ERR("Got client PID: %ld", oxid_upper_bits);
This looks like it's left-over from debugging.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2059#note_22593
Huw Davies (@huw) commented about programs/rpcss/rpcss_main.c:
> return S_OK;
> }
>
> +/* Generates a new OXID suitable for use by an apartment.
> + * Each call to this function returns a distinct OXID.
> + * This function should not be invoked directly - use rpcss_get_new_apartment_oxid
> + * instead. */
> +HRESULT __cdecl irpcss_get_new_apartment_oxid(handle_t h, OXID *oxid)
> +{
> + HRESULT status;
> + ULONG oxid_upper_bits;
> +
I think we can get rid of this blank line.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2059#note_22592
Huw Davies (@huw) commented about dlls/combase/apartment.c:
>
> - if (apt->multi_threaded)
> - {
> - /* FIXME: should be randomly generated by in an RPC call to rpcss */
> - apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe;
> - }
> - else
> - {
> - /* FIXME: should be randomly generated by in an RPC call to rpcss */
> - apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId();
> - }
> + /* Get a new OXID to use for this apartment. Note that re-creating
> + * an apartment (by calling CoUninitialize and then CoInitializeEx)
> + * will result in a new OXID. This ensures that we don't re-use a
> + * proxy_manager` that refers to a dead apartment. */
> + rpcss_get_new_apartment_oxid(&apt->oxid);
We would want to test for this failing (and probably clean up and return NULL).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2059#note_22591
This series brings some improvements for debugging support
in the new wow64 environment:
- detects and adapt to the new environement
- fixes a couple of bugs appearing now
- adds a couple of tests
- extends winedbg to hide or display the modules when
multiple machines are used in the same process
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2078