Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DCOM security

Posted on 2000-03-06
2
Medium Priority
?
306 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 2000 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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

886 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