Tejas_Blr
Tejas_Blr

Reputation: 43

Calling C system calls from JNI

I am trying to make a system call, CreateProcess through JNI code base running on JAVA SDK. Will this work or do I have to use some other C call? The original program was written on Visual Studio, and now we are partly migrating to JAVA. I was using a WinAPI, CreateProcessW which internally called CreateProcess. And this CreateProcess had no definition, so am assuming it to be a system call. Somebody please help. Thank you.

P.S: I have to use only C code at this stage.

Upvotes: 2

Views: 585

Answers (1)

manuell
manuell

Reputation: 7620

CreateProcess is a Windows API.

In the SDK headers, it's defined as CreateProcessA or CreateProcessW.

WinBase.h excerpt:

#ifdef UNICODE
#define CreateProcess  CreateProcessW
#else
#define CreateProcess  CreateProcessA
#endif // !UNICODE

You should be able to call CreateProcess from your JNI Dll written in C.

Upvotes: 2

Related Questions