Connect remote windows machine

K

krian

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
 
M

Mike Wahler

krian said:
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
 
M

Michael B Allen

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
 
M

Michael B Allen

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top