mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 04:50:29 +00:00
Improve formatting and #raw_union logic in core:sys/windows
This commit is contained in:
@@ -5,6 +5,6 @@ foreign import "system:Dnsapi.lib"
|
||||
|
||||
@(default_calling_convention="system")
|
||||
foreign Dnsapi {
|
||||
DnsQuery_UTF8 :: proc(name: cstring, type: u16, options: DNS_QUERY_OPTIONS, extra: PVOID, results: ^^DNS_RECORD, reserved: PVOID) -> DNS_STATUS ---
|
||||
DnsRecordListFree :: proc(list: ^DNS_RECORD, options: DWORD) ---
|
||||
DnsQuery_UTF8 :: proc(name: cstring, type: u16, options: DNS_QUERY_OPTIONS, extra: PVOID, results: ^^DNS_RECORD, reserved: PVOID) -> DNS_STATUS ---
|
||||
DnsRecordListFree :: proc(list: ^DNS_RECORD, options: DWORD) ---
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ DWM_WINDOW_CORNER_PREFERENCE :: enum c_int {
|
||||
|
||||
@(default_calling_convention="system")
|
||||
foreign dwmapi {
|
||||
DwmFlush :: proc() -> HRESULT ---
|
||||
DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT ---
|
||||
DwmFlush :: proc() -> HRESULT ---
|
||||
DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT ---
|
||||
DwmExtendFrameIntoClientArea :: proc(hWnd: HWND, pMarInset: PMARGINS) -> HRESULT ---
|
||||
DwmGetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: PVOID, cbAttribute: DWORD) -> HRESULT ---
|
||||
DwmSetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPCVOID, cbAttribute: DWORD) -> HRESULT ---
|
||||
DwmGetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: PVOID, cbAttribute: DWORD) -> HRESULT ---
|
||||
DwmSetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPCVOID, cbAttribute: DWORD) -> HRESULT ---
|
||||
}
|
||||
|
||||
@@ -7,85 +7,88 @@ foreign import gdi32 "system:Gdi32.lib"
|
||||
|
||||
@(default_calling_convention="system")
|
||||
foreign gdi32 {
|
||||
GetDeviceCaps :: proc(hdc: HDC, index: INT) -> INT ---
|
||||
GetDeviceCaps :: proc(hdc: HDC, index: INT) -> INT ---
|
||||
GetStockObject :: proc(i: INT) -> HGDIOBJ ---
|
||||
SelectObject :: proc(hdc: HDC, h: HGDIOBJ) -> HGDIOBJ ---
|
||||
DeleteObject :: proc(ho: HGDIOBJ) -> BOOL ---
|
||||
SetBkColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
|
||||
SetBkMode :: proc(hdc: HDC, mode: BKMODE) -> INT ---
|
||||
SelectObject :: proc(hdc: HDC, h: HGDIOBJ) -> HGDIOBJ ---
|
||||
DeleteObject :: proc(ho: HGDIOBJ) -> BOOL ---
|
||||
SetBkColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
|
||||
SetBkMode :: proc(hdc: HDC, mode: BKMODE) -> INT ---
|
||||
|
||||
CreateCompatibleDC :: proc(hdc: HDC) -> HDC ---
|
||||
DeleteDC :: proc(hdc: HDC) -> BOOL ---
|
||||
CancelDC :: proc(hdc: HDC) -> BOOL ---
|
||||
SaveDC :: proc(hdc: HDC) -> INT ---
|
||||
RestoreDC :: proc(hdc: HDC, nSavedDC: INT) -> BOOL ---
|
||||
DeleteDC :: proc(hdc: HDC) -> BOOL ---
|
||||
CancelDC :: proc(hdc: HDC) -> BOOL ---
|
||||
SaveDC :: proc(hdc: HDC) -> INT ---
|
||||
RestoreDC :: proc(hdc: HDC, nSavedDC: INT) -> BOOL ---
|
||||
|
||||
CreateDIBPatternBrush :: proc(h: HGLOBAL, iUsage: UINT) -> HBRUSH ---
|
||||
CreateDIBitmap :: proc(hdc: HDC, pbmih: ^BITMAPINFOHEADER, flInit: DWORD, pjBits: VOID, pbmi: ^BITMAPINFO, iUsage: UINT) -> HBITMAP ---
|
||||
CreateDIBSection :: proc(hdc: HDC, pbmi: ^BITMAPINFO, usage: UINT, ppvBits: ^^VOID, hSection: HANDLE, offset: DWORD) -> HBITMAP ---
|
||||
StretchDIBits :: proc(hdc: HDC, xDest, yDest, DestWidth, DestHeight, xSrc, ySrc, SrcWidth, SrcHeight: INT, lpBits: VOID, lpbmi: ^BITMAPINFO, iUsage: UINT, rop: DWORD) -> INT ---
|
||||
StretchBlt :: proc(hdcDest: HDC, xDest, yDest, wDest, hDest: INT, hdcSrc: HDC, xSrc, ySrc, wSrc, hSrc: INT, rop: DWORD) -> BOOL ---
|
||||
CreateDIBitmap :: proc(hdc: HDC, pbmih: ^BITMAPINFOHEADER, flInit: DWORD, pjBits: VOID, pbmi: ^BITMAPINFO, iUsage: UINT) -> HBITMAP ---
|
||||
CreateDIBSection :: proc(hdc: HDC, pbmi: ^BITMAPINFO, usage: UINT, ppvBits: ^^VOID, hSection: HANDLE, offset: DWORD) -> HBITMAP ---
|
||||
StretchDIBits :: proc(hdc: HDC, xDest, yDest, DestWidth, DestHeight, xSrc, ySrc, SrcWidth, SrcHeight: INT, lpBits: VOID, lpbmi: ^BITMAPINFO, iUsage: UINT, rop: DWORD) -> INT ---
|
||||
StretchBlt :: proc(hdcDest: HDC, xDest, yDest, wDest, hDest: INT, hdcSrc: HDC, xSrc, ySrc, wSrc, hSrc: INT, rop: DWORD) -> BOOL ---
|
||||
|
||||
SetPixelFormat :: proc(hdc: HDC, format: INT, ppfd: ^PIXELFORMATDESCRIPTOR) -> BOOL ---
|
||||
ChoosePixelFormat :: proc(hdc: HDC, ppfd: ^PIXELFORMATDESCRIPTOR) -> INT ---
|
||||
SetPixelFormat :: proc(hdc: HDC, format: INT, ppfd: ^PIXELFORMATDESCRIPTOR) -> BOOL ---
|
||||
ChoosePixelFormat :: proc(hdc: HDC, ppfd: ^PIXELFORMATDESCRIPTOR) -> INT ---
|
||||
DescribePixelFormat :: proc(hdc: HDC, iPixelFormat: INT, nBytes: UINT, ppfd: ^PIXELFORMATDESCRIPTOR) -> INT ---
|
||||
SwapBuffers :: proc(hdc: HDC) -> BOOL ---
|
||||
SwapBuffers :: proc(hdc: HDC) -> BOOL ---
|
||||
|
||||
SetDCBrushColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
|
||||
GetDCBrushColor :: proc(hdc: HDC) -> COLORREF ---
|
||||
PatBlt :: proc(hdc: HDC, x, y, w, h: INT, rop: DWORD) -> BOOL ---
|
||||
Rectangle :: proc(hdc: HDC, left, top, right, bottom: INT) -> BOOL ---
|
||||
PatBlt :: proc(hdc: HDC, x, y, w, h: INT, rop: DWORD) -> BOOL ---
|
||||
Rectangle :: proc(hdc: HDC, left, top, right, bottom: INT) -> BOOL ---
|
||||
|
||||
CreateFontW :: proc(cHeight, cWidth, cEscapement, cOrientation, cWeight: INT, bItalic, bUnderline, bStrikeOut, iCharSet, iOutPrecision: DWORD, iClipPrecision, iQuality, iPitchAndFamily: DWORD, pszFaceName: LPCWSTR) -> HFONT ---
|
||||
CreateFontIndirectW :: proc(lplf: ^LOGFONTW) -> HFONT ---
|
||||
CreateFontW :: proc(cHeight, cWidth, cEscapement, cOrientation, cWeight: INT, bItalic, bUnderline, bStrikeOut, iCharSet, iOutPrecision: DWORD, iClipPrecision, iQuality, iPitchAndFamily: DWORD, pszFaceName: LPCWSTR) -> HFONT ---
|
||||
CreateFontIndirectW :: proc(lplf: ^LOGFONTW) -> HFONT ---
|
||||
CreateFontIndirectExW :: proc(unnamedParam1: ^ENUMLOGFONTEXDVW) -> HFONT ---
|
||||
AddFontResourceW :: proc(unnamedParam1: LPCWSTR) -> INT ---
|
||||
AddFontResourceExW :: proc(name: LPCWSTR, fl: DWORD, res: PVOID) -> INT ---
|
||||
AddFontMemResourceEx :: proc(pFileView: PVOID, cjSize: DWORD, pvResrved: PVOID, pNumFonts: ^DWORD) -> HANDLE ---
|
||||
EnumFontsW :: proc(hdc: HDC, lpLogfont: LPCWSTR, lpProc: FONTENUMPROCW, lParam: LPARAM) -> INT ---
|
||||
EnumFontFamiliesW :: proc(hdc: HDC, lpLogfont: LPCWSTR, lpProc: FONTENUMPROCW, lParam: LPARAM) -> INT ---
|
||||
EnumFontFamiliesExW :: proc(hdc: HDC, lpLogfont: LPLOGFONTW, lpProc: FONTENUMPROCW, lParam: LPARAM, dwFlags: DWORD) -> INT ---
|
||||
AddFontResourceW :: proc(unnamedParam1: LPCWSTR) -> INT ---
|
||||
AddFontResourceExW :: proc(name: LPCWSTR, fl: DWORD, res: PVOID) -> INT ---
|
||||
AddFontMemResourceEx :: proc(pFileView: PVOID, cjSize: DWORD, pvResrved: PVOID, pNumFonts: ^DWORD) -> HANDLE ---
|
||||
EnumFontsW :: proc(hdc: HDC, lpLogfont: LPCWSTR, lpProc: FONTENUMPROCW, lParam: LPARAM) -> INT ---
|
||||
EnumFontFamiliesW :: proc(hdc: HDC, lpLogfont: LPCWSTR, lpProc: FONTENUMPROCW, lParam: LPARAM) -> INT ---
|
||||
EnumFontFamiliesExW :: proc(hdc: HDC, lpLogfont: LPLOGFONTW, lpProc: FONTENUMPROCW, lParam: LPARAM, dwFlags: DWORD) -> INT ---
|
||||
|
||||
TextOutW :: proc(hdc: HDC, x, y: INT, lpString: LPCWSTR, c: INT) -> BOOL ---
|
||||
TextOutW :: proc(hdc: HDC, x, y: INT, lpString: LPCWSTR, c: INT) -> BOOL ---
|
||||
GetTextExtentPoint32W :: proc(hdc: HDC, lpString: LPCWSTR, c: INT, psizl: LPSIZE) -> BOOL ---
|
||||
GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL ---
|
||||
GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL ---
|
||||
|
||||
CreateSolidBrush :: proc(color: COLORREF) -> HBRUSH ---
|
||||
|
||||
GetObjectW :: proc(h: HANDLE, c: INT, pv: LPVOID) -> c_int ---
|
||||
GetObjectW :: proc(h: HANDLE, c: INT, pv: LPVOID) -> c_int ---
|
||||
CreateCompatibleBitmap :: proc(hdc: HDC, cx, cy: INT) -> HBITMAP ---
|
||||
BitBlt :: proc(hdc: HDC, x, y, cx, cy: INT, hdcSrc: HDC, x1, y1: INT, rop: DWORD) -> BOOL ---
|
||||
GetDIBits :: proc(hdc: HDC, hbm: HBITMAP, start, cLines: UINT, lpvBits: LPVOID, lpbmi: ^BITMAPINFO, usage: UINT) -> INT ---
|
||||
SetDIBits :: proc(hdc: HDC, hbm: HBITMAP, start: UINT, cLines: UINT, lpBits: VOID, lpbmi: ^BITMAPINFO, ColorUse: UINT) -> INT ---
|
||||
SetDIBColorTable :: proc(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: ^RGBQUAD) -> UINT ---
|
||||
GetDIBColorTable :: proc(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: ^RGBQUAD) -> UINT ---
|
||||
BitBlt :: proc(hdc: HDC, x, y, cx, cy: INT, hdcSrc: HDC, x1, y1: INT, rop: DWORD) -> BOOL ---
|
||||
GetDIBits :: proc(hdc: HDC, hbm: HBITMAP, start, cLines: UINT, lpvBits: LPVOID, lpbmi: ^BITMAPINFO, usage: UINT) -> INT ---
|
||||
SetDIBits :: proc(hdc: HDC, hbm: HBITMAP, start: UINT, cLines: UINT, lpBits: VOID, lpbmi: ^BITMAPINFO, ColorUse: UINT) -> INT ---
|
||||
SetDIBColorTable :: proc(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: ^RGBQUAD) -> UINT ---
|
||||
GetDIBColorTable :: proc(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: ^RGBQUAD) -> UINT ---
|
||||
|
||||
CreatePen :: proc(iStyle, cWidth: INT, color: COLORREF) -> HPEN ---
|
||||
ExtCreatePen :: proc(iPenStyle, cWidth: DWORD, plbrush: ^LOGBRUSH, cStyle: DWORD, pstyle: ^DWORD) -> HPEN ---
|
||||
CreatePen :: proc(iStyle, cWidth: INT, color: COLORREF) -> HPEN ---
|
||||
ExtCreatePen :: proc(iPenStyle, cWidth: DWORD, plbrush: ^LOGBRUSH, cStyle: DWORD, pstyle: ^DWORD) -> HPEN ---
|
||||
SetDCPenColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
|
||||
GetDCPenColor :: proc(hdc: HDC) -> COLORREF ---
|
||||
|
||||
CreatePalette :: proc(plpal: ^LOGPALETTE) -> HPALETTE ---
|
||||
SelectPalette :: proc(hdc: HDC, hPal: HPALETTE, bForceBkgd: BOOL) -> HPALETTE ---
|
||||
CreatePalette :: proc(plpal: ^LOGPALETTE) -> HPALETTE ---
|
||||
SelectPalette :: proc(hdc: HDC, hPal: HPALETTE, bForceBkgd: BOOL) -> HPALETTE ---
|
||||
RealizePalette :: proc(hdc: HDC) -> UINT ---
|
||||
|
||||
SetTextColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
|
||||
RoundRect :: proc(hdc: HDC, left: INT, top: INT, right: INT, bottom: INT, width: INT, height: INT) -> BOOL ---
|
||||
SetPixel :: proc(hdc: HDC, x: INT, y: INT, color: COLORREF) -> COLORREF ---
|
||||
RoundRect :: proc(hdc: HDC, left: INT, top: INT, right: INT, bottom: INT, width: INT, height: INT) -> BOOL ---
|
||||
SetPixel :: proc(hdc: HDC, x: INT, y: INT, color: COLORREF) -> COLORREF ---
|
||||
|
||||
GdiTransparentBlt :: proc(hdcDest: HDC, xoriginDest, yoriginDest, wDest, hDest: INT, hdcSrc: HDC, xoriginSrc, yoriginSrc, wSrc, hSrc: INT, crTransparent: UINT) -> BOOL ---
|
||||
GdiGradientFill :: proc(hdc: HDC, pVertex: PTRIVERTEX, nVertex: ULONG, pMesh: PVOID, nCount: ULONG, ulMode: ULONG) -> BOOL ---
|
||||
GdiAlphaBlend :: proc(hdcDest: HDC, xoriginDest, yoriginDest, wDest, hDest: INT, hdcSrc: HDC, xoriginSrc, yoriginSrc, wSrc, hSrc: INT, ftn: BLENDFUNCTION) -> BOOL ---
|
||||
GdiGradientFill :: proc(hdc: HDC, pVertex: PTRIVERTEX, nVertex: ULONG, pMesh: PVOID, nCount: ULONG, ulMode: ULONG) -> BOOL ---
|
||||
GdiAlphaBlend :: proc(hdcDest: HDC, xoriginDest, yoriginDest, wDest, hDest: INT, hdcSrc: HDC, xoriginSrc, yoriginSrc, wSrc, hSrc: INT, ftn: BLENDFUNCTION) -> BOOL ---
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
RGB :: #force_inline proc "contextless" (#any_int r, g, b: int) -> COLORREF {
|
||||
return COLORREF(DWORD(BYTE(r)) | (DWORD(BYTE(g)) << 8) | (DWORD(BYTE(b)) << 16))
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
PALETTERGB :: #force_inline proc "contextless" (#any_int r, g, b: int) -> COLORREF {
|
||||
return 0x02000000 | RGB(r, g, b)
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
PALETTEINDEX :: #force_inline proc "contextless" (#any_int i: int) -> COLORREF {
|
||||
return COLORREF(DWORD(0x01000000) | DWORD(WORD(i)))
|
||||
}
|
||||
@@ -154,17 +157,21 @@ ICONINFOEXW :: struct {
|
||||
}
|
||||
PICONINFOEXW :: ^ICONINFOEXW
|
||||
|
||||
AC_SRC_OVER :: 0x00
|
||||
AC_SRC_OVER :: 0x00
|
||||
AC_SRC_ALPHA :: 0x01
|
||||
|
||||
TransparentBlt :: GdiTransparentBlt
|
||||
GradientFill :: GdiGradientFill
|
||||
AlphaBlend :: GdiAlphaBlend
|
||||
GradientFill :: GdiGradientFill
|
||||
AlphaBlend :: GdiAlphaBlend
|
||||
|
||||
COLOR16 :: USHORT
|
||||
TRIVERTEX :: struct {
|
||||
x, y: LONG,
|
||||
Red, Green, Blue, Alpha: COLOR16,
|
||||
x: LONG,
|
||||
y: LONG,
|
||||
Red: COLOR16,
|
||||
Green: COLOR16,
|
||||
Blue: COLOR16,
|
||||
Alpha: COLOR16,
|
||||
}
|
||||
PTRIVERTEX :: ^TRIVERTEX
|
||||
|
||||
@@ -179,7 +186,10 @@ GRADIENT_RECT :: struct {
|
||||
PGRADIENT_RECT :: ^GRADIENT_RECT
|
||||
|
||||
BLENDFUNCTION :: struct {
|
||||
BlendOp, BlendFlags, SourceConstantAlpha, AlphaFormat: BYTE,
|
||||
BlendOp: BYTE,
|
||||
BlendFlags: BYTE,
|
||||
SourceConstantAlpha: BYTE,
|
||||
AlphaFormat: BYTE,
|
||||
}
|
||||
|
||||
GRADIENT_FILL_RECT_H : ULONG : 0x00000000
|
||||
|
||||
@@ -2,149 +2,149 @@
|
||||
package sys_windows
|
||||
|
||||
HIDD_CONFIGURATION :: struct {
|
||||
cookie: PVOID,
|
||||
size: ULONG,
|
||||
cookie: PVOID,
|
||||
size: ULONG,
|
||||
RingBufferSize: ULONG,
|
||||
}
|
||||
PHIDD_CONFIGURATION :: ^HIDD_CONFIGURATION
|
||||
|
||||
HIDD_ATTRIBUTES :: struct {
|
||||
Size: ULONG,
|
||||
VendorID: USHORT,
|
||||
ProductID: USHORT,
|
||||
Size: ULONG,
|
||||
VendorID: USHORT,
|
||||
ProductID: USHORT,
|
||||
VersionNumber: USHORT,
|
||||
}
|
||||
PHIDD_ATTRIBUTES :: ^HIDD_ATTRIBUTES
|
||||
|
||||
HIDP_CAPS :: struct {
|
||||
Usage: USAGE,
|
||||
UsagePage: USAGE,
|
||||
InputReportByteLength: USHORT,
|
||||
OutputReportByteLength: USHORT,
|
||||
FeatureReportByteLength: USHORT,
|
||||
Reserved: [17]USHORT,
|
||||
Usage: USAGE,
|
||||
UsagePage: USAGE,
|
||||
InputReportByteLength: USHORT,
|
||||
OutputReportByteLength: USHORT,
|
||||
FeatureReportByteLength: USHORT,
|
||||
Reserved: [17]USHORT,
|
||||
NumberLinkCollectionNodes: USHORT,
|
||||
NumberInputButtonCaps: USHORT,
|
||||
NumberInputValueCaps: USHORT,
|
||||
NumberInputDataIndices: USHORT,
|
||||
NumberOutputButtonCaps: USHORT,
|
||||
NumberOutputValueCaps: USHORT,
|
||||
NumberOutputDataIndices: USHORT,
|
||||
NumberFeatureButtonCaps: USHORT,
|
||||
NumberFeatureValueCaps: USHORT,
|
||||
NumberFeatureDataIndices: USHORT,
|
||||
NumberInputButtonCaps: USHORT,
|
||||
NumberInputValueCaps: USHORT,
|
||||
NumberInputDataIndices: USHORT,
|
||||
NumberOutputButtonCaps: USHORT,
|
||||
NumberOutputValueCaps: USHORT,
|
||||
NumberOutputDataIndices: USHORT,
|
||||
NumberFeatureButtonCaps: USHORT,
|
||||
NumberFeatureValueCaps: USHORT,
|
||||
NumberFeatureDataIndices: USHORT,
|
||||
}
|
||||
PHIDP_CAPS :: ^HIDP_CAPS
|
||||
|
||||
HIDP_BUTTON_CAPS :: struct {
|
||||
UsagePage: USAGE,
|
||||
ReportID: UCHAR,
|
||||
IsAlias: BOOLEAN,
|
||||
BitField: USHORT,
|
||||
LinkCollection: USHORT,
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
IsRange: BOOLEAN,
|
||||
IsStringRange: BOOLEAN,
|
||||
UsagePage: USAGE,
|
||||
ReportID: UCHAR,
|
||||
IsAlias: BOOLEAN,
|
||||
BitField: USHORT,
|
||||
LinkCollection: USHORT,
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
IsRange: BOOLEAN,
|
||||
IsStringRange: BOOLEAN,
|
||||
IsDesignatorRange: BOOLEAN,
|
||||
IsAbsolute: BOOLEAN,
|
||||
ReportCount: USHORT,
|
||||
Reserved2: USHORT,
|
||||
Reserved: [9]ULONG,
|
||||
IsAbsolute: BOOLEAN,
|
||||
ReportCount: USHORT,
|
||||
Reserved2: USHORT,
|
||||
Reserved: [9]ULONG,
|
||||
using _: struct #raw_union {
|
||||
Range: struct {
|
||||
UsageMin: USAGE,
|
||||
UsageMax: USAGE,
|
||||
StringMin: USHORT,
|
||||
StringMax: USHORT,
|
||||
UsageMin: USAGE,
|
||||
UsageMax: USAGE,
|
||||
StringMin: USHORT,
|
||||
StringMax: USHORT,
|
||||
DesignatorMin: USHORT,
|
||||
DesignatorMax: USHORT,
|
||||
DataIndexMin: USHORT,
|
||||
DataIndexMax: USHORT,
|
||||
},
|
||||
DataIndexMin: USHORT,
|
||||
DataIndexMax: USHORT,
|
||||
} `raw_union_tag:"IsRange=true"`,
|
||||
NotRange: struct {
|
||||
Usage: USAGE,
|
||||
Reserved1: USAGE,
|
||||
StringIndex: USHORT,
|
||||
Reserved2: USHORT,
|
||||
Usage: USAGE,
|
||||
Reserved1: USAGE,
|
||||
StringIndex: USHORT,
|
||||
Reserved2: USHORT,
|
||||
DesignatorIndex: USHORT,
|
||||
Reserved3: USHORT,
|
||||
DataIndex: USHORT,
|
||||
Reserved4: USHORT,
|
||||
},
|
||||
Reserved3: USHORT,
|
||||
DataIndex: USHORT,
|
||||
Reserved4: USHORT,
|
||||
} `raw_union_tag:"IsRange=false"`,
|
||||
},
|
||||
}
|
||||
PHIDP_BUTTON_CAPS :: ^HIDP_BUTTON_CAPS
|
||||
|
||||
HIDP_VALUE_CAPS :: struct {
|
||||
UsagePage: USAGE,
|
||||
ReportID: UCHAR,
|
||||
IsAlias: BOOLEAN,
|
||||
BitField: USHORT,
|
||||
LinkCollection: USHORT,
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
IsRange: BOOLEAN,
|
||||
IsStringRange: BOOLEAN,
|
||||
UsagePage: USAGE,
|
||||
ReportID: UCHAR,
|
||||
IsAlias: BOOLEAN,
|
||||
BitField: USHORT,
|
||||
LinkCollection: USHORT,
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
IsRange: BOOLEAN,
|
||||
IsStringRange: BOOLEAN,
|
||||
IsDesignatorRange: BOOLEAN,
|
||||
IsAbsolute: BOOLEAN,
|
||||
HasNull: BOOLEAN,
|
||||
Reserved: UCHAR,
|
||||
BitSize: USHORT,
|
||||
ReportCount: USHORT,
|
||||
Reserved2: [5]USHORT,
|
||||
UnitsExp: ULONG,
|
||||
Units: ULONG,
|
||||
LogicalMin: LONG,
|
||||
LogicalMax: LONG,
|
||||
PhysicalMin: LONG,
|
||||
PhysicalMax: LONG,
|
||||
IsAbsolute: BOOLEAN,
|
||||
HasNull: BOOLEAN,
|
||||
Reserved: UCHAR,
|
||||
BitSize: USHORT,
|
||||
ReportCount: USHORT,
|
||||
Reserved2: [5]USHORT,
|
||||
UnitsExp: ULONG,
|
||||
Units: ULONG,
|
||||
LogicalMin: LONG,
|
||||
LogicalMax: LONG,
|
||||
PhysicalMin: LONG,
|
||||
PhysicalMax: LONG,
|
||||
using _: struct #raw_union {
|
||||
Range: struct {
|
||||
UsageMin: USAGE,
|
||||
UsageMax: USAGE,
|
||||
StringMin: USHORT,
|
||||
StringMax: USHORT,
|
||||
UsageMin: USAGE,
|
||||
UsageMax: USAGE,
|
||||
StringMin: USHORT,
|
||||
StringMax: USHORT,
|
||||
DesignatorMin: USHORT,
|
||||
DesignatorMax: USHORT,
|
||||
DataIndexMin: USHORT,
|
||||
DataIndexMax: USHORT,
|
||||
},
|
||||
DataIndexMin: USHORT,
|
||||
DataIndexMax: USHORT,
|
||||
} `raw_union_tag:"IsRange=true"`,
|
||||
NotRange: struct {
|
||||
Usage: USAGE,
|
||||
Reserved1: USAGE,
|
||||
StringIndex: USHORT,
|
||||
Reserved2: USHORT,
|
||||
Usage: USAGE,
|
||||
Reserved1: USAGE,
|
||||
StringIndex: USHORT,
|
||||
Reserved2: USHORT,
|
||||
DesignatorIndex: USHORT,
|
||||
Reserved3: USHORT,
|
||||
DataIndex: USHORT,
|
||||
Reserved4: USHORT,
|
||||
},
|
||||
Reserved3: USHORT,
|
||||
DataIndex: USHORT,
|
||||
Reserved4: USHORT,
|
||||
} `raw_union_tag:"IsRange=false"`,
|
||||
},
|
||||
}
|
||||
PHIDP_VALUE_CAPS :: ^HIDP_VALUE_CAPS
|
||||
|
||||
HIDP_DATA :: struct {
|
||||
DataIndex: USHORT,
|
||||
Reserved: USHORT,
|
||||
Reserved: USHORT,
|
||||
using _ : struct #raw_union {
|
||||
RawValue: ULONG,
|
||||
On: BOOLEAN,
|
||||
On: BOOLEAN,
|
||||
},
|
||||
}
|
||||
PHIDP_DATA :: ^HIDP_DATA
|
||||
|
||||
HIDP_LINK_COLLECTION_NODE :: struct {
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
Parent: USHORT,
|
||||
LinkUsage: USAGE,
|
||||
LinkUsagePage: USAGE,
|
||||
Parent: USHORT,
|
||||
NumberOfChildren: USHORT,
|
||||
NextSibling: USHORT,
|
||||
FirstChild: USHORT,
|
||||
CollectionType: [8]ULONG,
|
||||
IsAlias: [1]ULONG,
|
||||
Reserved: [23]ULONG,
|
||||
UserContext: PVOID,
|
||||
NextSibling: USHORT,
|
||||
FirstChild: USHORT,
|
||||
CollectionType: [8]ULONG,
|
||||
IsAlias: [1]ULONG,
|
||||
Reserved: [23]ULONG,
|
||||
UserContext: PVOID,
|
||||
}
|
||||
PHIDP_LINK_COLLECTION_NODE :: ^HIDP_LINK_COLLECTION_NODE
|
||||
|
||||
@@ -157,56 +157,56 @@ HIDP_REPORT_TYPE :: enum c_int {
|
||||
Feature,
|
||||
}
|
||||
|
||||
HIDP_STATUS_SUCCESS : NTSTATUS : 0x110000
|
||||
HIDP_STATUS_NULL : NTSTATUS : -2146369535 //0x80110001
|
||||
HIDP_STATUS_INVALID_PREPARSED_DATA : NTSTATUS : -1072627711 //0xC0110001
|
||||
HIDP_STATUS_INVALID_REPORT_TYPE : NTSTATUS : -1072627710 //0xC0110002
|
||||
HIDP_STATUS_INVALID_REPORT_LENGTH : NTSTATUS : -1072627709 //0xC0110003
|
||||
HIDP_STATUS_USAGE_NOT_FOUND : NTSTATUS : -1072627708 //0xC0110004
|
||||
HIDP_STATUS_VALUE_OUT_OF_RANGE : NTSTATUS : -1072627707 //0xC0110005
|
||||
HIDP_STATUS_BAD_LOG_PHY_VALUES : NTSTATUS : -1072627706 //0xC0100006
|
||||
HIDP_STATUS_BUFFER_TOO_SMALL : NTSTATUS : -1072627705 //0xC0110007
|
||||
HIDP_STATUS_INTERNAL_ERROR : NTSTATUS : -1072627704 //0xC0110008
|
||||
HIDP_STATUS_I8042_TRANS_UNKNOWN : NTSTATUS : -1072627703 //0xC0110009
|
||||
HIDP_STATUS_INCOMPATIBLE_REPORT_ID : NTSTATUS : -1072627702 //0xC011000A
|
||||
HIDP_STATUS_NOT_VALUE_ARRAY : NTSTATUS : -1072627701 //0xC011000B
|
||||
HIDP_STATUS_IS_VALUE_ARRAY : NTSTATUS : -1072627700 //0xC011000C
|
||||
HIDP_STATUS_DATA_INDEX_NOT_FOUND : NTSTATUS : -1072627699 //0xC011000D
|
||||
HIDP_STATUS_SUCCESS : NTSTATUS : 0x110000
|
||||
HIDP_STATUS_NULL : NTSTATUS : -2146369535 //0x80110001
|
||||
HIDP_STATUS_INVALID_PREPARSED_DATA : NTSTATUS : -1072627711 //0xC0110001
|
||||
HIDP_STATUS_INVALID_REPORT_TYPE : NTSTATUS : -1072627710 //0xC0110002
|
||||
HIDP_STATUS_INVALID_REPORT_LENGTH : NTSTATUS : -1072627709 //0xC0110003
|
||||
HIDP_STATUS_USAGE_NOT_FOUND : NTSTATUS : -1072627708 //0xC0110004
|
||||
HIDP_STATUS_VALUE_OUT_OF_RANGE : NTSTATUS : -1072627707 //0xC0110005
|
||||
HIDP_STATUS_BAD_LOG_PHY_VALUES : NTSTATUS : -1072627706 //0xC0100006
|
||||
HIDP_STATUS_BUFFER_TOO_SMALL : NTSTATUS : -1072627705 //0xC0110007
|
||||
HIDP_STATUS_INTERNAL_ERROR : NTSTATUS : -1072627704 //0xC0110008
|
||||
HIDP_STATUS_I8042_TRANS_UNKNOWN : NTSTATUS : -1072627703 //0xC0110009
|
||||
HIDP_STATUS_INCOMPATIBLE_REPORT_ID : NTSTATUS : -1072627702 //0xC011000A
|
||||
HIDP_STATUS_NOT_VALUE_ARRAY : NTSTATUS : -1072627701 //0xC011000B
|
||||
HIDP_STATUS_IS_VALUE_ARRAY : NTSTATUS : -1072627700 //0xC011000C
|
||||
HIDP_STATUS_DATA_INDEX_NOT_FOUND : NTSTATUS : -1072627699 //0xC011000D
|
||||
HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE : NTSTATUS : -1072627698 //0xC011000E
|
||||
HIDP_STATUS_BUTTON_NOT_PRESSED : NTSTATUS : -1072627697 //0xC011000F
|
||||
HIDP_STATUS_REPORT_DOES_NOT_EXIST : NTSTATUS : -1072627696 //0xC0110010
|
||||
HIDP_STATUS_NOT_IMPLEMENTED : NTSTATUS : -1072627680 //0xC0110020
|
||||
HIDP_STATUS_NOT_BUTTON_ARRAY : NTSTATUS : -1072627679 //0xC0110021
|
||||
HIDP_STATUS_BUTTON_NOT_PRESSED : NTSTATUS : -1072627697 //0xC011000F
|
||||
HIDP_STATUS_REPORT_DOES_NOT_EXIST : NTSTATUS : -1072627696 //0xC0110010
|
||||
HIDP_STATUS_NOT_IMPLEMENTED : NTSTATUS : -1072627680 //0xC0110020
|
||||
HIDP_STATUS_NOT_BUTTON_ARRAY : NTSTATUS : -1072627679 //0xC0110021
|
||||
HIDP_STATUS_I8242_TRANS_UNKNOWN :: HIDP_STATUS_I8042_TRANS_UNKNOWN
|
||||
|
||||
foreign import hid "system:hid.lib"
|
||||
@(default_calling_convention="system")
|
||||
foreign hid {
|
||||
HidP_GetCaps :: proc(PreparsedData: PHIDP_PREPARSED_DATA, Capabilities: PHIDP_CAPS) -> NTSTATUS ---
|
||||
HidP_GetButtonCaps :: proc(ReportType: HIDP_REPORT_TYPE, ButtonCaps: PHIDP_BUTTON_CAPS, ButtonCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS ---
|
||||
HidP_GetValueCaps :: proc(ReportType: HIDP_REPORT_TYPE, ValueCaps: PHIDP_VALUE_CAPS, ValueCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS ---
|
||||
HidP_GetUsages :: proc(ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT, UsageList: PUSAGE, UsageLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetUsageValue :: proc(ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT, Usage: USAGE, UsageValue: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetData :: proc(ReportType: HIDP_REPORT_TYPE, DataList: PHIDP_DATA, DataLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetCaps :: proc(PreparsedData: PHIDP_PREPARSED_DATA, Capabilities: PHIDP_CAPS) -> NTSTATUS ---
|
||||
HidP_GetButtonCaps :: proc(ReportType: HIDP_REPORT_TYPE, ButtonCaps: PHIDP_BUTTON_CAPS, ButtonCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS ---
|
||||
HidP_GetValueCaps :: proc(ReportType: HIDP_REPORT_TYPE, ValueCaps: PHIDP_VALUE_CAPS, ValueCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS ---
|
||||
HidP_GetUsages :: proc(ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT, UsageList: PUSAGE, UsageLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetUsageValue :: proc(ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT, Usage: USAGE, UsageValue: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetData :: proc(ReportType: HIDP_REPORT_TYPE, DataList: PHIDP_DATA, DataLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG) -> NTSTATUS ---
|
||||
HidP_GetLinkCollectionNodes :: proc(LinkCollectionNodes: PHIDP_LINK_COLLECTION_NODE, LinkCollectionNodesLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS ---
|
||||
|
||||
HidD_GetAttributes :: proc(HidDeviceObject: HANDLE, Attributes: PHIDD_ATTRIBUTES) -> BOOLEAN ---
|
||||
HidD_GetHidGuid :: proc(HidGuid: LPGUID) ---
|
||||
HidD_GetPreparsedData :: proc(HidDeviceObject: HANDLE, PreparsedData: ^PHIDP_PREPARSED_DATA) -> BOOLEAN ---
|
||||
HidD_FreePreparsedData :: proc(PreparsedData: PHIDP_PREPARSED_DATA) -> BOOLEAN ---
|
||||
HidD_FlushQueue :: proc(HidDeviceObject: HANDLE) -> BOOLEAN ---
|
||||
HidD_GetConfiguration :: proc(HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetConfiguration :: proc(HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetFeature :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetFeature :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetInputReport :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetOutputReport :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetNumInputBuffers :: proc(HidDeviceObject: HANDLE, NumberBuffers: PULONG) -> BOOLEAN ---
|
||||
HidD_SetNumInputBuffers :: proc(HidDeviceObject: HANDLE, NumberBuffers: ULONG) -> BOOLEAN ---
|
||||
HidD_GetAttributes :: proc(HidDeviceObject: HANDLE, Attributes: PHIDD_ATTRIBUTES) -> BOOLEAN ---
|
||||
HidD_GetHidGuid :: proc(HidGuid: LPGUID) ---
|
||||
HidD_GetPreparsedData :: proc(HidDeviceObject: HANDLE, PreparsedData: ^PHIDP_PREPARSED_DATA) -> BOOLEAN ---
|
||||
HidD_FreePreparsedData :: proc(PreparsedData: PHIDP_PREPARSED_DATA) -> BOOLEAN ---
|
||||
HidD_FlushQueue :: proc(HidDeviceObject: HANDLE) -> BOOLEAN ---
|
||||
HidD_GetConfiguration :: proc(HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetConfiguration :: proc(HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetFeature :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetFeature :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetInputReport :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_SetOutputReport :: proc(HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetNumInputBuffers :: proc(HidDeviceObject: HANDLE, NumberBuffers: PULONG) -> BOOLEAN ---
|
||||
HidD_SetNumInputBuffers :: proc(HidDeviceObject: HANDLE, NumberBuffers: ULONG) -> BOOLEAN ---
|
||||
HidD_GetPhysicalDescriptor :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetManufacturerString :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetProductString :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetIndexedString :: proc(HidDeviceObject: HANDLE, StringIndex: ULONG, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetProductString :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetIndexedString :: proc(HidDeviceObject: HANDLE, StringIndex: ULONG, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetSerialNumberString :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetMsGenreDescriptor :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
HidD_GetMsGenreDescriptor :: proc(HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG) -> BOOLEAN ---
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@ UError :: enum i32 {
|
||||
@(default_calling_convention="system")
|
||||
foreign icu {
|
||||
ucal_getWindowsTimeZoneID :: proc(id: wstring, len: i32, winid: wstring, winidCapacity: i32, status: ^UError) -> i32 ---
|
||||
ucal_getDefaultTimeZone :: proc(result: wstring, cap: i32, status: ^UError) -> i32 ---
|
||||
ucal_getDefaultTimeZone :: proc(result: wstring, cap: i32, status: ^UError) -> i32 ---
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ foreign iphlpapi {
|
||||
The GetAdaptersAddresses function retrieves the addresses associated with the adapters on the local computer.
|
||||
See: https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses
|
||||
*/
|
||||
@(link_name="GetAdaptersAddresses") get_adapters_addresses :: proc(
|
||||
GetAdaptersAddresses :: proc(
|
||||
family: Address_Family,
|
||||
flags: GAA_Flags,
|
||||
_reserved: rawptr,
|
||||
@@ -232,3 +232,5 @@ foreign iphlpapi {
|
||||
) -> ULONG ---
|
||||
|
||||
}
|
||||
|
||||
get_adapters_addresses :: GetAdaptersAddresses
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user