What's the difference between wmi and com? - windows

What's the difference between WMI and COM?
I thought COM is component objects of windows and WMI is a service or some APIs to interact with COM objects?

Related

Service dependency on AD client services

I have a Win32 service that runs in an AD environment. Very early in its startup phase, this service now needs to make ADSI calls in order to find out the computer account's group membership. What service dependencies do I have to configure for my service so all necessary AD client services have successfully started beforehand and my ADSI calls can succeed? I already have a dependency on rpcss, because the service implements an rpc server, but past experience has shown to me, that this is not sufficient in order to make successful ADSI calls during system startup.
Any help appreciated,
--
Stefan
• Regarding the ‘Win32’ service class is an object in WMI that represents a service on a computer system running Windows. It is simplified from Managed Object Format (MOF) code and includes all the inherited properties. For more information on configuring, it through its various syntaxes, kindly refer to the below documentation link that describes in detail the syntax for configuring the methods and properties that it supports: -
https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-service
• Also, as you want your Win32 service to find out the computer account's group membership through ADSI, you would have to use collection objects to represent any arbitrary set of items in a directory service that can be represented using the same data type as that of the Win32 service. Collection objects are defined as a set of VARIANT values, representing any of the valid Automation data types. Collection objects can represent both persistent information such as access-control lists and volatile information such as print jobs in a print queue. Groups are simply collections of objects supporting the ‘IADsMembers’ interface. Kindly refer to the documentation below to use the above-stated interface as it will help you to retrieve the information from an AD group: -
https://learn.microsoft.com/en-us/windows/win32/api/iads/nn-iads-iadsmembers
• The services required for the connecting to Active Directory are Kerberos Key Distribution Center (KDC), BITS (Background Intelligence Transfer Service), WMI (Windows Management Instrumentation), RPC (Remote Procedure Call), Background Tasks Infrastructure Service (BTIS), Extensible Authentication Protocol (EAP), Distributed Transaction Coordinator, Netlogon, RPC Endpoint Mapper and Remote Registry. These services are normally required by the client to connect to the AD Services.

Inter-process communication between a system service and a GUI on Windows

I am trying to figure out what the best way to communicate between a GUI and a Windows system service is. Named pipe seems to be a good option because it has built-in access control mechanism to protect the channel. I found that VPN apps actually use named pipe for communicating between their GUI with system services, such as ExpressVPN and NordVPN.
It seems that these VPN apps don't use basic Windows APIs for creating named pipes (i.e. CreateNamedPipe) but some other libraries or APIs because the behavior of these apps is almost the same: The system service, which is installed by the app, creates a named pipe with a name in this format: (app_id)(username):SingleInstanceIPCChannel or a random GUID string (e.g. 64de4b4e-96e2-4444-8946-f96888f5f3bd)
Anyone knows which library or APIs have this behavior?

What is a good API port standard for a MS Dynamic CRM SDK middle-tier interface?

I am trying to create a general MS Dynamic CRM (2013 on-premises) SDK middle-tier interface, so our customer can use our middle-tier interface to lively read, update, create, delete data from MS Dynamic CRM SDK. Our customer may connect our middle-tier with different system, for example a Java powered software, or a XML. So for building the API port of middle-tier interface, what is a good standard? May be XML with https? I am pretty new for this and this is a project for me, so I hope someone can explain more to me thanks.
Assuming you are building your middle-tier interface component on .NET, you can use the Dynamics CRM SDK. Design your component around the Microsoft.Xrm.Sdk.dll and use the IOrganizationService interface to access the CRM platform.
You can start reading how this works on MSDN. You may especially be interested in the topic "Use the IOrganizationService web service to read and write data or metadata".

Find COM server for an application

I have some applications which call the same COM server (over the same interop dll). If I have to terminate one of these applications because it hangs or something else the belonging COM server continues.
Is there a way to decide which COM Server belongs to a specific application? I've searched for a way using process id or handle but didn't find a solution.
Thanks for any help.

How to Register a COM dll for non administrative users

My setup program has one COM dll which need to be registered.
I tried to run my setup program under win7 32 bit "standard user" and it failed because COM dll registration which requires admin privilege. Except this, my application doesn't need any admin privilege to work.
Is there any way to resolve this issue. I need to run my application for non admin users.
Per user registration (e.g. reg.exe import to HKCU) does not require admin. See Non-Admin ActiveX Controls
COM Components do not need to be registered in order to be used.
You can use CoRegisterClassObject to register the IClassFactory interface for an object. This method works if you implement the COM object.
You can call LoadLibrary to get the DllGetclassObject entrypoint to the dll, and create the object using the class factory directly.
You can create a simple XML file that exposes the COM dll as an assembly. Add the assembly as a dependent assembly of your application and you have Registration Free Com

Resources