Connect remote windows machine

Discussion in 'C Programming' started by krian, Aug 5, 2003.

  1. krian

    krian Guest

    Hi,
    I am a IT student, present we r doing project in network
    programming.
    I got some problem here...can anybody give me a solution ..?

    My problem is:
    I have to write a program in C, it takes input a windows machine
    name in a LAN and generate a output that list the all folders which r
    in sharing in a given machine name.

    I need a process or method, how to do it..?

    cheers
    kiran
     
    krian, Aug 5, 2003
    #1
    1. Advertising

  2. krian

    Mike Wahler Guest

    Re: [OT, redirect] Connect remote windows machine

    krian <> wrote in message
    news:...
    > Hi,
    > I am a IT student, present we r doing project in network
    > programming.
    > I got some problem here...can anybody give me a solution ..?
    >
    > My problem is:
    > I have to write a program in C, it takes input a windows machine
    > name in a LAN and generate a output that list the all folders which r
    > in sharing in a given machine name.
    >
    > I need a process or method, how to do it..?


    You haven't asked anything about the C language, thus your
    query is not topical here. You're asking how to using
    networking in Windows. The C language has no support for
    networking or operating system specific features.
    C is a platform-independent language.

    Your issue is documented at www.msdn.microsoft.com
    If you're still stuck, visit newsgroup:
    microsoft.public.win32.programmer

    Read the messages there before you post, it's very likely
    your question has already been asked and answered there.

    -Mike
     
    Mike Wahler, Aug 5, 2003
    #2
    1. Advertising

  3. On Tue, 05 Aug 2003 02:34:05 -0400, krian wrote:

    > My problem is:
    > I have to write a program in C, it takes input a windows machine
    > name in a LAN and generate a output that list the all folders which r
    > in sharing in a given machine name.
    >
    > I need a process or method, how to do it..?


    That's no problem. Just encode the NetBIOS header (easy, only 4 bytes),
    then encode the SMB header (harder, 32 bytes), write that to a socket,
    repeat the process for SMB_COM_NEGOTIATE, SMB_COM_SESSION_SETUP_ANDX,
    SMB_COM_TREE_CONNECT_ANDX, then open a TransactNamedPipe to IPC$, then
    encode and issue the SMB_COM_TRANSACTION for the DCE/RPC bind request
    (UUID 4b323fc8-1233-34r3-2393-asdfasdf00), read the bind ack (note you
    need full multi-part transactions for this because RPC PDUs can span
    multiple SMB buffers), and finally issue the SVRSVC NetShareEnum RPC. Now
    do everything in reverse to read the response.

    Good luck,
    Mike
     
    Michael B Allen, Aug 5, 2003
    #3
  4. Re: [OT] Connect remote windows machine

    On Tue, 05 Aug 2003 12:20:22 -0400, Mike Wahler wrote:
    >> encode and issue the SMB_COM_TRANSACTION for the DCE/RPC bind request
    >> (UUID 4b323fc8-1233-34r3-2393-asdfasdf00), read the bind ack (note you
    >> need full multi-part transactions for this because RPC PDUs can span
    >> multiple SMB buffers), and finally issue the SVRSVC NetShareEnum RPC.
    >> Now do everything in reverse to read the response.

    >
    > This is the problem with replying to off-topic questions. The Windows
    > API offers a much simpler solution.


    I think you should spend some time on rec.humor Mike.
     
    Michael B Allen, Aug 6, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Otis Mukinfus
    Replies:
    3
    Views:
    942
    Juan T. Llibre
    Jul 8, 2005
  2. Pooja Sharma
    Replies:
    1
    Views:
    4,178
    Ross Wilson
    Aug 9, 2005
  3. Shane Geiger
    Replies:
    0
    Views:
    1,048
    Shane Geiger
    Dec 31, 2007
  4. Tim Chandler
    Replies:
    0
    Views:
    229
    Tim Chandler
    Oct 7, 2003
  5. Replies:
    2
    Views:
    304
Loading...

Share This Page