rust - call WinAPI without unsafe block -


I just started to learn Jung and want to know that it is possible to call WinAPI functions without the insecure ?

  External crate libc; Fn Main () {insecure {libc :: funcs :: Extra :: kernel32 :: GetCurrentProcessId (); }}  

No, it is impossible, because they work directly in the external Binding is the C library, just like almost everything else in the libc format it can not be clear with functions like GetCurrentProcessId () but these actions are which to take unprotected and raw signal and null-ending formula is a lot of them because there.

There should be a proper safe cover, for any other c library, without calling them unsafe without calls. There is no such cover till now, as far as I know. But you can only write one for the subset of the WinAPI function you need, it should not be very difficult. You can write safe wrappers for external libraries and find out more about this.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -