Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and forward server type param from Get-ComClassInterface cmdlet to OOP interface querying #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

the-deniss
Copy link
Contributor

Now Get-ComClassInterface tries to instantiate COM class for further querying implemented interfaces with CLSCTX derived from DefaultServerType. But sometimes this results in error:

$UsoClass = Get-ComClass -Clsid B91D5831-B1BD-4608-8198-D72E155020F7                                                                                                                                                                                                                                                                                                                                                                                                                             Get-ComClassInterface -ClassEntry $UsoClass
Exception calling "LoadSupportedInterfaces" with "3" argument(s): "ClassFactory cannot supply requested class"
At C:\Users\User\Documents\MyRepo\oleviewdotnet\bin\Release\OleViewDotNet.psm1:960 char:17
+ ...             $class.LoadSupportedInterfaces($Refresh, $Token, $ServerT ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception

Error occurs due attempt to instantiate this COM-object in-proc because UpdateSessionOrchestrator's DefaultServerType is InProcServer32. And it could be cool if you can manually specify desired server type. With proposed fix it can look like:

Get-ComClassInterface -ClassEntry $UsoClass -ServerType LocalServer32

Name                 IID                                  Module               VTableOffset
----                 ---                                  ------               ------------
IMarshal             00000003-0000-0000-c000-000000000046                      0
IMarshal2            000001cf-0000-0000-c000-000000000046                      0
IUnknown             00000000-0000-0000-c000-000000000046                      0
IUpdateSessionOrc... 07f3afac-7c8a-4ce7-a5e0-3d24ee8a77e0                      0
IMoUsoOrchestrator   c57692f8-8f5f-47cb-9381-34329b40285a                      0

P.S.: In the future, it will be nice to add this parameter to UI, but I'm too lazy for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant