System Call in Windows and c++

Hey guys,

I am familiar with writing system calls in linux using c++, for example getpid or sinfo and so on , however , I am kinda lost when doing it in windows.

I would like to make the same system calls in windows but not sure how to do it.

So , I am not asking anyone to simply give me the code , but if anyone can just explain or give a tutorial link to a nice example etc.

I have searched google and a few sites showing some functions of system calls in windows , but it's a little too vague.

T.I.A.
I personally think that when system library calls are available, such as getpid(), you should call then and not use system(). What exactly are you trying to achieve with this? I would guess that you want to call DOS or NET commands. If that is the case, there are probably C or C++ library calls you can make.

Let us know what you want to do and perhaps we can more easily answer your question!

Good luck!
The WIN32 equivalent of getpid() is GetProcessId(). If you search MSDN for the help on this function you'll find it listed along with other system calls.

But if you want to stick to Linux-style code, MSVCRT provides _getpid(). MSDN will tell you more about this, too.

If you have the Windows SDK installed, you could also have a look at the winbase group of samples.

Andy
@ kooth,

I basically just want to play around with the system calls in windows , no real reason , but just to be familiar with it.

@andy I will have a look at MSVCRT.

Thx for the help guys !
Topic archived. No new replies allowed.