Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DCOM security

Posted on 2000-03-06
2
298 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
ID: 2591401
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
ID: 2591415
>>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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

789 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