Skip to content

Commit

Permalink
feat(api): kernel32 GetProcAddress()
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Jul 1, 2024
1 parent de59df2 commit 9cec31a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/win32-api/src/lib/kernel32/api.def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class DefKernel32 implements T.LibDefBase {

static GetProcessHeaps = [D.DWORD, [D.DWORD, D.PHANDLE]]

/** https://learn.microsoft.com/zh-cn/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress */
static GetProcAddress = ['intptr_t', [D.HMODULE, D.WString]] // FARPROC

static GetSystemTimes = [D.BOOL, [`_Out_ ${S.LPFILETIME}`, `_Out_ ${S.LPFILETIME}`, `_Out_ ${S.LPFILETIME}`]]

/** https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-gettickcount */
Expand Down
3 changes: 3 additions & 0 deletions packages/win32-api/src/lib/kernel32/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export class Kernel32 implements T.LibDef2Type<typeof DefKernel32> {

OpenProcess: (dwDesiredAccess: T.DWORD, bInheritHandle: T.BOOL, dwProcessId: T.DWORD) => T.HANDLE

/** https://learn.microsoft.com/zh-cn/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress */
GetProcAddress: (hModule: T.HMODULE, lpProcName: T.WString) => T.INT_PTR

/** https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw */
LoadLibraryExW: (lpLibFileName: T.WString, hFile: T.HANDLE, dwFlags: T.DWORD) => T.HMODULE

Expand Down

0 comments on commit 9cec31a

Please sign in to comment.