#ifndef COSMOPOLITAN_LIBC_NT_NT_LOADER_H_
#define COSMOPOLITAN_LIBC_NT_NT_LOADER_H_
#include "libc/nt/enum/status.h"
#include "libc/nt/typedef/wambda.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/*                            ââââ
                       âââââââââââââââââ
                      ââââââââââââââââââââ
                     ââââââââââââââââââââ  âââ
                     âââââââââââââââââââ   âââââââ        ââââââ
                    ââââââââââââââââââââ  âââââââââââââââââââââ
                   ââââââââââââââââââââ   âââââââââââââââââââââ
                   ââââââââââââââââââââ  âââââââââââââââââââââ
                  ââââââââââââââââââââ  ââââââââââââââââââââââ
                  ââââââ      âââââââ   âââââââââââââââââââââ
                                   ââ  âââââââââââââââââââââ
                  âââââââââââââââ      âââââââââââââââââââââ
                ââââââââââââââââââââ     ââââââââââââââââââ
               ââââââââââââââââââââ   ââ      ââââââ
               ââââââââââââââââââââ  âââââââ         âââââ   ââââââââââââ
              ââââââââââââââââââââ  ââââââââââââââââââââââ           ââââ
              âââââââââââââââââââ   âââââââââââââââââââââ            âââ
             ââââââââââââââââââââ  âââââââââââââââââââââ            âââ
             âââââââââââââââââââ   âââââââââââââââââââââ           âââ
            ââââââââââââââââââââ  âââââââââââââââââââââ           âââ
                            âââ  ââââââââââââââââââââââ          âââ
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â cosmopolitan Â§ new technology Â» beyond the pale Â» loader                 ââ¬âââ¼
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
    âThe functions and structures in [for these APIs] are internal to
     the operating system and subject to change from one release of
     Windows to the next, and possibly even between service packs for
     each release.â ââQuoth MSDN */

struct NtAnsiString;
struct NtLdrDataTableEntry;
struct NtUnicodeString;

NtStatus LdrLoadDll(const char16_t *opt_PathToFile, uint32_t *opt_Flags,
                    struct NtUnicodeString *ModuleFileName,
                    void **out_ModuleHandle);
NtStatus LdrUnloadDll(void *ModuleHandle);
NtStatus LdrGetProcedureAddress(void *ModuleHandle,
                                struct NtAnsiString *opt_ProcedureName,
                                uint32_t opt_Ordinal,
                                wambda *out_ProcedureAddress);
NtStatus LdrGetDllHandle(const char16_t *opt_PathToFile, uint32_t opt_Unused,
                         struct NtUnicodeString *ModuleFileName,
                         void **out_ModuleHandle);

COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_NT_LOADER_H_ */
