windows.nim compiles again; thanks for fucking it up

This commit is contained in:
Andreas Rumpf 2010-08-12 07:38:31 +02:00
commit 38257af9f6

View file

@ -377,9 +377,9 @@ type
MakeIntResourceW* = PWideChar MakeIntResourceW* = PWideChar
MakeIntResource* = MakeIntResourceA MakeIntResource* = MakeIntResourceA
# #
# Definitions for callback procedures # Definitions for callback procedures
# #
type type
BFFCALLBACK* = proc (para1: HWND, para2: UINT, para3: LPARAM, para4: LPARAM): int32{. BFFCALLBACK* = proc (para1: HWND, para2: UINT, para3: LPARAM, para4: LPARAM): int32{.
stdcall.} stdcall.}
@ -458,14 +458,6 @@ type
stdcall.} stdcall.}
PFNPROCESSPOLICIES* = proc (para1: HWND, para2: LPCTSTR, para3: LPCTSTR, PFNPROCESSPOLICIES* = proc (para1: HWND, para2: LPCTSTR, para3: LPCTSTR,
para4: LPCTSTR, para5: DWORD): WINBOOL{.stdcall.} para4: LPCTSTR, para5: DWORD): WINBOOL{.stdcall.}
#Not convertable by H2PAS
# #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
# #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
# #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
# #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
# #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
# #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
#
const const
SE_CREATE_TOKEN_NAME* = "SeCreateTokenPrivilege" SE_CREATE_TOKEN_NAME* = "SeCreateTokenPrivilege"
@ -3704,6 +3696,7 @@ const
EVENTLOG_WARNING_TYPE* = 2 EVENTLOG_WARNING_TYPE* = 2
EVENTLOG_INFORMATION_TYPE* = 4 EVENTLOG_INFORMATION_TYPE* = 4
EVENTLOG_AUDIT_SUCCESS* = 8 EVENTLOG_AUDIT_SUCCESS* = 8
EVENTLOG_AUDIT_FAILURE* = 16 EVENTLOG_AUDIT_FAILURE* = 16
# RedrawWindow # RedrawWindow
RDW_ERASE* = 4 RDW_ERASE* = 4
@ -5707,7 +5700,6 @@ const
SORT_HUNGARIAN_TECHNICAL* = 0x00000001 # Hungarian Technical order SORT_HUNGARIAN_TECHNICAL* = 0x00000001 # Hungarian Technical order
SORT_GEORGIAN_TRADITIONAL* = 0x00000000 # Georgian Traditional order SORT_GEORGIAN_TRADITIONAL* = 0x00000000 # Georgian Traditional order
SORT_GEORGIAN_MODERN* = 0x00000001 # Georgian Modern order SORT_GEORGIAN_MODERN* = 0x00000001 # Georgian Modern order
# SYSTEM_INFO structure # SYSTEM_INFO structure
PROCESSOR_INTEL_386* = 386 PROCESSOR_INTEL_386* = 386
PROCESSOR_INTEL_486* = 486 PROCESSOR_INTEL_486* = 486
@ -6241,6 +6233,7 @@ const
HTMENU* = 5 HTMENU* = 5
HTNOWHERE* = 0 HTNOWHERE* = 0
HTREDUCE* = 8 HTREDUCE* = 8
HTRIGHT* = 11 HTRIGHT* = 11
HTSIZE* = 4 HTSIZE* = 4
HTSYSMENU* = 3 HTSYSMENU* = 3
@ -6565,9 +6558,9 @@ const
C3_LEXICAL* = 1024 C3_LEXICAL* = 1024
# --------------------- old stuff, need to organize! --------------- # --------------------- old stuff, need to organize! ---------------
# BEGINNING of windowsx.h stuff from old headers: # BEGINNING of windowsx.h stuff from old headers:
# was #define dname(params) def_expr # was #define dname(params) def_expr
proc GetFirstChild*(h: HWND): HWND proc GetFirstChild*(h: HWND): HWND
# was #define dname(params) def_expr # was #define dname(params) def_expr
proc GetNextSibling*(h: HWND): HWND proc GetNextSibling*(h: HWND): HWND
@ -6629,44 +6622,6 @@ proc GET_WM_VSCROLL_HWND*(w, L: int32): HWND
proc GET_WM_VSCROLL_POS*(w, L: int32): int32 proc GET_WM_VSCROLL_POS*(w, L: int32): int32
# return type might be wrong # return type might be wrong
# Not convertable by H2PAS # Not convertable by H2PAS
# #define FORWARD_WM_CLOSE(h, fn) CRACK_VOID_F(fn,(h, WM_CLOSE, 0, 0))
# #define FORWARD_WM_COMMAND(h, id, c, n, fn) CRACK_VOID_F(fn,(h, WM_COMMAND, MAKEWPARAM(id,n), (LPARAM)c))
# #define FORWARD_WM_CREATE(h, p, fn) CRACK_BOOL_F(fn,(h, WM_CREATE, 0, (LPARAM)p))
# #define FORWARD_WM_DESTROY(h, fn) CRACK_VOID_F(fn,(h, WM_DESTROY, 0, 0))
# #define FORWARD_WM_ENABLE(h, e, fn) CRACK_VOID_F(fn,(h, WM_ENABLE, (WPARAM)e, 0))
# #define FORWARD_WM_INITDIALOG(h, c, L, fn) CRACK_BOOL_F(fn,(h, WM_INITDIALOG, (WPARAM)c, L))
# #define FORWARD_WM_MDICASCADE(h, c, fn) CRACK_BOOL_F(fn,(h, WM_MDICASCADE, (WPARAM)c, 0))
# #define FORWARD_WM_MDIDESTROY(h, d, fn) CRACK_VOID_F(fn,(h, WM_MDIDESTROY, (WPARAM)d, 0))
# #define FORWARD_WM_MDIGETACTIVE(h, fn) CRACK_HWND_F(fn,(h, WM_MDIGETACTIVE, 0, 0))
# #define FORWARD_WM_MDIICONARRANGE(h, fn) CRACK_VOID_F(fn,(h, WM_MDIICONARRANGE, 0, 0))
# #define FORWARD_WM_MDISETMENU(h, fr, hf, hw, fn) CRACK_HMENU_F(fn,(h, WM_MDISETMENU, (WPARAM)((fr) ? (hf) : 0), (LPARAM)(hw)))
# #define FORWARD_WM_MDITILE(h, c, fn) CRACK_BOOL_F(fn,(h, WM_MDITILE, (WPARAM)(c), 0))
# #define FORWARD_WM_PAINT(h, fn) CRACK_VOID_F(fn,(h, WM_PAINT, 0, 0))
# #define FORWARD_WM_QUERYENDSESSION(h, fn) CRACK_BOOL_F(fn,(h, WM_QUERYENDSESSION, 0, 0))
# #define FORWARD_WM_SIZE(h, state, cx, cy, fn) CRACK_VOID_F(fn,(h, WM_SIZE, (WPARAM)state, MAKELPARAM(cx, cy)))
# #define FORWARD_WM_SYSCOMMAND(h, c, x, y, fn) CRACK_VOID_F(fn,(h, WM_SYSCOMMAND, (WPARAM)c, MAKELPARAM(x, y)))
#
# #define HANDLE_WM_CLOSE(h, w, L, fn) CRACK_ZERO_F(fn,(h));
# #define HANDLE_WM_COMMAND(h, w, L, fn) CRACK_ZERO_F(fn,(h, SEXT_LOWORD(w), (HWND)L, HIWORD(w)))
# #define HANDLE_WM_CREATE(h, w, L, fn) (LRESULT)((fn(h, (CREATESTRUCT )L)) ? 0 : -1)
# #define HANDLE_WM_DESTROY(h, w, L, fn) CRACK_ZERO_F(fn,(h))
# #define HANDLE_WM_ENABLE(h, w, L, fn) CRACK_ZERO_F(fn,(h, (WINBOOL)w))
# #define HANDLE_WM_INITDIALOG(h, w, L, fn) CRACK_LONG_F(fn,(h, (HWND)w, L))
# #define HANDLE_WM_MDICASCADE(h, w, L, fn) CRACK_LONG_F(fn, (h, (UINT)w)
# #define HANDLE_WM_MDIDESTROY(h, w, L, fn) CRACK_ZERO_F(fn,(h, (HWND)w))
# #define HANDLE_WM_MDIGETACTIVE(h, w, L, fn) CRACK_LONG_F(fn,(h))
# #define HANDLE_WM_MDIICONARRANGE(h, w, L, fn) CRACK_ZERO_F(fn,(h))
# #define HANDLE_WM_MDISETMENU(h, w, L, fn) CRACK_LONG_F(fn,(h, (WINBOOL)w, (HMENU)w, (HMENU)L)
# #define HANDLE_WM_MDITILE(h, w, L, fn) CRACK_LONG_F(fn,(h, (UINT)w))
# #define HANDLE_WM_PAINT(h, w, L, fn) CRACK_ZERO_F(fn,(h))
# #define HANDLE_WM_QUERYENDSESSION(h, w, L, fn) MAKELRESULT(fn(h), 0)
# #define HANDLE_WM_SIZE(h, w, L, fn) CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(L), SEXT_HIWORD(L)))
# #define HANDLE_WM_SYSCOMMAND(h, w, L, fn) CRACK_ZERO_F(fn,(h, (UINT)w, SEXT_LOWORD(L), SEXT_HIWORD(L)))
#
# Totally disgusting! get wParam and lParam from the environment !
# Not convertable by H2PAS
# #define HANDLE_MSG(h, message, fn) case message: return HANDLE_##message(h, wParam, lParam, fn)
#
# END OF windowsx.h stuff from old headers # END OF windowsx.h stuff from old headers
# ------------------------------------------------------------------ # ------------------------------------------------------------------
@ -6849,8 +6804,7 @@ const
LOGON32_PROVIDER_DEFAULT* = 0x00000000 LOGON32_PROVIDER_DEFAULT* = 0x00000000
LOGON32_PROVIDER_WINNT35* = 0x00000001 LOGON32_PROVIDER_WINNT35* = 0x00000001
QID_SYNC* = 0xFFFFFFFF QID_SYNC* = 0xFFFFFFFF
# Magic numbers in PE executable header. # Magic numbers in PE executable header. # e_magic field
# e_magic field
IMAGE_DOS_SIGNATURE* = 0x00005A4D IMAGE_DOS_SIGNATURE* = 0x00005A4D
# nt_signature field # nt_signature field
IMAGE_NT_SIGNATURE* = 0x00004550 IMAGE_NT_SIGNATURE* = 0x00004550
@ -7735,11 +7689,7 @@ when defined(x86_64):
High*: LONGLONG High*: LONGLONG
TM128A* = M128A TM128A* = M128A
PM128A* = TM128A # PM128A* = TM128A #typedef struct _XMM_SAVE_AREA32 {
type
# Format of data for 32-bit fxsave/fxrstor instructions.
#
#typedef struct _XMM_SAVE_AREA32 {
XMM_SAVE_AREA32* {.final, pure.} = object XMM_SAVE_AREA32* {.final, pure.} = object
ControlWord*: int16 ControlWord*: int16
StatusWord*: int16 StatusWord*: int16
@ -8052,21 +8002,7 @@ type
TCREATETHREADDEBUGINFO* = CREATE_THREAD_DEBUG_INFO TCREATETHREADDEBUGINFO* = CREATE_THREAD_DEBUG_INFO
PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO PCREATETHREADDEBUGINFO* = ptr CREATE_THREAD_DEBUG_INFO
#
# TODO: sockets
# typedef struct _SOCKET_ADDRESS {
# LPSOCKADDR lpSockaddr ;
# INT iSockaddrLength ;
# } SOCKET_ADDRESS, PSOCKET_ADDRESS, LPSOCKET_ADDRESS;
# }
# {
# typedef struct _CSADDR_INFO {
# SOCKET_ADDRESS LocalAddr;
# SOCKET_ADDRESS RemoteAddr;
# INT iSocketType;
# INT iProtocol;
# } CSADDR_INFO;
#
CURRENCYFMT* {.final, pure.} = object CURRENCYFMT* {.final, pure.} = object
NumDigits*: UINT NumDigits*: UINT
LeadingZero*: UINT LeadingZero*: UINT
@ -8370,17 +8306,7 @@ type
dwDebugEventCode*: DWORD dwDebugEventCode*: DWORD
dwProcessId*: DWORD dwProcessId*: DWORD
dwThreadId*: DWORD dwThreadId*: DWORD
data*: array[0..15, DWORD] # data*: array[0..15, DWORD]
# case longint of
# 0 : ( Exception : EXCEPTION_DEBUG_INFO );
# 1 : ( CreateThread : CREATE_THREAD_DEBUG_INFO );
# 2 : ( CreateProcessInfo : CREATE_PROCESS_DEBUG_INFO );
# 3 : ( ExitThread : EXIT_THREAD_DEBUG_INFO );
# 4 : ( ExitProcess : EXIT_PROCESS_DEBUG_INFO );
# 5 : ( LoadDll : LOAD_DLL_DEBUG_INFO );
# 6 : ( UnloadDll : UNLOAD_DLL_DEBUG_INFO );
# 7 : ( DebugString : OUTPUT_DEBUG_STRING_INFO );
# 8 : ( RipInfo : RIP_INFO );
LPDEBUG_EVENT* = ptr DEBUG_EVENT LPDEBUG_EVENT* = ptr DEBUG_EVENT
TDEBUGEVENT* = DEBUG_EVENT TDEBUGEVENT* = DEBUG_EVENT
@ -9932,22 +9858,7 @@ type
INPUT_RECORD* {.final, pure.} = object INPUT_RECORD* {.final, pure.} = object
EventType*: int16 EventType*: int16
Reserved*: int16 Reserved*: int16
event*: array[0..5, DWORD] #Event : record case longint of event*: array[0..5, DWORD]
# 0 : ( KeyEvent : KEY_EVENT_RECORD );
# 1 : ( MouseEvent : MOUSE_EVENT_RECORD );
# 2 : ( WindowBufferSizeEvent : WINDOW_BUFFER_SIZE_RECORD );
# 3 : ( MenuEvent : MENU_EVENT_RECORD );
# 4 : ( FocusEvent : FOCUS_EVENT_RECORD );
# end;
Event*: array[0..5, DWORD]
#union {
# KEY_EVENT_RECORD KeyEvent;
# MOUSE_EVENT_RECORD MouseEvent;
# WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
# MENU_EVENT_RECORD MenuEvent;
# FOCUS_EVENT_RECORD FocusEvent;
#} Event;
Event*: array[0..5, DWORD] # union of KEY_EVENT_RECORD, MOUSE_EVENT_RECORD, WINDOW_BUFFER_SIZE_RECORD, MENU_EVENT_RECORD, FOCUS_EVENT_RECORD
PINPUT_RECORD* = ptr INPUT_RECORD PINPUT_RECORD* = ptr INPUT_RECORD
TINPUTRECORD* = INPUT_RECORD TINPUTRECORD* = INPUT_RECORD
@ -11445,21 +11356,7 @@ type
TREMOTENAMEINFO* = REMOTE_NAME_INFO TREMOTENAMEINFO* = REMOTE_NAME_INFO
PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO PREMOTENAMEINFO* = ptr REMOTE_NAME_INFO
#
# TODO: OLE
# typedef struct _reobject {
# DWORD cbStruct;
# LONG cp;
# CLSID clsid;
# LPOLEOBJECT poleobj;
# LPSTORAGE pstg;
# LPOLECLIENTSITE polesite;
# SIZEL sizel;
# DWORD dvaspect;
# DWORD dwFlags;
# DWORD dwUser;
# } REOBJECT;
#
REPASTESPECIAL* {.final, pure.} = object REPASTESPECIAL* {.final, pure.} = object
dwAspect*: DWORD dwAspect*: DWORD
dwParam*: DWORD dwParam*: DWORD
@ -14201,6 +14098,7 @@ proc GetPrivateProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR,
lpDefault: LPCSTR, lpReturnedString: LPSTR, lpDefault: LPCSTR, lpReturnedString: LPSTR,
nSize: DWORD, lpFileName: LPCSTR): DWORD{. nSize: DWORD, lpFileName: LPCSTR): DWORD{.
stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringA".} stdcall, dynlib: "kernel32", importc: "GetPrivateProfileStringA".}
proc WritePrivateProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR, proc WritePrivateProfileStringA*(lpAppName: LPCSTR, lpKeyName: LPCSTR,
lpString: LPCSTR, lpFileName: LPCSTR): WINBOOL{. lpString: LPCSTR, lpFileName: LPCSTR): WINBOOL{.
stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringA".} stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStringA".}
@ -17865,6 +17763,7 @@ else:
dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32", dwInitParam: LPARAM): HWND{.stdcall, dynlib: "user32",
importc: "CreateDialogParamA".} importc: "CreateDialogParamA".}
proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE, proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,
hWndParent: HWND, lpDialogFunc: DLGPROC, hWndParent: HWND, lpDialogFunc: DLGPROC,
dwInitParam: LPARAM): HWND{.stdcall, dwInitParam: LPARAM): HWND{.stdcall,
dynlib: "user32", importc: "CreateDialogIndirectParamA".} dynlib: "user32", importc: "CreateDialogIndirectParamA".}
@ -23709,9 +23608,6 @@ proc ListView_SetItemState(hwndLV: HWND, i, data, mask: int32): LRESULT =
result = SendMessage(hwndLV, LVM_SETITEMSTATE, WPARAM(i), result = SendMessage(hwndLV, LVM_SETITEMSTATE, WPARAM(i),
cast[LPARAM](addr(gnu_lvi))) cast[LPARAM](addr(gnu_lvi)))
proc ListView_SetItemText(hwndLV: HWND, i, iSubItem_: int32, pszText_: LPTSTR): LRESULT =
proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32,
pszText: LPTSTR): LRESULT =
proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT = proc ListView_SetItemText(hwndLV: HWND, i, iSubItem: int32, pszText: LPTSTR): LRESULT =
var gnu_lvi: LV_ITEM var gnu_lvi: LV_ITEM
gnu_lvi.iSubItem = iSubItem gnu_lvi.iSubItem = iSubItem