www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Calling Kernel32 functions from D

reply "Gyron" <Threk web.de> writes:
Hey Guys, i'm thinking about moving from c++ to D, but I cant 
live without the Kernel32 Functions, so whats the easiest way to 
use them in D?

I mean for example ReadProcessMemory etc.
Feb 25 2012
next sibling parent "Kagamin" <spam here.lot> writes:
On Saturday, 25 February 2012 at 21:50:06 UTC, Gyron wrote:
 Hey Guys, i'm thinking about moving from c++ to D, but I cant 
 live without the Kernel32 Functions, so whats the easiest way 
 to use them in D?

 I mean for example ReadProcessMemory etc.

Declare it and call. There're ready bindings like http://www.dsource.org/projects/bindings/browser/trunk/win32
Feb 25 2012
prev sibling next sibling parent torhu <no spam.invalid> writes:
On 25.02.2012 22:50, Gyron wrote:
 Hey Guys, i'm thinking about moving from c++ to D, but I cant
 live without the Kernel32 Functions, so whats the easiest way to
 use them in D?

 I mean for example ReadProcessMemory etc.

Look at the src\druntime\src\core\sys\windows folder in your DMD installation. The Windows API declarations are there. Some things are missing, but you can just declare that yourself as needed. Most of it is in core.sys.windows.windows, but ReadProcessMemory is declared in core.sys.windows.dbghelp. kernel32.lib is linked by default, so you don't need to do anything else to get it working.
Feb 25 2012
prev sibling next sibling parent simendsjo <simendsjo gmail.com> writes:
On Sat, 25 Feb 2012 22:50:05 +0100, Gyron <Threk web.de> wrote:

 Hey Guys, i'm thinking about moving from c++ to D, but I cant live  
 without the Kernel32 Functions, so whats the easiest way to use them in  
 D?

 I mean for example ReadProcessMemory etc.

You can also take a look at this https://github.com/AndrejMitrovic/DWinProgramming
Feb 25 2012
prev sibling parent "Gyron" <Threk web.de> writes:
On Saturday, 25 February 2012 at 22:25:57 UTC, simendsjo wrote:
 On Sat, 25 Feb 2012 22:50:05 +0100, Gyron <Threk web.de> wrote:

 Hey Guys, i'm thinking about moving from c++ to D, but I cant 
 live without the Kernel32 Functions, so whats the easiest way 
 to use them in D?

 I mean for example ReadProcessMemory etc.

You can also take a look at this https://github.com/AndrejMitrovic/DWinProgramming

Thanks all, will take a look into it :)
Feb 26 2012