0

Durning the start of explorer.exe, it loads twinui.dll, which has a COM+ class Immersive Settings Cache(A919EA73-490E-4D5C-9BA7-97CBC73119FE). It implements:

  • IImmersiveSettingsCache
  • IImmersiveShellComponent
  • IMarshal
  • IObjectWithSite
  • IServiceProvider
  • IUnknown
  • Factory interfaces:
    • IClassFactory
    • IUnknown
[Guid("7665c60a-c9a7-4306-ae31-bf520214fa71")]
interface IImmersiveSettings : IUnknown {
    HRESULT Proc3();
    HRESULT Proc4(/* Stack Offset: 8 */ [Out] /* C:(FC_TOP_LEVEL_CONFORMANCE)(16)(FC_DEREFERENCE)(FC_ULONG)(0) */ struct Struct_685[]* p0, /* Stack Offset: 16 */ [Out] int* p1, /* Stack Offset: 24 */ [Out] int* p2);
    HRESULT Proc5(/* Stack Offset: 8 */ [In] int p0);
}

[Guid("4214f6fa-eb36-4e2f-9ca2-23fdc1832df7")]
interface IImmersiveSettingsCache : IUnknown {
    HRESULT Proc3(/* Stack Offset: 8 */ [In] /* ENUM32 */ int p0);
    HRESULT Proc4(/* Stack Offset: 8 */ [In] /* ENUM32 */ int p0, /* Stack Offset: 16 */ [Out] int* p1);
    HRESULT Proc5(/* Stack Offset: 8 */ [In] /* ENUM32 */ int p0, /* Stack Offset: 16 */ [Out] int* p1);
    HRESULT Proc6(/* Stack Offset: 8 */ [In] IImmersiveSettingsCacheNotification* p0, /* Stack Offset: 16 */ [Out] int* p1);
    HRESULT Proc7(/* Stack Offset: 8 */ [In] int p0);
}

[Guid("0b40e4e6-2749-461f-9a84-29491c297f86")]
interface IImmersiveSettingsCacheNotification : IUnknown {
    HRESULT Proc3(/* Stack Offset: 8 */ [In] /* ENUM32 */ int p0);
}

I found, that SystemSettings.exe uses this API, to notify explorer about changes of some settings, for example System-Multitasking-Virtual desktops. The highlighted line executes COM+ method: Executing COM+

This is CoCreateInstance call(line number 9 on top pic):

CoCreateInstance call

After the highlighted of SystemSettings.exe, in Process Monitor I see RegQueryValue event by explorer.exe with call stack:

call stack of explorer.exe

Question:

I want to send the same event from my C# application to explorer.exe. How I can connect my app to COM+ API of explorer.exe ?

5
  • IImmersiveSettingsCache and IImmersiveShellComponent appear to be undocumented, so your guess is at least as good as anyone else's. Commented Jan 2, 2024 at 4:06
  • 2
    You have done the ground work, once there it's easy to call it from C# pastebin.com/raw/ghQUV4Av but you'll need to know the first function first parameter value you want to pass. Also you can get some GUIDS from this site: https://www.magnumdb.com/search?q=*immersivesettingscache* PS: this has nothing to do with "com+" which was the code name for Component Services and other stuff learn.microsoft.com/en-us/windows/win32/cossdk/… Commented Jan 2, 2024 at 9:44
  • @SimonMourier thanks for your help! I'm trying to do this, but nothing is happened. I know the argument value - it should be 6. I'm sending that, the function returns 0, but explorer.exe doesn't have anything like updating settings. Maybe shall I add DispId attribute? But what is DispId number? If the factory is provided for this COM type in registry, maybe I need use it for client object? Commented Jan 2, 2024 at 11:00
  • There's no dispid here, it's not an IDispatch interface. I don't know why it doesn't do what you expect, but at COM level, it works fine, there's nothing more to do. Commented Jan 2, 2024 at 11:47
  • At first you need have pdb symbols for view actuall function names instead of this garbage. And here usual com case. Probably code in twinui call CoRegisterClassObject and other code simply call CoCreateInstanse and than call methods on interface. Nothing more Commented Jan 2, 2024 at 17:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.