Git Product home page Git Product logo

Comments (3)

Mistuke avatar Mistuke commented on July 16, 2024

Hi Yotam,

CreateProcess isn't here mostly because it's a very extensive API to make bindings for. It's inputs can get quite deeply nested and it's available arguments spread out over different includes.

Win32 also does not impose a minimum Windows version, as such it's difficult to determine which inputs (enum values etc) are valid for it.

Is there a particular reason you can't call the function from C and expose a simplified interface to your Haskell code via foreign imports? That's how most programs requiring non-standard process creation options do it.

from win32.

yohad avatar yohad commented on July 16, 2024

Thanks for the reply.
I haven't thought about creating a simplified C code or seen anywhere that this is the best option in such cases. I'll do that.
If you have any advice on how to handle the C library inside a stack project that would be appreciated.

from win32.

no-identd avatar no-identd commented on July 16, 2024

I also would strongly recommend avoiding exposing CreateProcess at all. Instead, explicitly bind to CreateProcessW (Unicode version), and maybe CreateProcessA (ANSI version). (the win32 package does seem to only expose the Unicode versions anyway, something that technically inverts the default behavior of the native APIs, since, if, for example, you call only CreateProcess, Windows will treat that as a call to CreateProcessA, and never as a call to CreateProcessW.)

...you might also want to know that Windows also has ZwCreateProcess & NtCreateProcess. :) (I don't think there exist [Zw/Nt]CreateProcess[A/W], however. Not sure tho.)

from win32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.