Solved

DCOM security

Posted on 2000-03-06
2
296 Views
Last Modified: 2008-02-20
Everyone known,When dcom client connect to dcom server ,How to known dcom client's machine name in the dcom server?
0
Comment
Question by:shala
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
This can be done by using a channel hook. Don Box explained this technique some time earlier in MSJ.

See

http://www.develop.com/dbox/com/hooks/hosthook/

for the code & explanations

Quote from the page:

"HostHook - A Custom Channel Hook for Recovering Host Name of Caller/Callee

HostHook is a custom channel hook that sends the IP address, process and thread ID of the direct and original caller as an ORPC_EXTENT. This hook is useful for finding out the location of a caller inside a COM method invocation. It is also useful for finding out where a given method executed after the proxy returns control to the client thread. "
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
>>How to known dcom client's machine name in the dcom
>>server?

If you've got the IP on the server side, simply use

    WSADATA wsaData;
   
    if (::WSAStartup(MAKEWORD(1, 1), &wsaData) == 0)
    {
        char szHostName[256];

              HOSTENT* phe;

              phe = gethostbyaddr ( ...);

              if ( phe)
                 {
                   printf ( "%s\n", phe->h_name);
                 }
 

        ::WSACleanup();
    }
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now