module Process

def create_process_with_logon(logon, domain, passwd, logon_flags, app, cmd,

def create_process_with_logon(logon, domain, passwd, logon_flags, app, cmd,
  creation_flags, env, cwd, startinfo, procinfo)
  bool = CreateProcessWithLogonW(
    logon,           # User
    domain,          # Domain
    passwd,          # Password
    logon_flags,     # Logon flags
    app,             # App name
    cmd,             # Command line
    creation_flags,  # Creation flags
    env,             # Environment
    cwd,             # Working directory
    startinfo,       # Startup Info
    procinfo         # Process Info
  )
  unless bool
    raise SystemCallError.new("CreateProcessWithLogonW", FFI.errno)
  end
end