summary refs log tree commit diff stats
path: root/lib/windows
diff options
context:
space:
mode:
Diffstat (limited to 'lib/windows')
-rw-r--r--lib/windows/mmsystem.nim593
-rw-r--r--lib/windows/nb30.nim80
-rw-r--r--lib/windows/psapi.nim2
-rw-r--r--lib/windows/shellapi.nim248
-rw-r--r--lib/windows/shfolder.nim2
-rw-r--r--lib/windows/windows.nim460
-rw-r--r--lib/windows/winlean.nim189
7 files changed, 794 insertions, 780 deletions
diff --git a/lib/windows/mmsystem.nim b/lib/windows/mmsystem.nim
index 91279a5ef..45613d8e2 100644
--- a/lib/windows/mmsystem.nim
+++ b/lib/windows/mmsystem.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2006 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
@@ -27,15 +27,15 @@ import
   windows
 
 type
-  MMRESULT* = UINT
-  MMVERSION* = UINT
+  MMRESULT* = uint32
+  MMVERSION* = uint32
   HWAVEOUT* = THandle
   LPHWAVEOUT* = ptr HWAVEOUT
   HWAVEIN* = THandle
   LPHWAVEIN* = ptr HWAVEOUT
   HWAVE* = THandle
   LPHWAVE* = ptr THandle
-  LPUINT* = ptr UINT
+  LPUINT* = ptr uint32
 
 const
   MAXPNAMELEN* = 32
@@ -178,18 +178,18 @@ const
   DRV_MCI_LAST* = (DRV_RESERVED + 0x00000FFF)
 
 type
-  PDRVCALLBACK* = proc (hdrvr: tHandle, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+  PDRVCALLBACK* = proc (hdrvr: THandle, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
       stdcall.}
 
-proc sndPlaySoundA*(Name: LPCSTR, flags: UINT): BOOL{.stdcall,
+proc sndPlaySoundA*(Name: LPCSTR, flags: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "sndPlaySoundA".}
-proc sndPlaySoundW*(Name: LPCWSTR, flags: UINT): BOOL{.stdcall,
+proc sndPlaySoundW*(Name: LPCWSTR, flags: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "sndPlaySoundW".}
 when defined(winUNICODE):
-  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
+  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
       dynlib: "winmm.dll", importc: "sndPlaySoundW".}
 else:
-  proc sndPlaySound*(Name: cstring, flags: UINT): BOOL{.stdcall,
+  proc sndPlaySound*(Name: cstring, flags: uint32): bool{.stdcall,
       dynlib: "winmm.dll", importc: "sndPlaySoundA".}
 const
   SND_NODEFAULT* = 2
@@ -225,12 +225,12 @@ const
   WIM_OPEN* = MM_WIM_OPEN
   WIM_CLOSE* = MM_WIM_CLOSE
   WIM_DATA* = MM_WIM_DATA
-  WAVE_MAPPER* = UINT(- 1)
+  WAVE_MAPPER* = uint32(- 1)
   WAVE_FORMAT_QUERY* = 1
   WAVE_ALLOWSYNC* = 2
   WAVE_MAPPED* = 4
   WAVE_FORMAT_DIRECT* = 8
-  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY Or WAVE_FORMAT_DIRECT)
+  WAVE_FORMAT_DIRECT_QUERY* = (WAVE_FORMAT_QUERY or WAVE_FORMAT_DIRECT)
   MIM_OPEN* = MM_MIM_OPEN
   MIM_CLOSE* = MM_MIM_CLOSE
   MIM_DATA* = MM_MIM_DATA
@@ -242,7 +242,7 @@ const
   MOM_DONE* = MM_MOM_DONE
   MIM_MOREDATA* = MM_MIM_MOREDATA
   MOM_POSITIONCB* = MM_MOM_POSITIONCB
-  MIDIMAPPER* = UINT(- 1)
+  MIDIMAPPER* = uint32(- 1)
   MIDI_IO_STATUS* = 32
   MIDI_CACHE_ALL* = 1
   MIDI_CACHE_BESTFIT* = 2
@@ -364,53 +364,53 @@ const
   MIXERCONTROL_CT_UNITS_DECIBELS* = 0x00040000
   MIXERCONTROL_CT_UNITS_PERCENT* = 0x00050000
   MIXERCONTROL_CONTROLTYPE_CUSTOM* = (
-    MIXERCONTROL_CT_CLASS_CUSTOM Or MIXERCONTROL_CT_UNITS_CUSTOM)
-  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_BOOLEAN)
-  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_CUSTOM or MIXERCONTROL_CT_UNITS_CUSTOM)
+  MIXERCONTROL_CONTROLTYPE_BOOLEANMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_SIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_PEAKMETER* = (
     MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
-  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER Or
-      MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH Or
-      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER* = (MIXERCONTROL_CT_CLASS_METER or
+      MIXERCONTROL_CT_SC_METER_POLLED or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_BOOLEAN* = (MIXERCONTROL_CT_CLASS_SWITCH or
+      MIXERCONTROL_CT_SC_SWITCH_BOOLEAN or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_ONOFF* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
   MIXERCONTROL_CONTROLTYPE_MUTE* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
   MIXERCONTROL_CONTROLTYPE_MONO* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
   MIXERCONTROL_CONTROLTYPE_LOUDNESS* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
   MIXERCONTROL_CONTROLTYPE_STEREOENH* = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
-  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH Or
-      MIXERCONTROL_CT_SC_SWITCH_BUTTON Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_BUTTON* = (MIXERCONTROL_CT_CLASS_SWITCH or
+      MIXERCONTROL_CT_SC_SWITCH_BUTTON or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_DECIBELS* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_DECIBELS)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_DECIBELS)
   MIXERCONTROL_CONTROLTYPE_SIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_UNSIGNED* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXERCONTROL_CONTROLTYPE_PERCENT* = (
-    MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_PERCENT)
+    MIXERCONTROL_CT_CLASS_NUMBER or MIXERCONTROL_CT_UNITS_PERCENT)
   MIXERCONTROL_CONTROLTYPE_SLIDER* = (
-    MIXERCONTROL_CT_CLASS_SLIDER Or MIXERCONTROL_CT_UNITS_SIGNED)
+    MIXERCONTROL_CT_CLASS_SLIDER or MIXERCONTROL_CT_UNITS_SIGNED)
   MIXERCONTROL_CONTROLTYPE_PAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
   MIXERCONTROL_CONTROLTYPE_QSOUNDPAN* = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
   MIXERCONTROL_CONTROLTYPE_FADER* = (
-    MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+    MIXERCONTROL_CT_CLASS_FADER or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXERCONTROL_CONTROLTYPE_VOLUME* = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
   MIXERCONTROL_CONTROLTYPE_BASS* = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
   MIXERCONTROL_CONTROLTYPE_TREBLE* = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
   MIXERCONTROL_CONTROLTYPE_EQUALIZER* = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
-  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
-      MIXERCONTROL_CT_SC_LIST_SINGLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_SINGLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
+      MIXERCONTROL_CT_SC_LIST_SINGLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_MUX* = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
-  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST Or
-      MIXERCONTROL_CT_SC_LIST_MULTIPLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
+  MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT* = (MIXERCONTROL_CT_CLASS_LIST or
+      MIXERCONTROL_CT_SC_LIST_MULTIPLE or MIXERCONTROL_CT_UNITS_BOOLEAN)
   MIXERCONTROL_CONTROLTYPE_MIXER* = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT +
       1)
-  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME Or
-      MIXERCONTROL_CT_SC_TIME_MICROSECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
-  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME Or
-      MIXERCONTROL_CT_SC_TIME_MILLISECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_MICROTIME* = (MIXERCONTROL_CT_CLASS_TIME or
+      MIXERCONTROL_CT_SC_TIME_MICROSECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
+  MIXERCONTROL_CONTROLTYPE_MILLITIME* = (MIXERCONTROL_CT_CLASS_TIME or
+      MIXERCONTROL_CT_SC_TIME_MILLISECS or MIXERCONTROL_CT_UNITS_UNSIGNED)
   MIXER_SHORT_NAME_CHARS* = 16
   MIXER_LONG_NAME_CHARS* = 64
   MIXERR_INVALLINE* = (MIXERR_BASE + 0)
@@ -419,15 +419,15 @@ const
   MIXERR_LASTERROR* = (MIXERR_BASE + 2)
   MIXER_OBJECTF_HANDLE* = 0x80000000
   MIXER_OBJECTF_MIXER* = 0
-  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)
+  MIXER_OBJECTF_HMIXER* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIXER)
   MIXER_OBJECTF_WAVEOUT* = 0x10000000
-  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)
+  MIXER_OBJECTF_HWAVEOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEOUT)
   MIXER_OBJECTF_WAVEIN* = 0x20000000
-  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)
+  MIXER_OBJECTF_HWAVEIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_WAVEIN)
   MIXER_OBJECTF_MIDIOUT* = 0x30000000
-  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)
+  MIXER_OBJECTF_HMIDIOUT* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIOUT)
   MIXER_OBJECTF_MIDIIN* = 0x40000000
-  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN)
+  MIXER_OBJECTF_HMIDIIN* = (MIXER_OBJECTF_HANDLE or MIXER_OBJECTF_MIDIIN)
   MIXER_OBJECTF_AUX* = 0x50000000
   MIXER_GETCONTROLDETAILSF_VALUE* = 0
   MIXER_GETCONTROLDETAILSF_LISTTEXT* = 1
@@ -492,8 +492,8 @@ const
   JOY_RETURNPOVCTS* = 512
   JOY_RETURNCENTERED* = 0x00000400
   JOY_USEDEADZONE* = 0x00000800
-  JOY_RETURNALL* = (JOY_RETURNX Or JOY_RETURNY Or JOY_RETURNZ Or JOY_RETURNR Or
-      JOY_RETURNU Or JOY_RETURNV Or JOY_RETURNPOV Or JOY_RETURNBUTTONS)
+  JOY_RETURNALL* = (JOY_RETURNX or JOY_RETURNY or JOY_RETURNZ or JOY_RETURNR or
+      JOY_RETURNU or JOY_RETURNV or JOY_RETURNPOV or JOY_RETURNBUTTONS)
   JOY_CAL_READALWAYS* = 0x00010000
   JOY_CAL_READXYONLY* = 0x00020000
   JOY_CAL_READ3* = 0x00040000
@@ -982,17 +982,17 @@ const
                         #/////////////////////////////////////////////////////////
 
 type
-  mmtime* {.final.} = object
-    wType*: UINT
+  MMTIME* {.final.} = object
+    wType*: uint32
     hour*, min*, sec*, frame*, fps*, dummy*: int8
     pad*: array[0..1, int8]
 
-  PMMTIME* = ptr mmtime
-  NPMMTIME* = ptr mmtime
-  LPMMTIME* = ptr mmtime
-  PWAVEHDR* = ptr wavehdr
-  TMMTime* = mmtime
-  wavehdr* {.final.} = object
+  PMMTIME* = ptr MMTIME
+  NPMMTIME* = ptr MMTIME
+  LPMMTIME* = ptr MMTIME
+  PWAVEHDR* = ptr WAVEHDR
+  TMMTime* = MMTIME
+  WAVEHDR* {.final.} = object
     lpData*: cstring
     dwBufferLength*: DWORD
     dwBytesRecorded*: DWORD
@@ -1003,13 +1003,13 @@ type
     reserved*: DWORD
 
   TWAVEHDR* = WAVEHDR
-  NPWAVEHDR* = ptr wavehdr
-  LPWAVEHDR* = ptr wavehdr
+  NPWAVEHDR* = ptr WAVEHDR
+  LPWAVEHDR* = ptr WAVEHDR
   WAVEOUTCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1023,7 +1023,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1052,7 +1052,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1065,7 +1065,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
     dwFormats*: DWORD
     wChannels*: int16
     wReserved1*: int16
@@ -1089,29 +1089,29 @@ else:
     LPWAVEINCAPS* = LPWAVEINCAPSA
 type
   TWAVEINCAPS* = WAVEINCAPS
-  waveformat* {.final.} = object
+  WAVEFORMAT* {.final.} = object
     wFormatTag*: int16
     nChannels*: int16
     nSamplesPerSec*: DWORD
     nAvgBytesPerSec*: DWORD
     nBlockAlign*: int16
 
-  PWAVEFORMAT* = ptr waveformat
-  NPWAVEFORMAT* = ptr waveformat
-  LPWAVEFORMAT* = ptr waveformat
-  TWAVEFORMAT* = waveformat
+  PWAVEFORMAT* = ptr WAVEFORMAT
+  NPWAVEFORMAT* = ptr WAVEFORMAT
+  LPWAVEFORMAT* = ptr WAVEFORMAT
+  TWAVEFORMAT* = WAVEFORMAT
 
 const
   WAVE_FORMAT_PCM* = 1
 
 type
-  pcmwaveformat* {.final.} = object
+  PCMWAVEFORMAT* {.final.} = object
     wf*: WAVEFORMAT
     wBitsPerSample*: int16
 
-  PPCMWAVEFORMAT* = ptr pcmwaveformat
-  NPPCMWAVEFORMAT* = ptr pcmwaveformat
-  LPPCMWAVEFORMAT* = ptr pcmwaveformat
+  PPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
+  NPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
+  LPPCMWAVEFORMAT* = ptr PCMWAVEFORMAT
   TPCMWAVEFORMAT* = PCMWAVEFORMAT
   WAVEFORMATEX* {.final.} = object
     wFormatTag*: int16
@@ -1141,15 +1141,15 @@ const
   MIDIPATCHSIZE* = 128
 
 type
-  PATCHARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
+  PATCHARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
   LPPATCHARRAY* = ptr int16
-  KEYARRAY* = array[0..Pred(MIDIPATCHSIZE), int16]
+  KEYARRAY* = array[0..pred(MIDIPATCHSIZE), int16]
   LPKEYARRAY* = ptr int16
   MIDIOUTCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     wTechnology*: int16
     wVoices*: int16
     wNotes*: int16
@@ -1164,7 +1164,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     wTechnology*: int16
     wVoices*: int16
     wNotes*: int16
@@ -1179,7 +1179,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     dwSupport*: DWORD
 
   PMIDIINCAPSA* = ptr MIDIINCAPSA
@@ -1190,7 +1190,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     dwSupport*: DWORD
 
   PMIDIINCAPSW* = ptr MIDIINCAPSW
@@ -1220,8 +1220,8 @@ else:
     LPMIDIINCAPS* = LPMIDIINCAPSA
 type
   TMIDIINCAPS* = MIDIINCAPS
-  PMIDIHDR* = ptr midihdr
-  midihdr* {.final.} = object
+  PMIDIHDR* = ptr MIDIHDR
+  MIDIHDR* {.final.} = object
     lpData*: cstring
     dwBufferLength*: DWORD
     dwBytesRecorded*: DWORD
@@ -1230,19 +1230,19 @@ type
     lpNext*: PMIDIHDR
     reserved*: DWORD
     dwOffset*: DWORD
-    dwReserved*: array[0..Pred(8), DWORD]
+    dwReserved*: array[0..pred(8), DWORD]
 
-  NPMIDIHDR* = ptr midihdr
-  LPMIDIHDR* = ptr midihdr
+  NPMIDIHDR* = ptr MIDIHDR
+  LPMIDIHDR* = ptr MIDIHDR
   TMIDIHDR* = MIDIHDR
-  midievent* {.final.} = object
+  MIDIEVENT* {.final.} = object
     dwDeltaTime*: DWORD
     dwStreamID*: DWORD
     dwEvent*: DWORD
-    dwParms*: array[0..Pred(1), DWORD]
+    dwParms*: array[0..pred(1), DWORD]
 
   TMIDIEVENT* = MIDIEVENT
-  midistrmbuffver* {.final.} = object
+  MIDISTRMBUFFVER* {.final.} = object
     dwVersion*: DWORD
     dwMid*: DWORD
     dwOEMVersion*: DWORD
@@ -1262,7 +1262,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     wTechnology*: int16
     wReserved1*: int16
     dwSupport*: DWORD
@@ -1275,7 +1275,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     wTechnology*: int16
     wReserved1*: int16
     dwSupport*: DWORD
@@ -1304,14 +1304,14 @@ type
   HMIXER* = THandle
   LPHMIXER* = ptr HMIXER
 
-proc mixerGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc mixerGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                importc: "mixerGetNumDevs".}
 type
   MIXERCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
     fdwSupport*: DWORD
     cDestinations*: DWORD
 
@@ -1322,7 +1322,7 @@ type
     wMid*: int16
     wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), Wchar]
     fdwSupport*: DWORD
     cDestinations*: DWORD
 
@@ -1353,12 +1353,12 @@ type
     cChannels*: DWORD
     cConnections*: DWORD
     cControls*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
     dwType*, dwDeviceID*: DWORD
     wMid*, wPid*: int16
     vDriverVersion*: MMVERSION
-    szPname*: array[0..pred(MAXPNAMELEN), Char]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
 
   PMIXERLINEA* = ptr MIXERLINEA
   LPMIXERLINEA* = ptr MIXERLINEA
@@ -1374,8 +1374,8 @@ type
     cChannels*: DWORD
     cConnections*: DWORD
     cControls*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
     dwType*, dwDeviceID*: DWORD
     wMid*, wPid*: int16
     vDriverVersion*: MMVERSION
@@ -1403,8 +1403,8 @@ type
     dwControlType*: DWORD
     fdwControl*: DWORD
     cMultipleItems*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), CHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), char]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
     dwMinimum*, dwMaximum*: DWORD
     dwReserved*: array[0..3, DWORD]
     cSteps*: DWORD
@@ -1419,8 +1419,8 @@ type
     dwControlType*: DWORD
     fdwControl*: DWORD
     cMultipleItems*: DWORD
-    szShortName*: array[0..Pred(MIXER_SHORT_NAME_CHARS), WCHAR]
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szShortName*: array[0..pred(MIXER_SHORT_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
     dwMinimum*, dwMaximum*: DWORD
     dwReserved*: array[0..3, DWORD]
     cSteps*: DWORD
@@ -1478,15 +1478,15 @@ type
     dwControlID*: DWORD
     cChannels*: DWORD
     cMultipleItems*, cbDetails*: DWORD
-    paDetails*: Pointer
+    paDetails*: pointer
 
-  MIXERCONTROLDETAILS* = tMIXERCONTROLDETAILS
-  PMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
-  LPMIXERCONTROLDETAILS* = ptr tMIXERCONTROLDETAILS
+  MIXERCONTROLDETAILS* = TMIXERCONTROLDETAILS
+  PMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
+  LPMIXERCONTROLDETAILS* = ptr TMIXERCONTROLDETAILS
   MIXERCONTROLDETAILS_LISTTEXTA* {.final.} = object
     dwParam1*: DWORD
     dwParam2*: DWORD
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), CHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), char]
 
   PMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
   LPMIXERCONTROLDETAILS_LISTTEXTA* = ptr MIXERCONTROLDETAILS_LISTTEXTA
@@ -1494,7 +1494,7 @@ type
   MIXERCONTROLDETAILS_LISTTEXTW* {.final.} = object
     dwParam1*: DWORD
     dwParam2*: DWORD
-    szName*: array[0..Pred(MIXER_LONG_NAME_CHARS), WCHAR]
+    szName*: array[0..pred(MIXER_LONG_NAME_CHARS), WCHAR]
 
   PMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
   LPMIXERCONTROLDETAILS_LISTTEXTW* = ptr MIXERCONTROLDETAILS_LISTTEXTW
@@ -1530,42 +1530,42 @@ type
   PMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
   LPMIXERCONTROLDETAILS_UNSIGNED* = ptr MIXERCONTROLDETAILS_UNSIGNED
   TMIXERCONTROLDETAILS_UNSIGNED* = MIXERCONTROLDETAILS_UNSIGNED
-  LPTIMECALLBACK* = proc (uTimerID, uMsg: UINT, dwUser, dw1, dw2: DWORD){.
+  LPTIMECALLBACK* = proc (uTimerID, uMsg: uint32, dwUser, dw1, dw2: DWORD){.
       stdcall.}
   TTIMECALLBACK* = LPTIMECALLBACK
-  timecaps* {.final.} = object
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
+  TIMECAPS* {.final.} = object
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
 
-  PTIMECAPS* = ptr timecaps
-  NPTIMECAPS* = ptr timecaps
-  LPTIMECAPS* = ptr timecaps
+  PTIMECAPS* = ptr TIMECAPS
+  NPTIMECAPS* = ptr TIMECAPS
+  LPTIMECAPS* = ptr TIMECAPS
   TTIMECAS* = TIMECAPS
   JOYCAPSA* {.final.} = object
     wMid*: int16
     wPid*: int16
-    szPname*: array[0..Pred(MAXPNAMELEN), CHAR]
-    wXmin*: UINT
-    wXmax*: UINT
-    wYmin*: UINT
-    wYmax*: UINT
-    wZmin*: UINT
-    wZmax*: UINT
-    wNumButtons*: UINT
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
-    wRmin*: UINT
-    wRmax*: UINT
-    wUmin*: UINT
-    wUmax*: UINT
-    wVmin*: UINT
-    wVmax*: UINT
-    wCaps*: UINT
-    wMaxAxes*: UINT
-    wNumAxes*: UINT
-    wMaxButtons*: UINT
-    szRegKey*: array[0..Pred(MAXPNAMELEN), CHAR]
-    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), CHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), char]
+    wXmin*: uint32
+    wXmax*: uint32
+    wYmin*: uint32
+    wYmax*: uint32
+    wZmin*: uint32
+    wZmax*: uint32
+    wNumButtons*: uint32
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
+    wRmin*: uint32
+    wRmax*: uint32
+    wUmin*: uint32
+    wUmax*: uint32
+    wVmin*: uint32
+    wVmax*: uint32
+    wCaps*: uint32
+    wMaxAxes*: uint32
+    wNumAxes*: uint32
+    wMaxButtons*: uint32
+    szRegKey*: array[0..pred(MAXPNAMELEN), char]
+    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), char]
 
   PJOYCAPSA* = ptr JOYCAPSA
   NPJOYCAPSA* = ptr JOYCAPSA
@@ -1574,28 +1574,28 @@ type
   JOYCAPSW* {.final.} = object
     wMid*: int16
     wPid*: int16
-    szPname*: array[0..Pred(MAXPNAMELEN), WCHAR]
-    wXmin*: UINT
-    wXmax*: UINT
-    wYmin*: UINT
-    wYmax*: UINT
-    wZmin*: UINT
-    wZmax*: UINT
-    wNumButtons*: UINT
-    wPeriodMin*: UINT
-    wPeriodMax*: UINT
-    wRmin*: UINT
-    wRmax*: UINT
-    wUmin*: UINT
-    wUmax*: UINT
-    wVmin*: UINT
-    wVmax*: UINT
-    wCaps*: UINT
-    wMaxAxes*: UINT
-    wNumAxes*: UINT
-    wMaxButtons*: UINT
-    szRegKey*: array[0..Pred(MAXPNAMELEN), WCHAR]
-    szOEMVxD*: array[0..Pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]
+    szPname*: array[0..pred(MAXPNAMELEN), WCHAR]
+    wXmin*: uint32
+    wXmax*: uint32
+    wYmin*: uint32
+    wYmax*: uint32
+    wZmin*: uint32
+    wZmax*: uint32
+    wNumButtons*: uint32
+    wPeriodMin*: uint32
+    wPeriodMax*: uint32
+    wRmin*: uint32
+    wRmax*: uint32
+    wUmin*: uint32
+    wUmax*: uint32
+    wVmin*: uint32
+    wVmax*: uint32
+    wCaps*: uint32
+    wMaxAxes*: uint32
+    wNumAxes*: uint32
+    wMaxButtons*: uint32
+    szRegKey*: array[0..pred(MAXPNAMELEN), WCHAR]
+    szOEMVxD*: array[0..pred(MAX_JOYSTICKOEMVXDNAME), WCHAR]
 
   PJOYCAPSW* = ptr JOYCAPSW
   NPJOYCAPSW* = ptr JOYCAPSW
@@ -1616,45 +1616,45 @@ else:
     LPJOYCAPS* = LPJOYCAPSA
 type
   TJOYCAPS* = JOYCAPS
-  joyinfo* {.final.} = object
-    wXpos*: UINT
-    wYpos*: UINT
-    wZpos*: UINT
-    wButtons*: UINT
-
-  PJOYINFO* = ptr joyinfo
-  NPJOYINFO* = ptr joyinfo
-  LPJOYINFO* = ptr joyinfo
+  JOYINFO* {.final.} = object
+    wXpos*: uint32
+    wYpos*: uint32
+    wZpos*: uint32
+    wButtons*: uint32
+
+  PJOYINFO* = ptr JOYINFO
+  NPJOYINFO* = ptr JOYINFO
+  LPJOYINFO* = ptr JOYINFO
   TJOYINFO* = JOYINFO
-  joyinfoex* {.final.} = object
+  JOYINFOEX* {.final.} = object
     dwSize*: DWORD
     dwFlags*: DWORD
-    wXpos*: UINT
-    wYpos*: UINT
-    wZpos*: UINT
+    wXpos*: uint32
+    wYpos*: uint32
+    wZpos*: uint32
     dwRpos*: DWORD
     dwUpos*: DWORD
     dwVpos*: DWORD
-    wButtons*: UINT
+    wButtons*: uint32
     dwButtonNumber*: DWORD
     dwPOV*: DWORD
     dwReserved1*: DWORD
     dwReserved2*: DWORD
 
-  PJOYINFOEX* = ptr joyinfoex
-  NPJOYINFOEX* = ptr joyinfoex
-  LPJOYINFOEX* = ptr joyinfoex
+  PJOYINFOEX* = ptr JOYINFOEX
+  NPJOYINFOEX* = ptr JOYINFOEX
+  LPJOYINFOEX* = ptr JOYINFOEX
   TJOYINFOEX* = JOYINFOEX
   FOURCC* = DWORD
   HPSTR* = cstring
   HMMIO* = THandle
-  LPMMIOPROC* = proc (x1: LPSTR, x2: UINT, x3, x4: LPARAM): LRESULT{.stdcall.}
+  LPMMIOPROC* = proc (x1: LPSTR, x2: uint32, x3, x4: LPARAM): LRESULT{.stdcall.}
   TMMIOPROC* = LPMMIOPROC
   MMIOINFO* {.final.} = object
     dwFlags*: DWORD
     fccIOProc*: FOURCC
     pIOProc*: LPMMIOPROC
-    wErrorRet*: UINT
+    wErrorRet*: uint32
     htask*: HTASK
     cchBuffer*: int32
     pchBuffer*: HPSTR
@@ -1663,7 +1663,7 @@ type
     pchEndWrite*: HPSTR
     lBufOffset*: int32
     lDiskOffset*: int32
-    adwInfo*: array[0..Pred(3), DWORD]
+    adwInfo*: array[0..pred(3), DWORD]
     dwReserved1*: DWORD
     dwReserved2*: DWORD
     hmmio*: HMMIO
@@ -1686,8 +1686,8 @@ type
   LPCMMCKINFO* = ptr MMCKINFO
   TMMCKINFO* = MMCKINFO
   MCIERROR* = DWORD
-  MCIDEVICEID* = UINT
-  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): UINT{.stdcall.}
+  MCIDEVICEID* = uint32
+  YIELDPROC* = proc (mciId: MCIDEVICEID, dwYieldData: DWORD): uint32{.stdcall.}
   TYIELDPROC* = YIELDPROC
   MCI_GENERIC_PARMS* {.final.} = object
     dwCallback*: DWORD
@@ -1790,7 +1790,7 @@ type
     lpstrReturn*: cstring
     dwRetSize*: DWORD
     dwNumber*: DWORD
-    wDeviceType*: UINT
+    wDeviceType*: uint32
 
   PMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
   LPMCI_SYSINFO_PARMSA* = ptr MCI_SYSINFO_PARMSA
@@ -1800,7 +1800,7 @@ type
     lpstrReturn*: LPWSTR
     dwRetSize*: DWORD
     dwNumber*: DWORD
-    wDeviceType*: UINT
+    wDeviceType*: uint32
 
   PMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
   LPMCI_SYSINFO_PARMSW* = ptr MCI_SYSINFO_PARMSW
@@ -1984,8 +1984,8 @@ type
     dwCallback*: DWORD
     dwTimeFormat*: DWORD
     dwAudio*: DWORD
-    wInput*: UINT
-    wOutput*: UINT
+    wInput*: uint32
+    wOutput*: uint32
     wFormatTag*: int16
     wReserved2*: int16
     nChannels*: int16
@@ -2052,7 +2052,7 @@ type
   MCI_ANIM_WINDOW_PARMSW* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCWSTR
 
   PMCI_ANIM_WINDOW_PARMSW* = ptr MCI_ANIM_WINDOW_PARMSW
@@ -2068,7 +2068,7 @@ type
   MCI_ANIM_WINDOW_PARMSA* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCSTR
 
   PMCI_ANIM_WINDOW_PARMSA* = ptr MCI_ANIM_WINDOW_PARMSA
@@ -2149,7 +2149,7 @@ type
   MCI_OVLY_WINDOW_PARMSA* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCSTR
 
   PMCI_OVLY_WINDOW_PARMSA* = ptr MCI_OVLY_WINDOW_PARMSA
@@ -2158,7 +2158,7 @@ type
   MCI_OVLY_WINDOW_PARMSW* {.final.} = object
     dwCallback*: DWORD
     hWnd*: HWND
-    nCmdShow*: UINT
+    nCmdShow*: uint32
     lpstrText*: LPCWSTR
 
   PMCI_OVLY_WINDOW_PARMSW* = ptr MCI_OVLY_WINDOW_PARMSW
@@ -2243,14 +2243,11 @@ else:
 type
   TMCI_OVLY_LOAD_PARMS* = MCI_OVLY_LOAD_PARMS
 
-type
-  pcmwaveformat_tag* = PCMWAVEFORMAT
-
-proc mmioStringToFOURCCA*(x1: LPCSTR, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCCA*(x1: LPCSTR, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
-proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCCW*(x1: LPCWSTR, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCW".}
-proc mmioStringToFOURCC*(x1: cstring, x2: UINT): FOURCC{.stdcall,
+proc mmioStringToFOURCC*(x1: cstring, x2: uint32): FOURCC{.stdcall,
     dynlib: "winmm.dll", importc: "mmioStringToFOURCCA".}
 proc mmioInstallIOProcA*(x1: FOURCC, x2: LPMMIOPROC, x3: DWORD): LPMMIOPROC{.
     stdcall, dynlib: "winmm.dll", importc: "mmioInstallIOProcA".}
@@ -2270,7 +2267,7 @@ proc mmioRenameW*(x1: LPCWSTR, x2: LPCWSTR, x3: LPCMMIOINFO, x4: DWORD): MMRESUL
     stdcall, dynlib: "winmm.dll", importc: "mmioRenameW".}
 proc mmioRename*(x1: cstring, x2: cstring, x3: LPCMMIOINFO, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioRenameA".}
-proc mmioClose*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc mmioClose*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "mmioClose".}
 proc mmioRead*(x1: HMMIO, x2: HPSTR, x3: LONG): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioRead".}
@@ -2278,35 +2275,35 @@ proc mmioWrite*(x1: HMMIO, x2: cstring, x3: LONG): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioWrite".}
 proc mmioSeek*(x1: HMMIO, x2: LONG, x3: WINT): LONG{.stdcall,
     dynlib: "winmm.dll", importc: "mmioSeek".}
-proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioGetInfo*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioGetInfo".}
-proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioSetInfo*(x1: HMMIO, x2: LPCMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioSetInfo".}
-proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: UINT): MMRESULT{.
+proc mmioSetBuffer*(x1: HMMIO, x2: LPSTR, x3: LONG, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioSetBuffer".}
-proc mmioFlush*(x1: HMMIO, x2: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc mmioFlush*(x1: HMMIO, x2: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "mmioFlush".}
-proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioAdvance*(x1: HMMIO, x2: LPMMIOINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioAdvance".}
-proc mmioSendMessage*(x1: HMMIO, x2: UINT, x3: LPARAM, x4: LPARAM): LRESULT{.
+proc mmioSendMessage*(x1: HMMIO, x2: uint32, x3: LPARAM, x4: LPARAM): LRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioSendMessage".}
-proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: UINT): MMRESULT{.
+proc mmioDescend*(x1: HMMIO, x2: LPMMCKINFO, x3: PMMCKINFO, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mmioDescend".}
-proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioAscend*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioAscend".}
-proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: UINT): MMRESULT{.stdcall,
+proc mmioCreateChunk*(x1: HMMIO, x2: LPMMCKINFO, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mmioCreateChunk".}
-proc mciSendCommandA*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommandA*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendCommandW*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommandW*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandW".}
-proc mciSendCommand*(x1: MCIDEVICEID, x2: UINT, x3: DWORD, x4: DWORD): MCIERROR{.
+proc mciSendCommand*(x1: MCIDEVICEID, x2: uint32, x3: DWORD, x4: DWORD): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendCommandA".}
-proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendStringA*(x1: LPCSTR, x2: LPSTR, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
-proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendStringW*(x1: LPCWSTR, x2: LPWSTR, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringW".}
-proc mciSendString*(x1: cstring, x2: cstring, x3: UINT, x4: HWND): MCIERROR{.
+proc mciSendString*(x1: cstring, x2: cstring, x3: uint32, x4: HWND): MCIERROR{.
     stdcall, dynlib: "winmm.dll", importc: "mciSendStringA".}
 proc mciGetDeviceIDA*(x1: LPCSTR): MCIDEVICEID{.stdcall, dynlib: "winmm.dll",
     importc: "mciGetDeviceIDA".}
@@ -2320,60 +2317,60 @@ proc mciGetDeviceIDFromElementIDW*(x1: DWORD, x2: LPCWSTR): MCIDEVICEID{.
     stdcall, dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDW".}
 proc mciGetDeviceIDFromElementID*(x1: DWORD, x2: cstring): MCIDEVICEID{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetDeviceIDFromElementIDA".}
-proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorStringA*(x1: MCIERROR, x2: LPSTR, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorStringW*(x1: MCIERROR, x2: LPWSTR, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringW".}
-proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: UINT): BOOL{.stdcall,
+proc mciGetErrorString*(x1: MCIERROR, x2: cstring, x3: uint32): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetErrorStringA".}
-proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): BOOL{.stdcall,
+proc mciSetYieldProc*(x1: MCIDEVICEID, x2: YIELDPROC, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "mciSetYieldProc".}
 proc mciGetCreatorTask*(x1: MCIDEVICEID): HTASK{.stdcall, dynlib: "winmm.dll",
     importc: "mciGetCreatorTask".}
 proc mciGetYieldProc*(x1: MCIDEVICEID, x2: LPDWORD): YIELDPROC{.stdcall,
     dynlib: "winmm.dll", importc: "mciGetYieldProc".}
-proc mciExecute*(x1: LPCSTR): BOOL{.stdcall, dynlib: "winmm.dll",
+proc mciExecute*(x1: LPCSTR): bool{.stdcall, dynlib: "winmm.dll",
                                     importc: "mciExecute".}
-proc joyGetPos*(x1: UINT, x2: LPJOYINFO): MMRESULT{.stdcall,
+proc joyGetPos*(x1: uint32, x2: LPJOYINFO): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetPos".}
-proc joyGetPosEx*(x1: UINT, x2: LPJOYINFOEX): MMRESULT{.stdcall,
+proc joyGetPosEx*(x1: uint32, x2: LPJOYINFOEX): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetPosEx".}
-proc joyGetThreshold*(x1: UINT, x2: LPUINT): MMRESULT{.stdcall,
+proc joyGetThreshold*(x1: uint32, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetThreshold".}
-proc joyReleaseCapture*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc joyReleaseCapture*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "joyReleaseCapture".}
-proc joySetCapture*(x1: HWND, x2: UINT, x3: UINT, x4: BOOL): MMRESULT{.stdcall,
+proc joySetCapture*(x1: HWND, x2: uint32, x3: uint32, x4: bool): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joySetCapture".}
-proc joySetThreshold*(x1: UINT, x2: UINT): MMRESULT{.stdcall,
+proc joySetThreshold*(x1: uint32, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joySetThreshold".}
-proc waveOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc waveOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                  importc: "waveOutGetNumDevs".}
-proc waveOutGetDevCapsA*(x1: UINT, x2: LPWAVEOUTCAPSA, x3: UINT): MMRESULT{.
+proc waveOutGetDevCapsA*(x1: uint32, x2: LPWAVEOUTCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
-proc waveOutGetDevCapsW*(x1: UINT, x2: LPWAVEOUTCAPSW, x3: UINT): MMRESULT{.
+proc waveOutGetDevCapsW*(x1: uint32, x2: LPWAVEOUTCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsW".}
-proc waveOutGetDevCaps*(x1: UINT, x2: LPWAVEOUTCAPS, x3: UINT): MMRESULT{.
+proc waveOutGetDevCaps*(x1: uint32, x2: LPWAVEOUTCAPS, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetDevCapsA".}
 proc waveOutGetVolume*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetVolume".}
 proc waveOutSetVolume*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutSetVolume".}
-proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
+proc waveOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc waveOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextW".}
-proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc waveOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetErrorTextA".}
-proc waveOutOpen*(x1: LPHWAVEOUT, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
+proc waveOutOpen*(x1: LPHWAVEOUT, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
                   x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutOpen".}
 proc waveOutClose*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutClose".}
-proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveOutPrepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutPrepareHeader".}
-proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveOutUnprepareHeader*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutUnprepareHeader".}
-proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
+proc waveOutWrite*(x1: HWAVEOUT, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutWrite".}
 proc waveOutPause*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutPause".}
@@ -2383,7 +2380,7 @@ proc waveOutReset*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutReset".}
 proc waveOutBreakLoop*(x1: HWAVEOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveOutBreakLoop".}
-proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: UINT): MMRESULT{.
+proc waveOutGetPosition*(x1: HWAVEOUT, x2: LPMMTIME, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutGetPosition".}
 proc waveOutGetPitch*(x1: HWAVEOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetPitch".}
@@ -2395,32 +2392,32 @@ proc waveOutSetPlaybackRate*(x1: HWAVEOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutSetPlaybackRate".}
 proc waveOutGetID*(x1: HWAVEOUT, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveOutGetID".}
-proc waveOutMessage*(x1: HWAVEOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc waveOutMessage*(x1: HWAVEOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveOutMessage".}
-proc waveInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc waveInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                 importc: "waveInGetNumDevs".}
-proc waveInGetDevCapsA*(x1: UINT, x2: LPWAVEINCAPSA, x3: UINT): MMRESULT{.
+proc waveInGetDevCapsA*(x1: uint32, x2: LPWAVEINCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetDevCapsW*(x1: UINT, x2: LPWAVEINCAPSW, x3: UINT): MMRESULT{.
+proc waveInGetDevCapsW*(x1: uint32, x2: LPWAVEINCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetDevCapsW".}
-proc waveInGetDevCaps*(x1: UINT, x2: LPWAVEINCAPS, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetDevCaps*(x1: uint32, x2: LPWAVEINCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetDevCapsA".}
-proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc waveInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextW".}
-proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc waveInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInGetErrorTextA".}
-proc waveInOpen*(x1: LPHWAVEIN, x2: UINT, x3: LPCWAVEFORMATEX, x4: DWORD,
+proc waveInOpen*(x1: LPHWAVEIN, x2: uint32, x3: LPCWAVEFORMATEX, x4: DWORD,
                  x5: DWORD, x6: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInOpen".}
 proc waveInClose*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInClose".}
-proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveInPrepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInPrepareHeader".}
-proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.
+proc waveInUnprepareHeader*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInUnprepareHeader".}
-proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: UINT): MMRESULT{.stdcall,
+proc waveInAddBuffer*(x1: HWAVEIN, x2: LPWAVEHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInAddBuffer".}
 proc waveInStart*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInStart".}
@@ -2428,11 +2425,11 @@ proc waveInStop*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInStop".}
 proc waveInReset*(x1: HWAVEIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "waveInReset".}
-proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: UINT): MMRESULT{.stdcall,
+proc waveInGetPosition*(x1: HWAVEIN, x2: LPMMTIME, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetPosition".}
 proc waveInGetID*(x1: HWAVEIN, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "waveInGetID".}
-proc waveInMessage*(x1: HWAVEIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc waveInMessage*(x1: HWAVEIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "waveInMessage".}
 proc mixerGetLineControlsA*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSA, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
@@ -2440,13 +2437,13 @@ proc mixerGetLineControlsW*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLSW, x3: DWORD):
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsW".}
 proc mixerGetLineControls*(x1: HMIXEROBJ, x2: LPMIXERLINECONTROLS, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineControlsA".}
-proc joyGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc joyGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                              importc: "joyGetNumDevs".}
-proc joyGetDevCapsA*(x1: UINT, x2: LPJOYCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCapsA*(x1: uint32, x2: LPJOYCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
-proc joyGetDevCapsW*(x1: UINT, x2: LPJOYCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCapsW*(x1: uint32, x2: LPJOYCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsW".}
-proc joyGetDevCaps*(x1: UINT, x2: LPJOYCAPS, x3: UINT): MMRESULT{.stdcall,
+proc joyGetDevCaps*(x1: uint32, x2: LPJOYCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "joyGetDevCapsA".}
 proc mixerGetControlDetailsA*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
                               x3: DWORD): MMRESULT{.stdcall,
@@ -2456,46 +2453,46 @@ proc mixerGetControlDetailsW*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS,
     dynlib: "winmm.dll", importc: "mixerGetControlDetailsW".}
 proc mixerGetControlDetails*(x1: HMIXEROBJ, x2: LPMIXERCONTROLDETAILS, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetControlDetailsA".}
-proc timeGetSystemTime*(x1: LPMMTIME, x2: UINT): MMRESULT{.stdcall,
+proc timeGetSystemTime*(x1: LPMMTIME, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "timeGetSystemTime".}
 proc timeGetTime*(): DWORD{.stdcall, dynlib: "winmm.dll", importc: "timeGetTime".}
-proc timeSetEvent*(x1: UINT, x2: UINT, x3: LPTIMECALLBACK, x4: DWORD, x5: UINT): MMRESULT{.
+proc timeSetEvent*(x1: uint32, x2: uint32, x3: LPTIMECALLBACK, x4: DWORD, x5: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "timeSetEvent".}
-proc timeKillEvent*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeKillEvent*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeKillEvent".}
-proc timeGetDevCaps*(x1: LPTIMECAPS, x2: UINT): MMRESULT{.stdcall,
+proc timeGetDevCaps*(x1: LPTIMECAPS, x2: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "timeGetDevCaps".}
-proc timeBeginPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeBeginPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeBeginPeriod".}
-proc timeEndPeriod*(x1: UINT): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc timeEndPeriod*(x1: uint32): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "timeEndPeriod".}
-proc mixerGetDevCapsA*(x1: UINT, x2: LPMIXERCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCapsA*(x1: uint32, x2: LPMIXERCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerGetDevCapsW*(x1: UINT, x2: LPMIXERCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCapsW*(x1: uint32, x2: LPMIXERCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsW".}
-proc mixerGetDevCaps*(x1: UINT, x2: LPMIXERCAPS, x3: UINT): MMRESULT{.stdcall,
+proc mixerGetDevCaps*(x1: uint32, x2: LPMIXERCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetDevCapsA".}
-proc mixerOpen*(x1: LPHMIXER, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc mixerOpen*(x1: LPHMIXER, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerOpen".}
 proc mixerClose*(x1: HMIXER): MMRESULT{.stdcall, dynlib: "winmm.dll",
                                         importc: "mixerClose".}
-proc mixerMessage*(x1: HMIXER, x2: UINT, x3: DWORD, x4: DWORD): DWORD{.stdcall,
+proc mixerMessage*(x1: HMIXER, x2: uint32, x3: DWORD, x4: DWORD): DWORD{.stdcall,
     dynlib: "winmm.dll", importc: "mixerMessage".}
-proc auxGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc auxGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                              importc: "auxGetNumDevs".}
-proc auxGetDevCapsA*(x1: UINT, x2: LPAUXCAPSA, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCapsA*(x1: uint32, x2: LPAUXCAPSA, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxGetDevCapsW*(x1: UINT, x2: LPAUXCAPSW, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCapsW*(x1: uint32, x2: LPAUXCAPSW, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsW".}
-proc auxGetDevCaps*(x1: UINT, x2: LPAUXCAPS, x3: UINT): MMRESULT{.stdcall,
+proc auxGetDevCaps*(x1: uint32, x2: LPAUXCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetDevCapsA".}
-proc auxSetVolume*(x1: UINT, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
+proc auxSetVolume*(x1: uint32, x2: DWORD): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "auxSetVolume".}
-proc auxGetVolume*(x1: UINT, x2: LPDWORD): MMRESULT{.stdcall,
+proc auxGetVolume*(x1: uint32, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "auxGetVolume".}
-proc auxOutMessage*(x1: UINT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc auxOutMessage*(x1: uint32, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "auxOutMessage".}
-proc midiOutGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc midiOutGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                  importc: "midiOutGetNumDevs".}
 proc midiStreamOpen*(x1: LPHMIDISTRM, x2: LPUINT, x3: DWORD, x4: DWORD,
                      x5: DWORD, x6: DWORD): MMRESULT{.stdcall,
@@ -2504,9 +2501,9 @@ proc midiStreamClose*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiStreamClose".}
 proc midiStreamProperty*(x1: HMIDISTRM, x2: LPBYTE, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiStreamProperty".}
-proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: UINT): MMRESULT{.
+proc midiStreamPosition*(x1: HMIDISTRM, x2: LPMMTIME, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiStreamPosition".}
-proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiStreamOut*(x1: HMIDISTRM, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiStreamOut".}
 proc midiStreamPause*(x1: HMIDISTRM): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiStreamPause".}
@@ -2518,67 +2515,67 @@ proc midiConnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiConnect".}
 proc midiDisconnect*(x1: HMIDI, x2: HMIDIOUT, x3: pointer): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiDisconnect".}
-proc midiOutGetDevCapsA*(x1: UINT, x2: LPMIDIOUTCAPSA, x3: UINT): MMRESULT{.
+proc midiOutGetDevCapsA*(x1: uint32, x2: LPMIDIOUTCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
-proc midiOutGetDevCapsW*(x1: UINT, x2: LPMIDIOUTCAPSW, x3: UINT): MMRESULT{.
+proc midiOutGetDevCapsW*(x1: uint32, x2: LPMIDIOUTCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsW".}
-proc midiOutGetDevCaps*(x1: UINT, x2: LPMIDIOUTCAPS, x3: UINT): MMRESULT{.
+proc midiOutGetDevCaps*(x1: uint32, x2: LPMIDIOUTCAPS, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetDevCapsA".}
 proc midiOutGetVolume*(x1: HMIDIOUT, x2: LPDWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutGetVolume".}
 proc midiOutSetVolume*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutSetVolume".}
-proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.
+proc midiOutGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc midiOutGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextW".}
-proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc midiOutGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutGetErrorTextA".}
-proc midiOutOpen*(x1: LPHMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc midiOutOpen*(x1: LPHMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutOpen".}
 proc midiOutClose*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiOutClose".}
-proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiOutPrepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutPrepareHeader".}
-proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiOutUnprepareHeader*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutUnprepareHeader".}
 proc midiOutShortMsg*(x1: HMIDIOUT, x2: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutShortMsg".}
-proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiOutLongMsg*(x1: HMIDIOUT, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutLongMsg".}
 proc midiOutReset*(x1: HMIDIOUT): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiOutReset".}
-proc midiOutCachePatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
+proc midiOutCachePatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutCachePatches".}
-proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: UINT, x3: LPWORD, x4: UINT): MMRESULT{.
+proc midiOutCacheDrumPatches*(x1: HMIDIOUT, x2: uint32, x3: LPWORD, x4: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutCacheDrumPatches".}
 proc midiOutGetID*(x1: HMIDIOUT, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiOutGetID".}
-proc midiOutMessage*(x1: HMIDIOUT, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc midiOutMessage*(x1: HMIDIOUT, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiOutMessage".}
-proc midiInGetNumDevs*(): UINT{.stdcall, dynlib: "winmm.dll",
+proc midiInGetNumDevs*(): uint32{.stdcall, dynlib: "winmm.dll",
                                 importc: "midiInGetNumDevs".}
-proc midiInGetDevCapsA*(x1: UINT, x2: LPMIDIINCAPSA, x3: UINT): MMRESULT{.
+proc midiInGetDevCapsA*(x1: uint32, x2: LPMIDIINCAPSA, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetDevCapsW*(x1: UINT, x2: LPMIDIINCAPSW, x3: UINT): MMRESULT{.
+proc midiInGetDevCapsW*(x1: uint32, x2: LPMIDIINCAPSW, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetDevCapsW".}
-proc midiInGetDevCaps*(x1: UINT, x2: LPMIDIINCAPS, x3: UINT): MMRESULT{.stdcall,
+proc midiInGetDevCaps*(x1: uint32, x2: LPMIDIINCAPS, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetDevCapsA".}
-proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: UINT): MMRESULT{.stdcall,
+proc midiInGetErrorTextA*(x1: MMRESULT, x2: LPSTR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: UINT): MMRESULT{.
+proc midiInGetErrorTextW*(x1: MMRESULT, x2: LPWSTR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextW".}
-proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: UINT): MMRESULT{.
+proc midiInGetErrorText*(x1: MMRESULT, x2: cstring, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInGetErrorTextA".}
-proc midiInOpen*(x1: LPHMIDIIN, x2: UINT, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
+proc midiInOpen*(x1: LPHMIDIIN, x2: uint32, x3: DWORD, x4: DWORD, x5: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInOpen".}
 proc midiInClose*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInClose".}
-proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiInPrepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInPrepareHeader".}
-proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.
+proc midiInUnprepareHeader*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInUnprepareHeader".}
-proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: UINT): MMRESULT{.stdcall,
+proc midiInAddBuffer*(x1: HMIDIIN, x2: LPMIDIHDR, x3: uint32): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInAddBuffer".}
 proc midiInStart*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInStart".}
@@ -2588,7 +2585,7 @@ proc midiInReset*(x1: HMIDIIN): MMRESULT{.stdcall, dynlib: "winmm.dll",
     importc: "midiInReset".}
 proc midiInGetID*(x1: HMIDIIN, x2: LPUINT): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "midiInGetID".}
-proc midiInMessage*(x1: HMIDIIN, x2: UINT, x3: DWORD, x4: DWORD): MMRESULT{.
+proc midiInMessage*(x1: HMIDIIN, x2: uint32, x3: DWORD, x4: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "midiInMessage".}
 proc mixerGetLineInfoA*(x1: HMIXEROBJ, x2: LPMIXERLINEA, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
@@ -2596,13 +2593,13 @@ proc mixerGetLineInfoW*(x1: HMIXEROBJ, x2: LPMIXERLINEW, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoW".}
 proc mixerGetLineInfo*(x1: HMIXEROBJ, x2: LPMIXERLINE, x3: DWORD): MMRESULT{.
     stdcall, dynlib: "winmm.dll", importc: "mixerGetLineInfoA".}
-proc mixerGetID*(x1: HMIXEROBJ, x2: var UINT, x3: DWORD): MMRESULT{.stdcall,
+proc mixerGetID*(x1: HMIXEROBJ, x2: var uint32, x3: DWORD): MMRESULT{.stdcall,
     dynlib: "winmm.dll", importc: "mixerGetID".}
-proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySoundA*(x1: LPCSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundA".}
-proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySoundW*(x1: LPCWSTR, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundW".}
-proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): BOOL{.stdcall,
+proc PlaySound*(x1: cstring, x2: HMODULE, x3: DWORD): bool{.stdcall,
     dynlib: "winmm.dll", importc: "PlaySoundA".}
 # implementation
 
@@ -2610,7 +2607,7 @@ proc MEVT_EVENTTYPE(x: int8): int8 =
   result = toU8(x shr 24)
 
 proc MEVT_EVENTPARM(x: DWORD): DWORD =
-  result = x And 0x00FFFFFF
+  result = x and 0x00FFFFFF
 
 proc MCI_MSF_MINUTE(msf: int32): int8 =
   result = toU8(msf and 0xff)
@@ -2648,8 +2645,8 @@ proc MCI_MAKE_HMS(h, m, s: int8): int32 =
 proc MCI_TMSF_FRAME(tmsf: int32): int8 =
   result = toU8(tmsf shr 24)
 
-proc mci_Make_TMSF(t, m, s, f: int8): int32 =
+proc MCI_MAKE_TMSF(t, m, s, f: int8): int32 =
   result = (ze(t) or ze(m) shl 8 or ze(s) shl 16 or ze(f) shl 24).int32
 
 proc DIBINDEX(n: int32): int32 =
-  result = n Or 0x000010FF'i32 shl 16'i32
+  result = n or 0x000010FF'i32 shl 16'i32
diff --git a/lib/windows/nb30.nim b/lib/windows/nb30.nim
index a7fd526aa..2e0c679ae 100644
--- a/lib/windows/nb30.nim
+++ b/lib/windows/nb30.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2006 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
@@ -13,7 +13,7 @@
 {.deadCodeElim: on.}
 
 import                        # Data structure templates 
-  Windows
+  windows
 
 const 
   NCBNAMSZ* = 16              # absolute length of a net name
@@ -24,20 +24,20 @@ type                          # Network Control Block
   TNCBPostProc* = proc (P: PNCB) {.stdcall.}
   TNCB* {.final.} = object # Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
                            # by an array of NAME_BUFFER structures.
-    ncb_command*: Char        # command code
-    ncb_retcode*: Char        # return code
-    ncb_lsn*: Char            # local session number
-    ncb_num*: Char            # number of our network name
+    ncb_command*: char        # command code
+    ncb_retcode*: char        # return code
+    ncb_lsn*: char            # local session number
+    ncb_num*: char            # number of our network name
     ncb_buffer*: cstring      # address of message buffer
     ncb_length*: int16        # size of message buffer
     ncb_callname*: array[0..NCBNAMSZ - 1, char] # blank-padded name of remote
     ncb_name*: array[0..NCBNAMSZ - 1, char] # our blank-padded netname
-    ncb_rto*: Char            # rcv timeout/retry count
-    ncb_sto*: Char            # send timeout/sys timeout
+    ncb_rto*: char            # rcv timeout/retry count
+    ncb_sto*: char            # send timeout/sys timeout
     ncb_post*: TNCBPostProc   # POST routine address
-    ncb_lana_num*: Char       # lana (adapter) number
-    ncb_cmd_cplt*: Char       # 0xff => commmand pending
-    ncb_reserve*: array[0..9, Char] # reserved, used by BIOS
+    ncb_lana_num*: char       # lana (adapter) number
+    ncb_cmd_cplt*: char       # 0xff => commmand pending
+    ncb_reserve*: array[0..9, char] # reserved, used by BIOS
     ncb_event*: THandle       # HANDLE to Win32 event which
                               # will be set to the signalled
                               # state when an ASYNCH command
@@ -45,11 +45,11 @@ type                          # Network Control Block
   
   PAdapterStatus* = ptr TAdapterStatus
   TAdapterStatus* {.final.} = object 
-    adapter_address*: array[0..5, Char]
-    rev_major*: Char
-    reserved0*: Char
-    adapter_type*: Char
-    rev_minor*: Char
+    adapter_address*: array[0..5, char]
+    rev_major*: char
+    reserved0*: char
+    adapter_type*: char
+    rev_minor*: char
     duration*: int16
     frmr_recv*: int16
     frmr_xmit*: int16
@@ -75,9 +75,9 @@ type                          # Network Control Block
 
   PNameBuffer* = ptr TNameBuffer
   TNameBuffer* {.final.} = object 
-    name*: array[0..NCBNAMSZ - 1, Char]
-    name_num*: Char
-    name_flags*: Char
+    name*: array[0..NCBNAMSZ - 1, char]
+    name_num*: char
+    name_flags*: char
 
 
 const                         # values for name_flags bits.
@@ -96,19 +96,19 @@ type # Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
      # status for all names.
   PSessionHeader* = ptr TSessionHeader
   TSessionHeader* {.final.} = object 
-    sess_name*: Char
-    num_sess*: Char
-    rcv_dg_outstanding*: Char
-    rcv_any_outstanding*: Char
+    sess_name*: char
+    num_sess*: char
+    rcv_dg_outstanding*: char
+    rcv_any_outstanding*: char
 
   PSessionBuffer* = ptr TSessionBuffer
   TSessionBuffer* {.final.} = object 
-    lsn*: Char
-    state*: Char
-    local_name*: array[0..NCBNAMSZ - 1, Char]
-    remote_name*: array[0..NCBNAMSZ - 1, Char]
-    rcvs_outstanding*: Char
-    sends_outstanding*: Char
+    lsn*: char
+    state*: char
+    local_name*: array[0..NCBNAMSZ - 1, char]
+    remote_name*: array[0..NCBNAMSZ - 1, char]
+    rcvs_outstanding*: char
+    sends_outstanding*: char
 
 
 const                         # Values for state
@@ -125,24 +125,24 @@ type # Structure returned to the NCB command NCBENUM.
   PLanaEnum* = ptr TLanaEnum
   TLanaEnum* {.final.} = object # Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
                                 # by an array of FIND_NAME_BUFFER structures.
-    len*: Char                #  Number of valid entries in lana[]
-    lana*: array[0..MAX_LANA, Char]
+    len*: char                #  Number of valid entries in lana[]
+    lana*: array[0..MAX_LANA, char]
 
   PFindNameHeader* = ptr TFindNameHeader
   TFindNameHeader* {.final.} = object 
     node_count*: int16
-    reserved*: Char
-    unique_group*: Char
+    reserved*: char
+    unique_group*: char
 
   PFindNameBuffer* = ptr TFindNameBuffer
   TFindNameBuffer* {.final.} = object # Structure provided with NCBACTION. The purpose of NCBACTION is to provide
                                       # transport specific extensions to netbios.
-    len*: Char
-    access_control*: Char
-    frame_control*: Char
-    destination_addr*: array[0..5, Char]
-    source_addr*: array[0..5, Char]
-    routing_info*: array[0..17, Char]
+    len*: char
+    access_control*: char
+    frame_control*: char
+    destination_addr*: array[0..5, char]
+    source_addr*: array[0..5, char]
+    routing_info*: array[0..17, char]
 
   PActionHeader* = ptr TActionHeader
   TActionHeader* {.final.} = object 
@@ -227,6 +227,6 @@ const                         # NCB Command codes
                               # main user entry point for NetBIOS 3.0
                               #   Usage: Result = Netbios( pncb ); 
 
-proc Netbios*(P: PNCB): Char{.stdcall, dynlib: "netapi32.dll", 
+proc Netbios*(P: PNCB): char{.stdcall, dynlib: "netapi32.dll", 
                               importc: "Netbios".}
 # implementation
diff --git a/lib/windows/psapi.nim b/lib/windows/psapi.nim
index 7d53cf7ca..fd1dcada8 100644
--- a/lib/windows/psapi.nim
+++ b/lib/windows/psapi.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2009 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
diff --git a/lib/windows/shellapi.nim b/lib/windows/shellapi.nim
index 41f2a60d5..079257680 100644
--- a/lib/windows/shellapi.nim
+++ b/lib/windows/shellapi.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2006 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
@@ -28,14 +28,14 @@
 #    Copyright (c) Microsoft Corporation. All rights reserved.
 
 import
-  Windows
+  windows
 
 type
   HDROP* = THandle
-  UINT_PTR* = ptr UINT
+  UINT_PTR* = ptr uint32
   DWORD_PTR* = ptr DWORD
-  pHICON* = ptr HICON
-  pBool* = ptr BOOL
+  PHICON* = ptr HICON
+  PBool* = ptr bool
   STARTUPINFOW* {.final.} = object # a guess. Omission should get fixed in Windows.
     cb*: DWORD
     lpReserved*: LPTSTR
@@ -60,27 +60,27 @@ type
   TSTARTUPINFOW* = STARTUPINFOW
   PSTARTUPINFOW* = ptr STARTUPINFOW #unicode
 
-proc DragQueryFileA*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+proc DragQueryFileA*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFileW*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+proc DragQueryFileW*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPSTR, arg4: UINT): UINT{.
+proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileA".}
-proc DragQueryFile*(arg1: HDROP, arg2: UINT, arg3: LPWSTR, arg4: UINT): UINT{.
+proc DragQueryFile*(arg1: HDROP, arg2: uint32, arg3: LPWSTR, arg4: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "DragQueryFileW".}
-proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): BOOL{.stdcall,
+proc DragQueryPoint*(arg1: HDROP, arg2: LPPOINT): bool{.stdcall,
     dynlib: "shell32.dll", importc: "DragQueryPoint".}
 proc DragFinish*(arg1: HDROP){.stdcall, dynlib: "shell32.dll",
                                importc: "DragFinish".}
-proc DragAcceptFiles*(hwnd: HWND, arg2: BOOL){.stdcall, dynlib: "shell32.dll",
+proc DragAcceptFiles*(hwnd: HWND, arg2: bool){.stdcall, dynlib: "shell32.dll",
     importc: "DragAcceptFiles".}
-proc ShellExecuteA*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
+proc ShellExecuteA*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
                     lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
 proc ShellExecuteW*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
                     lpParameters: LPCWSTR, lpDirectory: LPCWSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteW".}
-proc ShellExecute*(HWND: hwnd, lpOperation: LPCSTR, lpFile: LPCSTR,
+proc ShellExecute*(hwnd: HWND, lpOperation: LPCSTR, lpFile: LPCSTR,
                    lpParameters: LPCSTR, lpDirectory: LPCSTR, nShowCmd: int32): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "ShellExecuteA".}
 proc ShellExecute*(hwnd: HWND, lpOperation: LPCWSTR, lpFile: LPCWSTR,
@@ -94,16 +94,16 @@ proc FindExecutable*(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR): HIns
     stdcall, dynlib: "shell32.dll", importc: "FindExecutableA".}
 proc FindExecutable*(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR): HInst{.
     stdcall, dynlib: "shell32.dll", importc: "FindExecutableW".}
-proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): pLPWSTR{.
+proc CommandLineToArgvW*(lpCmdLine: LPCWSTR, pNumArgs: ptr int32): PLPWSTR{.
     stdcall, dynlib: "shell32.dll", importc: "CommandLineToArgvW".}
-proc ShellAboutA*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
+proc ShellAboutA*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAboutW*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
-                  HICON: hIcon): int32{.stdcall, dynlib: "shell32.dll",
+proc ShellAboutW*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR,
+                  hIcon: HICON): int32{.stdcall, dynlib: "shell32.dll",
                                         importc: "ShellAboutW".}
-proc ShellAbout*(HWND: hWnd, szApp: LPCSTR, szOtherStuff: LPCSTR, HICON: hIcon): int32{.
+proc ShellAbout*(hwnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutA".}
-proc ShellAbout*(HWND: hWnd, szApp: LPCWSTR, szOtherStuff: LPCWSTR, HICON: hIcon): int32{.
+proc ShellAbout*(hwnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR, hIcon: HICON): int32{.
     stdcall, dynlib: "shell32.dll", importc: "ShellAboutW".}
 proc DuplicateIcon*(inst: HINST, icon: HICON): HIcon{.stdcall,
     dynlib: "shell32.dll", importc: "DuplicateIcon".}
@@ -115,29 +115,29 @@ proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPSTR, lpiIcon: LPWORD): H
     stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconA".}
 proc ExtractAssociatedIcon*(hInst: HINST, lpIconPath: LPWSTR, lpiIcon: LPWORD): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractAssociatedIconW".}
-proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
+proc ExtractIconA*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+proc ExtractIconW*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: UINT): HICON{.
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconA".}
-proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: UINT): HICON{.
+proc ExtractIcon*(hInst: HINST, lpszExeFileName: LPCWSTR, nIconIndex: uint32): HICON{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconW".}
   # if(WINVER >= 0x0400)
 type                          # init with sizeof(DRAGINFO)
   DRAGINFOA* {.final.} = object
-    uSize*: UINT
+    uSize*: uint32
     pt*: POINT
-    fNC*: BOOL
+    fNC*: bool
     lpFileList*: LPSTR
     grfKeyState*: DWORD
 
   TDRAGINFOA* = DRAGINFOA
   LPDRAGINFOA* = ptr DRAGINFOA # init with sizeof(DRAGINFO)
   DRAGINFOW* {.final.} = object
-    uSize*: UINT
+    uSize*: uint32
     pt*: POINT
-    fNC*: BOOL
+    fNC*: bool
     lpFileList*: LPWSTR
     grfKeyState*: DWORD
 
@@ -184,8 +184,8 @@ type
   AppBarData* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uCallbackMessage*: UINT
-    uEdge*: UINT
+    uCallbackMessage*: uint32
+    uEdge*: uint32
     rc*: RECT
     lParam*: LPARAM           # message specific
 
@@ -197,41 +197,41 @@ proc SHAppBarMessage*(dwMessage: DWORD, pData: APPBARDATA): UINT_PTR{.stdcall,
   #
   #  EndAppBar
   #
-proc DoEnvironmentSubstA*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubstA*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubstW*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
-proc DoEnvironmentSubst*(szString: LPSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubst*(szString: LPSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstA".}
-proc DoEnvironmentSubst*(szString: LPWSTR, cchString: UINT): DWORD{.stdcall,
+proc DoEnvironmentSubst*(szString: LPWSTR, cchString: uint32): DWORD{.stdcall,
     dynlib: "shell32.dll", importc: "DoEnvironmentSubstW".}
   #Macro
 proc EIRESID*(x: int32): int32
-proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
-                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
+                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
-                     phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
+                     phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExW".}
 proc ExtractIconExA*(lpszFile: LPCSTR, nIconIndex: int32,
                      phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
     importc: "ExtractIconExA".}
 proc ExtractIconExW*(lpszFile: LPCWSTR, nIconIndex: int32,
                      phiconLarge: var HICON, phiconSmall: var HIcon,
-                     nIcons: UINT): UINT{.stdcall, dynlib: "shell32.dll",
+                     nIcons: uint32): uint32{.stdcall, dynlib: "shell32.dll",
     importc: "ExtractIconExW".}
-proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: pHICON,
-                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: PHICON,
+                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
-proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: pHICON,
-                    phiconSmall: pHIcon, nIcons: UINT): UINT{.stdcall,
+proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32, phiconLarge: PHICON,
+                    phiconSmall: PHICON, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExW".}
 proc ExtractIconEx*(lpszFile: LPCSTR, nIconIndex: int32, phiconLarge: var HICON,
-                    phiconSmall: var HIcon, nIcons: UINT): UINT{.stdcall,
+                    phiconSmall: var HIcon, nIcons: uint32): uint32{.stdcall,
     dynlib: "shell32.dll", importc: "ExtractIconExA".}
 proc ExtractIconEx*(lpszFile: LPCWSTR, nIconIndex: int32,
-                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: UINT): UINT{.
+                    phiconLarge: var HICON, phiconSmall: var HIcon, nIcons: uint32): uint32{.
     stdcall, dynlib: "shell32.dll", importc: "ExtractIconExW".}
   #
   # Shell File Operations
@@ -291,11 +291,11 @@ type
 type
   SHFILEOPSTRUCTA* {.final.} = object
     hwnd*: HWND
-    wFunc*: UINT
+    wFunc*: uint32
     pFrom*: LPCSTR
     pTo*: LPCSTR
     fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: BOOL
+    fAnyOperationsAborted*: bool
     hNameMappings*: LPVOID
     lpszProgressTitle*: LPCSTR # only used if FOF_SIMPLEPROGRESS
 
@@ -303,11 +303,11 @@ type
   LPSHFILEOPSTRUCTA* = ptr SHFILEOPSTRUCTA
   SHFILEOPSTRUCTW* {.final.} = object
     hwnd*: HWND
-    wFunc*: UINT
+    wFunc*: uint32
     pFrom*: LPCWSTR
     pTo*: LPCWSTR
     fFlags*: FILEOP_FLAGS
-    fAnyOperationsAborted*: BOOL
+    fAnyOperationsAborted*: bool
     hNameMappings*: LPVOID
     lpszProgressTitle*: LPCWSTR
 
@@ -430,10 +430,10 @@ type
     cbSize*: DWORD
     fMask*: ULONG
     hwnd*: HWND
-    lpVerb*: lpcwstr
-    lpFile*: lpcwstr
-    lpParameters*: lpcwstr
-    lpDirectory*: lpcwstr
+    lpVerb*: LPCWSTR
+    lpFile*: LPCWSTR
+    lpParameters*: LPCWSTR
+    lpDirectory*: LPCWSTR
     nShow*: int32
     hInstApp*: HINST
     lpIDList*: LPVOID
@@ -456,24 +456,24 @@ else:
     SHELLEXECUTEINFO* = SHELLEXECUTEINFOA
     TSHELLEXECUTEINFO* = SHELLEXECUTEINFOA
     LPSHELLEXECUTEINFO* = LPSHELLEXECUTEINFOA
-proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
+proc ShellExecuteExA*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
+proc ShellExecuteExW*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): Bool{.stdcall,
+proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOA): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExA".}
-proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): Bool{.stdcall,
+proc ShellExecuteEx*(lpExecInfo: LPSHELLEXECUTEINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "ShellExecuteExW".}
-proc WinExecErrorA*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
+proc WinExecErrorA*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
                     lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorA".}
-proc WinExecErrorW*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
+proc WinExecErrorW*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
                     lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorW".}
-proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCSTR,
+proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCSTR,
                    lpstrTitle: LPCSTR){.stdcall, dynlib: "shell32.dll",
                                         importc: "WinExecErrorA".}
-proc WinExecError*(HWND: hwnd, error: int32, lpstrFileName: LPCWSTR,
+proc WinExecError*(hwnd: HWND, error: int32, lpstrFileName: LPCWSTR,
                    lpstrTitle: LPCWSTR){.stdcall, dynlib: "shell32.dll",
     importc: "WinExecErrorW".}
 type
@@ -487,7 +487,7 @@ type
     hUserToken*: HANDLE
     lpProcessAttributes*: LPSECURITY_ATTRIBUTES
     lpThreadAttributes*: LPSECURITY_ATTRIBUTES
-    bInheritHandles*: BOOL
+    bInheritHandles*: bool
     dwCreationFlags*: DWORD
     lpStartupInfo*: LPSTARTUPINFOW
     lpProcessInformation*: LPPROCESS_INFORMATION
@@ -495,7 +495,7 @@ type
   TSHCREATEPROCESSINFOW* = SHCREATEPROCESSINFOW
   PSHCREATEPROCESSINFOW* = ptr SHCREATEPROCESSINFOW
 
-proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): Bool{.stdcall,
+proc SHCreateProcessAsUserW*(pscpi: PSHCREATEPROCESSINFOW): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHCreateProcessAsUserW".}
   #
   #  End ShellExecuteEx and family }
@@ -544,16 +544,16 @@ type
   NOTIFYICONDATAA* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uID*: UINT
-    uFlags*: UINT
-    uCallbackMessage*: UINT
+    uID*: uint32
+    uFlags*: uint32
+    uCallbackMessage*: uint32
     hIcon*: HICON
-    szTip*: array[0..127, CHAR]
+    szTip*: array[0..127, char]
     dwState*: DWORD
     dwStateMask*: DWORD
-    szInfo*: array[0..255, CHAR]
-    uTimeout*: UINT           # also: uVersion
-    szInfoTitle*: array[0..63, CHAR]
+    szInfo*: array[0..255, char]
+    uTimeout*: uint32           # also: uVersion
+    szInfoTitle*: array[0..63, char]
     dwInfoFlags*: DWORD
     guidItem*: TGUID
 
@@ -562,16 +562,16 @@ type
   NOTIFYICONDATAW* {.final.} = object
     cbSize*: DWORD
     hWnd*: HWND
-    uID*: UINT
-    uFlags*: UINT
-    uCallbackMessage*: UINT
+    uID*: uint32
+    uFlags*: uint32
+    uCallbackMessage*: uint32
     hIcon*: HICON
-    szTip*: array[0..127, WCHAR]
+    szTip*: array[0..127, Wchar]
     dwState*: DWORD
     dwStateMask*: DWORD
-    szInfo*: array[0..255, WCHAR]
-    uTimeout*: UINT           # also uVersion : UINT
-    szInfoTitle*: array[0..63, CHAR]
+    szInfo*: array[0..255, Wchar]
+    uTimeout*: uint32           # also uVersion : UINT
+    szInfoTitle*: array[0..63, char]
     dwInfoFlags*: DWORD
     guidItem*: TGUID
 
@@ -619,13 +619,13 @@ const
   NIIF_ICON_MASK* = 0x0000000F
   NIIF_NOSOUND* = 0x00000010
 
-proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
+proc Shell_NotifyIconA*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
+proc Shell_NotifyIconW*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): Bool{.
+proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAA): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconA".}
-proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): Bool{.
+proc Shell_NotifyIcon*(dwMessage: Dword, lpData: PNOTIFYICONDATAW): bool{.
     stdcall, dynlib: "shell32.dll", importc: "Shell_NotifyIconW".}
   #
   #       The SHGetFileInfo API provides an easy way to get attributes
@@ -652,20 +652,20 @@ type
     hIcon*: HICON             # out: icon
     iIcon*: int32             # out: icon index
     dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, CHAR] # out: display name (or path)
-    szTypeName*: array[0..79, CHAR] # out: type name
+    szDisplayName*: array[0..(MAX_PATH) - 1, char] # out: display name (or path)
+    szTypeName*: array[0..79, char] # out: type name
 
   TSHFILEINFOA* = SHFILEINFOA
-  pSHFILEINFOA* = ptr SHFILEINFOA
+  PSHFILEINFOA* = ptr SHFILEINFOA
   SHFILEINFOW* {.final.} = object
     hIcon*: HICON             # out: icon
     iIcon*: int32             # out: icon index
     dwAttributes*: DWORD      # out: SFGAO_ flags
-    szDisplayName*: array[0..(MAX_PATH) - 1, WCHAR] # out: display name (or path)
-    szTypeName*: array[0..79, WCHAR] # out: type name
+    szDisplayName*: array[0..(MAX_PATH) - 1, Wchar] # out: display name (or path)
+    szTypeName*: array[0..79, Wchar] # out: type name
 
   TSHFILEINFOW* = SHFILEINFOW
-  pSHFILEINFOW* = ptr SHFILEINFOW
+  PSHFILEINFOW* = ptr SHFILEINFOW
 
 when defined(UNICODE):
   type
@@ -701,67 +701,67 @@ const
                                    # in the upper 8 bits of the iIcon
 
 proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: pSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: PSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: pSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: PSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoA*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                     psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: var TSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfoW*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                     psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                     psfi: var TSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetFileInfo*(pszPath: LPCSTR, dwFileAttributes: DWORD,
-                    psfi: var TSHFILEINFOA, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: var TSHFILEINFOA, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoA".}
 proc SHGetFileInfo*(pszPath: LPCWSTR, dwFileAttributes: DWORD,
-                    psfi: var TSHFILEINFOW, cbFileInfo, UFlags: UINT): DWORD{.
+                    psfi: var TSHFILEINFOW, cbFileInfo, UFlags: uint32): DWORD{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetFileInfoW".}
 proc SHGetDiskFreeSpaceExA*(pszDirectoryName: LPCSTR,
-                            pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                            pulTotalNumberOfBytes: pULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                            pulTotalNumberOfBytes: PULARGE_INTEGER,
+                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpaceExW*(pszDirectoryName: LPCWSTR,
-                            pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                            pulTotalNumberOfBytes: pULARGE_INTEGER,
-                            pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                            pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                            pulTotalNumberOfBytes: PULARGE_INTEGER,
+                            pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCSTR,
-                           pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                           pulTotalNumberOfBytes: pULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                           pulTotalNumberOfBytes: PULARGE_INTEGER,
+                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpace*(pszDirectoryName: LPCSTR,
-                         pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                         pulTotalNumberOfBytes: pULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                         pulTotalNumberOfBytes: PULARGE_INTEGER,
+                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExA".}
 proc SHGetDiskFreeSpaceEx*(pszDirectoryName: LPCWSTR,
-                           pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                           pulTotalNumberOfBytes: pULARGE_INTEGER,
-                           pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                           pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                           pulTotalNumberOfBytes: PULARGE_INTEGER,
+                           pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetDiskFreeSpace*(pszDirectoryName: LPCWSTR,
-                         pulFreeBytesAvailableToCaller: pULARGE_INTEGER,
-                         pulTotalNumberOfBytes: pULARGE_INTEGER,
-                         pulTotalNumberOfFreeBytes: pULARGE_INTEGER): Bool{.
+                         pulFreeBytesAvailableToCaller: PULARGE_INTEGER,
+                         pulTotalNumberOfBytes: PULARGE_INTEGER,
+                         pulTotalNumberOfFreeBytes: PULARGE_INTEGER): bool{.
     stdcall, dynlib: "shell32.dll", importc: "SHGetDiskFreeSpaceExW".}
 proc SHGetNewLinkInfoA*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                        pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
 proc SHGetNewLinkInfoW*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                        pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                        pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
 proc SHGetNewLinkInfo*(pszLinkTo: LPCSTR, pszDir: LPCSTR, pszName: LPSTR,
-                       pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoA".}
 proc SHGetNewLinkInfo*(pszLinkTo: LPCWSTR, pszDir: LPCWSTR, pszName: LPWSTR,
-                       pfMustCopy: pBool, uFlags: UINT): Bool{.stdcall,
+                       pfMustCopy: PBool, uFlags: uint32): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHGetNewLinkInfoW".}
 const
   SHGNLI_PIDL* = 0x00000001   # pszLinkTo is a pidl
@@ -777,17 +777,17 @@ const
   PRINTACTION_DOCUMENTDEFAULTS* = 6
   PRINTACTION_SERVERPROPERTIES* = 7
 
-proc SHInvokePrinterCommandA*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
-                              lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommandA*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
+                              lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommandW*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
-                              lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommandW*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
+                              lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
-proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCSTR,
-                             lpBuf2: LPCSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCSTR,
+                             lpBuf2: LPCSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandA".}
-proc SHInvokePrinterCommand*(HWND: hwnd, uAction: UINT, lpBuf1: LPCWSTR,
-                             lpBuf2: LPCWSTR, fModal: Bool): Bool{.stdcall,
+proc SHInvokePrinterCommand*(hwnd: HWND, uAction: uint32, lpBuf1: LPCWSTR,
+                             lpBuf2: LPCWSTR, fModal: bool): bool{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
 proc SHLoadNonloadedIconOverlayIdentifiers*(): HResult{.stdcall,
     dynlib: "shell32.dll", importc: "SHInvokePrinterCommandW".}
diff --git a/lib/windows/shfolder.nim b/lib/windows/shfolder.nim
index 253b1c77a..886d757eb 100644
--- a/lib/windows/shfolder.nim
+++ b/lib/windows/shfolder.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2006 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
diff --git a/lib/windows/windows.nim b/lib/windows/windows.nim
index 5fd9127b3..9008d63e3 100644
--- a/lib/windows/windows.nim
+++ b/lib/windows/windows.nim
@@ -1,6 +1,6 @@
 #

 #

-#            Nimrod's Runtime Library

+#            Nim's Runtime Library

 #        (c) Copyright 2010 Andreas Rumpf

 #

 #    See the file "copying.txt", included in this

@@ -49,15 +49,15 @@ type  # BaseTsd.h -- Type definitions for the basic sized types
   DWORD64* = int64

   PDWORD64* = ptr DWORD64

   # int32 on Win32, int64 on Win64

-  INT_PTR* = TAddress

-  UINT_PTR* = TAddress

-  LONG_PTR* = TAddress

-  ULONG_PTR* = TAddress

-  SIZE_T* = TAddress

-  SSIZE_T* = TAddress

-  DWORD_PTR* = TAddress

+  INT_PTR* = ByteAddress

+  UINT_PTR* = ByteAddress

+  LONG_PTR* = ByteAddress

+  ULONG_PTR* = ByteAddress

+  SIZE_T* = ByteAddress

+  SSIZE_T* = ByteAddress

+  DWORD_PTR* = ByteAddress

   # Thread affinity

-  KAFFINITY* = TAddress

+  KAFFINITY* = ByteAddress

   PKAFFINITY* = ptr KAFFINITY

 

 type  # WinDef.h -- Basic Windows Type Definitions

@@ -74,8 +74,8 @@ type  # WinDef.h -- Basic Windows Type Definitions
   DWORD* = int32

   WINBOOL* = int32

   WORD* = int16

-  # FLOAT* = float

-  PFLOAT* = ptr FLOAT

+  #FLOAT* = float

+  PFLOAT* = ptr float32

   PWINBOOL* = ptr WINBOOL

   LPWINBOOL* = ptr WINBOOL

   PBYTE* = ptr int8

@@ -383,7 +383,7 @@ type
       stdcall.}

   LPCFHOOKPROC* = proc (para1: HWND, para2: WINUINT, para3: WPARAM, para4: LPARAM): WINUINT{.

       stdcall.}

-  PTHREAD_START_ROUTINE* = Pointer

+  PTHREAD_START_ROUTINE* = pointer

   LPTHREAD_START_ROUTINE* = PTHREAD_START_ROUTINE

   EDITSTREAMCALLBACK* = proc (para1: DWORD, para2: LPBYTE, para3: LONG,

                               para4: LONG): DWORD{.stdcall.}

@@ -8415,34 +8415,34 @@ type
                               # dmDisplayFixedOutput: DWORD;

 

   LPDEVMODE* = ptr DEVMODE

-  devicemode* = DEVMODE

-  tdevicemode* = DEVMODE

-  tdevicemodeA* = DEVMODE

+  Devicemode* = DEVMODE

+  TDevicemode* = DEVMODE

+  TDevicemodeA* = DEVMODE

   PDeviceModeA* = LPDEVMODE

   PDeviceMode* = LPDEVMODE

   TDEVMODE* = DEVMODE

   PDEVMODE* = LPDEVMODE

-  devmodeW* {.final, pure.} = object

+  DEVMODEW* {.final, pure.} = object

     dmDeviceName*: array[0..CCHDEVICENAME - 1, WCHAR]

     dmSpecVersion*: int16

     dmDriverVersion*: int16

     dmSize*: int16

     dmDriverExtra*: int16

     dmFields*: DWORD

-    dmOrientation*: short

-    dmPaperSize*: short

-    dmPaperLength*: short

-    dmPaperWidth*: short

-    dmScale*: short

-    dmCopies*: short

-    dmDefaultSource*: short

-    dmPrintQuality*: short

-    dmColor*: short

-    dmDuplex*: short

-    dmYResolution*: short

-    dmTTOption*: short

-    dmCollate*: short

-    dmFormName*: array[0..CCHFORMNAME - 1, wchar]

+    dmOrientation*: SHORT

+    dmPaperSize*: SHORT

+    dmPaperLength*: SHORT

+    dmPaperWidth*: SHORT

+    dmScale*: SHORT

+    dmCopies*: SHORT

+    dmDefaultSource*: SHORT

+    dmPrintQuality*: SHORT

+    dmColor*: SHORT

+    dmDuplex*: SHORT

+    dmYResolution*: SHORT

+    dmTTOption*: SHORT

+    dmCollate*: SHORT

+    dmFormName*: array[0..CCHFORMNAME - 1, WCHAR]

     dmLogPixels*: int16

     dmBitsPerPel*: DWORD

     dmPelsWidth*: DWORD

@@ -8459,7 +8459,7 @@ type
     dmPanningHeight*: DWORD

 

   LPDEVMODEW* = ptr DEVMODEW

-  devicemodeW* = DEVMODEW

+  DevicemodeW* = DEVMODEW

   TDeviceModeW* = DEVMODEW

   PDeviceModeW* = LPDEVMODEW

   TDEVMODEW* = DEVMODEW

@@ -8497,7 +8497,7 @@ type
   LARGE_INTEGER* = int64

   ULARGE_INTEGER* = int64

   PLARGE_INTEGER* = ptr LARGE_INTEGER

-  TLargeInteger* = Int64

+  TLargeInteger* = int64

   PULARGE_INTEGER* = ptr ULARGE_INTEGER

   TULargeInteger* = int64

   DISK_GEOMETRY* {.final, pure.} = object

@@ -10469,7 +10469,7 @@ type
     ncb_name*: array[0..(NCBNAMSZ) - 1, UCHAR]

     ncb_rto*: UCHAR

     ncb_sto*: UCHAR

-    ncb_post*: proc (para1: p_NCB){.CDECL.}

+    ncb_post*: proc (para1: p_NCB){.cdecl.}

     ncb_lana_num*: UCHAR

     ncb_cmd_cplt*: UCHAR

     ncb_reserve*: array[0..9, UCHAR]

@@ -10681,7 +10681,7 @@ type
     nErrCode*: int16

     Reserved1*: int16

     Reserved2*: int16

-    szPathName*: array[0..(OFS_MAXPATHNAME) - 1, CHAR]

+    szPathName*: array[0..(OFS_MAXPATHNAME) - 1, char]

 

   LPOFSTRUCT* = ptr OFSTRUCT

   TOFSTRUCT* = OFSTRUCT

@@ -10725,7 +10725,7 @@ type
     nMaxFileTitle*: DWORD

     lpstrInitialDir*: LPCTSTR

     lpstrTitle*: LPCTSTR

-    Flags*: DWORD

+    flags*: DWORD

     nFileOffset*: int16

     nFileExtension*: int16

     lpstrDefExt*: LPCTSTR

@@ -10733,8 +10733,8 @@ type
     lpfnHook*: LPOFNHOOKPROC

     lpTemplateName*: LPCTSTR

     pvReserved*: pointer

-    dwreserved*: dword

-    FlagsEx*: dword

+    dwreserved*: DWORD

+    FlagsEx*: DWORD

 

   LPOPENFILENAME* = ptr TOPENFILENAME

   POPENFILENAME* = ptr TOPENFILENAME

@@ -11280,8 +11280,8 @@ type
     dwSize*: DWORD

     hrasconn*: HRASCONN

     szEntryName*: array[0..(RAS_MaxEntryName + 1) - 1, TCHAR]

-    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, CHAR]

-    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, CHAR]

+    szDeviceType*: array[0..(RAS_MaxDeviceType + 1) - 1, char]

+    szDeviceName*: array[0..(RAS_MaxDeviceName + 1) - 1, char]

 

   TRASCONN* = RASCONN

   PRASCONN* = ptr RASCONN

@@ -11344,9 +11344,9 @@ type
   TRASPPPNBF* = RASPPPNBF

   PRASPPPNBF* = ptr RASPPPNBF

   RASTERIZER_STATUS* {.final, pure.} = object

-    nSize*: short

-    wFlags*: short

-    nLanguageID*: short

+    nSize*: SHORT

+    wFlags*: SHORT

+    nLanguageID*: SHORT

 

   LPRASTERIZER_STATUS* = ptr RASTERIZER_STATUS

   TRASTERIZERSTATUS* = RASTERIZER_STATUS

@@ -11592,7 +11592,7 @@ type
   PSTRRET* = ptr STRRET

   STYLEBUF* {.final, pure.} = object

     dwStyle*: DWORD

-    szDescription*: array[0..31, CHAR]

+    szDescription*: array[0..31, char]

 

   LPSTYLEBUF* = ptr STYLEBUF

   TSTYLEBUF* = STYLEBUF

@@ -11801,7 +11801,7 @@ type
   TTOGGLEKEYS* = TOGGLEKEYS

   PTOGGLEKEYS* = ptr TOGGLEKEYS

   TTOKEN_SOURCE* {.final, pure.} = object

-    SourceName*: array[0..7, CHAR]

+    SourceName*: array[0..7, char]

     SourceIdentifier*: LUID

 

   PTOKENSOURCE* = ptr TTOKEN_SOURCE

@@ -12366,7 +12366,7 @@ type
     uFlags*: WINUINT

     uCallbackMessage*: WINUINT

     hIcon*: HICON

-    szTip*: array[0..63, Char]

+    szTip*: array[0..63, char]

 

   NOTIFYICONDATA* = NOTIFYICONDATAA

   NOTIFYICONDATAW* {.final, pure.} = object

@@ -13575,7 +13575,7 @@ type
   TWMSysKeyUp* = TWMKey

   TWMMenuChar* {.final, pure.} = object

     Msg*: WINUINT

-    User*: Char

+    User*: char

     MenuFlag*: int16

     Menu*: HMENU

     Result*: LRESULT

@@ -14432,19 +14432,19 @@ proc CharNextA*(lpsz: LPCSTR): LPSTR{.stdcall, dynlib: "user32",
                                       importc: "CharNextA".}

 proc CharPrevA*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall,

     dynlib: "user32", importc: "CharPrevA".}

-proc IsCharAlphaA*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+proc IsCharAlphaA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                        importc: "IsCharAlphaA".}

-proc IsCharAlphaNumericA*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+proc IsCharAlphaNumericA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

     importc: "IsCharAlphaNumericA".}

-proc IsCharUpperA*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+proc IsCharUpperA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                        importc: "IsCharUpperA".}

-proc IsCharLowerA*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+proc IsCharLowerA*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                        importc: "IsCharLowerA".}

 proc GetKeyNameTextA*(lParam: LONG, lpString: LPSTR, nSize: int32): int32{.

     stdcall, dynlib: "user32", importc: "GetKeyNameTextA".}

-proc VkKeyScanA*(ch: CHAR): SHORT{.stdcall, dynlib: "user32",

+proc VkKeyScanA*(ch: char): SHORT{.stdcall, dynlib: "user32",

                                    importc: "VkKeyScanA".}

-proc VkKeyScanExA*(ch: CHAR, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

+proc VkKeyScanExA*(ch: char, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

     importc: "VkKeyScanExA".}

 proc MapVirtualKeyA*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

     dynlib: "user32", importc: "MapVirtualKeyA".}

@@ -14772,7 +14772,7 @@ proc DialogBoxA*(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,
                  lpDialogFunc: DLGPROC): int32

 proc DialogBoxIndirectA*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

                          hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-proc CreateDCA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{.

+proc CreateDCA*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: PDEVMODE): HDC{.

     stdcall, dynlib: "gdi32", importc: "CreateDCA".}

 proc VerInstallFileA*(uFlags: DWORD, szSrcFileName: LPSTR,

                       szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR,

@@ -14933,7 +14933,7 @@ proc WriteConsoleOutputCharacterA*(hConsoleOutput: HANDLE, lpCharacter: LPCSTR,
                                    nLength: DWORD, dwWriteCoord: COORD,

                                    lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-proc FillConsoleOutputCharacterA*(hConsoleOutput: HANDLE, cCharacter: CHAR,

+proc FillConsoleOutputCharacterA*(hConsoleOutput: HANDLE, cCharacter: char,

                                   nLength: DWORD, dwWriteCoord: COORD,

                                   lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

@@ -15896,7 +15896,7 @@ proc DialogBoxW*(hInstance: HINST, lpTemplate: LPCWSTR, hWndParent: HWND,
                  lpDialogFunc: DLGPROC): int32

 proc DialogBoxIndirectW*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

                          hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-proc CreateDCW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODEW): HDC{.

+proc CreateDCW*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: PDEVMODEW): HDC{.

     stdcall, dynlib: "gdi32", importc: "CreateDCW".}

 proc VerInstallFileW*(uFlags: DWORD, szSrcFileName: LPWSTR,

                       szDestFileName: LPWSTR, szSrcDir: LPWSTR,

@@ -17038,7 +17038,7 @@ when defined(winUnicode):
                   lpDialogFunc: DLGPROC): int32

   proc DialogBoxIndirect*(hInstance: HINST, lpTemplate: LPCDLGTEMPLATE,

                           hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-  proc CreateDC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: pDEVMODE): HDC{.

+  proc CreateDC*(para1: LPCWSTR, para2: LPCWSTR, para3: LPCWSTR, para4: PDEVMODE): HDC{.

       stdcall, dynlib: "gdi32", importc: "CreateDCW".}

   proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPWSTR,

                        szDestFileName: LPWSTR, szSrcDir: LPWSTR,

@@ -17825,19 +17825,19 @@ else:
                                        importc: "CharNextA".}

   proc CharPrev*(lpszStart: LPCSTR, lpszCurrent: LPCSTR): LPSTR{.stdcall,

       dynlib: "user32", importc: "CharPrevA".}

-  proc IsCharAlpha*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+  proc IsCharAlpha*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                         importc: "IsCharAlphaA".}

-  proc IsCharAlphaNumeric*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+  proc IsCharAlphaNumeric*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

       importc: "IsCharAlphaNumericA".}

-  proc IsCharUpper*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+  proc IsCharUpper*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                         importc: "IsCharUpperA".}

-  proc IsCharLower*(ch: CHAR): WINBOOL{.stdcall, dynlib: "user32",

+  proc IsCharLower*(ch: char): WINBOOL{.stdcall, dynlib: "user32",

                                         importc: "IsCharLowerA".}

   proc GetKeyNameText*(lParam: LONG, lpString: LPSTR, nSize: int32): int32{.

       stdcall, dynlib: "user32", importc: "GetKeyNameTextA".}

-  proc VkKeyScan*(ch: CHAR): SHORT{.stdcall, dynlib: "user32",

+  proc VkKeyScan*(ch: char): SHORT{.stdcall, dynlib: "user32",

                                     importc: "VkKeyScanA".}

-  proc VkKeyScanEx*(ch: CHAR, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

+  proc VkKeyScanEx*(ch: char, dwhkl: HKL): SHORT{.stdcall, dynlib: "user32",

       importc: "VkKeyScanExA".}

   proc MapVirtualKey*(uCode: WINUINT, uMapType: WINUINT): WINUINT{.stdcall,

       dynlib: "user32", importc: "MapVirtualKeyA".}

@@ -18170,7 +18170,7 @@ else:
                   lpDialogFunc: DLGPROC): int32

   proc DialogBoxIndirect*(hInstance: HINST, hDialogTemplate: LPCDLGTEMPLATE,

                           hWndParent: HWND, lpDialogFunc: DLGPROC): int32

-  proc CreateDC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: pDEVMODE): HDC{.

+  proc CreateDC*(para1: LPCSTR, para2: LPCSTR, para3: LPCSTR, para4: PDEVMODE): HDC{.

       stdcall, dynlib: "gdi32", importc: "CreateDCA".}

   proc VerInstallFile*(uFlags: DWORD, szSrcFileName: LPSTR,

                        szDestFileName: LPSTR, szSrcDir: LPSTR, szDestDir: LPSTR,

@@ -18332,7 +18332,7 @@ else:
                                     nLength: DWORD, dwWriteCoord: COORD,

                                     lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

       stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterA".}

-  proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: CHAR,

+  proc FillConsoleOutputCharacter*(hConsoleOutput: HANDLE, cCharacter: char,

                                    nLength: DWORD, dwWriteCoord: COORD,

                                    lpNumberOfCharsWritten: LPDWORD): WINBOOL{.

       stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

@@ -18513,9 +18513,9 @@ proc DisableThreadLibraryCalls*(hLibModule: HMODULE): WINBOOL{.stdcall,
 proc GetProcAddress*(hModule: HINST, lpProcName: LPCSTR): FARPROC{.stdcall,

     dynlib: "kernel32", importc: "GetProcAddress".}

 proc GetVersion*(): DWORD{.stdcall, dynlib: "kernel32", importc: "GetVersion".}

-proc GlobalAlloc*(uFlags: INT, dwBytes: DWORD): HGLOBAL{.stdcall,

+proc GlobalAlloc*(uFlags: int32, dwBytes: DWORD): HGLOBAL{.stdcall,

     dynlib: "kernel32", importc: "GlobalAlloc".}

-proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: INT): HGLOBAL{.

+proc GlobalReAlloc*(hMem: HGLOBAL, dwBytes: DWORD, uFlags: int32): HGLOBAL{.

     stdcall, dynlib: "kernel32", importc: "GlobalReAlloc".}

 proc GlobalSize*(hMem: HGLOBAL): DWORD{.stdcall, dynlib: "kernel32",

                                         importc: "GlobalSize".}

@@ -19678,7 +19678,7 @@ proc GetSysColor*(nIndex: int32): DWORD{.stdcall, dynlib: "user32",
     importc: "GetSysColor".}

 proc GetSysColorBrush*(nIndex: int32): HBRUSH{.stdcall, dynlib: "user32",

     importc: "GetSysColorBrush".}

-proc SetSysColors*(cElements: int32, lpaElements: var wINT,

+proc SetSysColors*(cElements: int32, lpaElements: var WINT,

                    lpaRgbValues: var COLORREF): WINBOOL{.stdcall,

     dynlib: "user32", importc: "SetSysColors".}

 proc DrawFocusRect*(hDC: HDC, lprc: var RECT): WINBOOL{.stdcall,

@@ -19878,7 +19878,7 @@ proc CreatePen*(para1: int32, para2: int32, para3: COLORREF): HPEN{.stdcall,
     dynlib: "gdi32", importc: "CreatePen".}

 proc CreatePenIndirect*(para1: var LOGPEN): HPEN{.stdcall, dynlib: "gdi32",

     importc: "CreatePenIndirect".}

-proc CreatePolyPolygonRgn*(para1: var POINT, para2: var wINT, para3: int32,

+proc CreatePolyPolygonRgn*(para1: var POINT, para2: var WINT, para3: int32,

                            para4: int32): HRGN{.stdcall, dynlib: "gdi32",

     importc: "CreatePolyPolygonRgn".}

 proc CreatePatternBrush*(para1: HBITMAP): HBRUSH{.stdcall, dynlib: "gdi32",

@@ -20049,7 +20049,7 @@ proc PlayMetaFile*(para1: HDC, para2: HMETAFILE): WINBOOL{.stdcall,
     dynlib: "gdi32", importc: "PlayMetaFile".}

 proc PaintRgn*(para1: HDC, para2: HRGN): WINBOOL{.stdcall, dynlib: "gdi32",

     importc: "PaintRgn".}

-proc PolyPolygon*(para1: HDC, para2: var POINT, para3: var wINT, para4: int32): WINBOOL{.

+proc PolyPolygon*(para1: HDC, para2: var POINT, para3: var WINT, para4: int32): WINBOOL{.

     stdcall, dynlib: "gdi32", importc: "PolyPolygon".}

 proc PtInRegion*(para1: HRGN, para2: int32, para3: int32): WINBOOL{.stdcall,

     dynlib: "gdi32", importc: "PtInRegion".}

@@ -20165,7 +20165,7 @@ proc GetEnhMetaFilePaletteEntries*(para1: HENHMETAFILE, para2: WINUINT,
 proc GetEnhMetaFileBits*(para1: HENHMETAFILE, para2: WINUINT, para3: LPBYTE): WINUINT{.

     stdcall, dynlib: "gdi32", importc: "GetEnhMetaFileBits".}

 proc GetWinMetaFileBits*(para1: HENHMETAFILE, para2: WINUINT, para3: LPBYTE,

-                         para4: wINT, para5: HDC): WINUINT{.stdcall,

+                         para4: WINT, para5: HDC): WINUINT{.stdcall,

     dynlib: "gdi32", importc: "GetWinMetaFileBits".}

 proc PlayEnhMetaFile*(para1: HDC, para2: HENHMETAFILE, para3: RECT): WINBOOL{.

     stdcall, dynlib: "gdi32", importc: "PlayEnhMetaFile".}

@@ -20748,7 +20748,7 @@ proc ListView_GetColumn*(wnd: HWND, iCol: int32, col: var LV_COLUMN): LRESULT
 proc ListView_GetColumnWidth*(wnd: HWND, iCol: int32): LRESULT

 proc ListView_GetCountPerPage*(hwndLV: HWND): LRESULT

 proc ListView_GetEditControl*(hwndLV: HWND): LRESULT

-proc ListView_GetImageList*(wnd: HWND, iImageList: wINT): LRESULT

+proc ListView_GetImageList*(wnd: HWND, iImageList: WINT): LRESULT

 proc ListView_GetISearchString*(hwndLV: HWND, lpsz: LPTSTR): LRESULT

 proc ListView_GetItem*(wnd: HWND, item: var LV_ITEM): LRESULT

 proc ListView_GetItemCount*(wnd: HWND): LRESULT

@@ -20867,13 +20867,13 @@ proc CommDlg_OpenSave_HideControl*(hdlg: HWND, id: int32): LRESULT
 proc CommDlg_OpenSave_SetDefExt*(hdlg: HWND, pszext: LPSTR): LRESULT

 proc GetNextWindow*(wnd: HWND, uCmd: WINUINT): HWND{.stdcall, dynlib: "user32",

     importc: "GetWindow".}

-proc GlobalAllocPtr*(flags, cb: DWord): Pointer

-proc GlobalFreePtr*(lp: Pointer): Pointer

-proc GlobalUnlockPtr*(lp: pointer): Pointer

-proc GlobalLockPtr*(lp: pointer): Pointer

-proc GlobalReAllocPtr*(lp: Pointer, cbNew, flags: DWord): Pointer

-proc GlobalPtrHandle*(lp: pointer): Pointer

-proc SetLayeredWindowAttributes*(HWND: hwnd, crKey: COLORREF, bAlpha: int8,

+proc GlobalAllocPtr*(flags, cb: DWord): pointer

+proc GlobalFreePtr*(lp: pointer): pointer

+proc GlobalUnlockPtr*(lp: pointer): pointer

+proc GlobalLockPtr*(lp: pointer): pointer

+proc GlobalReAllocPtr*(lp: pointer, cbNew, flags: DWord): pointer

+proc GlobalPtrHandle*(lp: pointer): pointer

+proc SetLayeredWindowAttributes*(hwnd: HWND, crKey: COLORREF, bAlpha: int8,

                                  dwFlags: DWORD): WINBOOL{.stdcall,

     dynlib: "user32", importc: "SetLayeredWindowAttributes".}

 type

@@ -21059,21 +21059,21 @@ proc AllocateAndInitializeSid*(pIdentifierAuthority: TSIDIdentifierAuthority,
                                nSubAuthorityCount: int8,

                                nSubAuthority0, nSubAuthority1: DWORD,

     nSubAuthority2, nSubAuthority3, nSubAuthority4: DWORD, nSubAuthority5,

-    nSubAuthority6, nSubAuthority7: DWORD, pSid: var Pointer): WINBOOL{.stdcall,

+    nSubAuthority6, nSubAuthority7: DWORD, pSid: var pointer): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "AllocateAndInitializeSid".}

 proc AllocateLocallyUniqueId*(Luid: var TLargeInteger): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "AllocateLocallyUniqueId".}

 proc BackupRead*(hFile: THandle, lpBuffer: PByte, nNumberOfBytesToRead: DWORD,

                  lpNumberOfBytesRead: var DWORD, bAbort: WINBOOL,

-                 bProcessSecurity: WINBOOL, lpContext: var Pointer): WINBOOL{.

+                 bProcessSecurity: WINBOOL, lpContext: var pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "BackupRead".}

 proc BackupSeek*(hFile: THandle, dwLowBytesToSeek, dwHighBytesToSeek: DWORD,

                  lpdwLowByteSeeked, lpdwHighByteSeeked: var DWORD,

-                 lpContext: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",

+                 lpContext: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "BackupSeek".}

 proc BackupWrite*(hFile: THandle, lpBuffer: PByte, nNumberOfBytesToWrite: DWORD,

                   lpNumberOfBytesWritten: var DWORD,

-                  bAbort, bProcessSecurity: WINBOOL, lpContext: var Pointer): WINBOOL{.

+                  bAbort, bProcessSecurity: WINBOOL, lpContext: var pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "BackupWrite".}

 proc BeginPaint*(wnd: HWND, lpPaint: var TPaintStruct): HDC{.stdcall,

     dynlib: "user32", importc: "BeginPaint".}

@@ -21098,18 +21098,18 @@ proc CallMsgFilterA*(lpMsg: var TMsg, nCode: int): WINBOOL{.stdcall,
     dynlib: "user32", importc: "CallMsgFilterA".}

 proc CallMsgFilterW*(lpMsg: var TMsg, nCode: int): WINBOOL{.stdcall,

     dynlib: "user32", importc: "CallMsgFilterW".}

-proc CallNamedPipe*(lpNamedPipeName: cstring, lpInBuffer: Pointer,

-                    nInBufferSize: DWORD, lpOutBuffer: Pointer,

+proc CallNamedPipe*(lpNamedPipeName: cstring, lpInBuffer: pointer,

+                    nInBufferSize: DWORD, lpOutBuffer: pointer,

                     nOutBufferSize: DWORD, lpBytesRead: var DWORD,

                     nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "CallNamedPipeA".}

-proc CallNamedPipeA*(lpNamedPipeName: LPCSTR, lpInBuffer: Pointer,

-                     nInBufferSize: DWORD, lpOutBuffer: Pointer,

+proc CallNamedPipeA*(lpNamedPipeName: LPCSTR, lpInBuffer: pointer,

+                     nInBufferSize: DWORD, lpOutBuffer: pointer,

                      nOutBufferSize: DWORD, lpBytesRead: var DWORD,

                      nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "CallNamedPipeA".}

-proc CallNamedPipeW*(lpNamedPipeName: LPWSTR, lpInBuffer: Pointer,

-                     nInBufferSize: DWORD, lpOutBuffer: Pointer,

+proc CallNamedPipeW*(lpNamedPipeName: LPWSTR, lpInBuffer: pointer,

+                     nInBufferSize: DWORD, lpOutBuffer: pointer,

                      nOutBufferSize: DWORD, lpBytesRead: var DWORD,

                      nTimeOut: DWORD): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "CallNamedPipeW".}

@@ -21122,15 +21122,15 @@ proc ChangeDisplaySettingsA*(lpDevMode: var TDeviceModeA, dwFlags: DWORD): int32
     stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsA".}

 proc ChangeDisplaySettingsEx*(lpszDeviceName: cstring,

                               lpDevMode: var TDeviceMode, wnd: HWND,

-                              dwFlags: DWORD, lParam: Pointer): int32{.stdcall,

+                              dwFlags: DWORD, lParam: pointer): int32{.stdcall,

     dynlib: "user32", importc: "ChangeDisplaySettingsExA".}

 proc ChangeDisplaySettingsExA*(lpszDeviceName: LPCSTR,

                                lpDevMode: var TDeviceModeA, wnd: HWND,

-                               dwFlags: DWORD, lParam: Pointer): int32{.stdcall,

+                               dwFlags: DWORD, lParam: pointer): int32{.stdcall,

     dynlib: "user32", importc: "ChangeDisplaySettingsExA".}

 proc ChangeDisplaySettingsExW*(lpszDeviceName: LPWSTR,

                                lpDevMode: var TDeviceModeW, wnd: HWND,

-                               dwFlags: DWORD, lParam: Pointer): int32{.stdcall,

+                               dwFlags: DWORD, lParam: pointer): int32{.stdcall,

     dynlib: "user32", importc: "ChangeDisplaySettingsExW".}

 proc ChangeDisplaySettingsW*(lpDevMode: var TDeviceModeW, dwFlags: DWORD): int32{.

     stdcall, dynlib: "user32", importc: "ChangeDisplaySettingsW".}

@@ -21184,8 +21184,8 @@ proc CreateDialogIndirectParam*(hInstance: HINST, lpTemplate: TDlgTemplate,
   #function CreateDialogIndirectParamA(hInstance: HINST; const lpTemplate: TDlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamA';

   #function CreateDialogIndirectParamW(hInstance: HINST; const lpTemplate: TDlgTemplate; hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall; external 'user32' name 'CreateDialogIndirectParamW';

   #function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader; dwUsage: DWORD; InitBits: PChar; var InitInfo: TBitmapInfo; wUsage: WINUINT): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBitmap';

-  #function CreateDIBPatternBrushPt(const p1: Pointer; p2: WINUINT): HBRUSH; stdcall; external 'gdi32' name 'CreateDIBPatternBrushPt';

-  #function CreateDIBSection(DC: HDC; const p2: TBitmapInfo; p3: WINUINT; var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBSection';

+  #function CreateDIBPatternBrushPt(const p1: pointer; p2: WINUINT): HBRUSH; stdcall; external 'gdi32' name 'CreateDIBPatternBrushPt';

+  #function CreateDIBSection(DC: HDC; const p2: TBitmapInfo; p3: WINUINT; var p4: pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall; external 'gdi32' name 'CreateDIBSection';

   #function CreateEllipticRgnIndirect(const p1: TRect): HRGN; stdcall; external 'gdi32' name 'CreateEllipticRgnIndirect';

   #function CreateFontIndirect(const p1: TLogFont): HFONT;stdcall; external 'gdi32' name 'CreateFontIndirectA';

   #function CreateFontIndirectA(const p1: TLogFontA): HFONT; stdcall; external 'gdi32' name 'CreateFontIndirectA';

@@ -21211,39 +21211,39 @@ proc CreatePolyPolygonRgn*(pPtStructs: pointer, pIntArray: pointer, p3, p4: int)
 proc CreateProcess*(lpApplicationName: cstring, lpCommandLine: cstring,

     lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

                     bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                    lpEnvironment: Pointer, lpCurrentDirectory: cstring,

+                    lpEnvironment: pointer, lpCurrentDirectory: cstring,

                     lpStartupInfo: TStartupInfo,

                     lpProcessInformation: var TProcessInformation): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

 proc CreateProcessA*(lpApplicationName: LPCSTR, lpCommandLine: LPCSTR,

     lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

                      bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: Pointer, lpCurrentDirectory: LPCSTR,

+                     lpEnvironment: pointer, lpCurrentDirectory: LPCSTR,

                      lpStartupInfo: TStartupInfo,

                      lpProcessInformation: var TProcessInformation): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "CreateProcessA".}

   #function CreateProcessAsUser(hToken: THandle; lpApplicationName: PChar; lpCommandLine: PChar; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  # lpEnvironment: Pointer; lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL;stdcall; external 'advapi32' name 'CreateProcessAsUserA';

+  # lpEnvironment: pointer; lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL;stdcall; external 'advapi32' name 'CreateProcessAsUserA';

   #function CreateProcessAsUserA(hToken: THandle; lpApplicationName: LPCSTR; lpCommandLine: LPCSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  #  lpEnvironment: Pointer; lpCurrentDirectory: LPCSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserA';

+  #  lpEnvironment: pointer; lpCurrentDirectory: LPCSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserA';

   #function CreateProcessAsUserW(hToken: THandle; lpApplicationName: LPWSTR; lpCommandLine: LPWSTR; lpProcessAttributes: PSecurityAttributes; lpThreadAttributes: PSecurityAttributes; bInheritHandles: WINBOOL; dwCreationFlags: DWORD;

-  #  lpEnvironment: Pointer; lpCurrentDirectory: LPWSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserW';

+  #  lpEnvironment: pointer; lpCurrentDirectory: LPWSTR; const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): WINBOOL; stdcall; external 'advapi32' name 'CreateProcessAsUserW';

 proc CreateProcessW*(lpApplicationName: LPWSTR, lpCommandLine: LPWSTR,

     lpProcessAttributes, lpThreadAttributes: PSecurityAttributes,

                      bInheritHandles: WINBOOL, dwCreationFlags: DWORD,

-                     lpEnvironment: Pointer, lpCurrentDirectory: LPWSTR,

+                     lpEnvironment: pointer, lpCurrentDirectory: LPWSTR,

                      lpStartupInfo: TStartupInfo,

                      lpProcessInformation: var TProcessInformation): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "CreateProcessW".}

   #function CreateRectRgnIndirect(const p1: TRect): HRGN; stdcall; external 'gdi32' name 'CreateRectRgnIndirect';

-proc CreateRemoteThread*(hProcess: THandle, lpThreadAttributes: Pointer,

+proc CreateRemoteThread*(hProcess: THandle, lpThreadAttributes: pointer,

                          dwStackSize: DWORD,

                          lpStartAddress: TFNThreadStartRoutine,

-                         lpParameter: Pointer, dwCreationFlags: DWORD,

+                         lpParameter: pointer, dwCreationFlags: DWORD,

                          lpThreadId: var DWORD): THandle{.stdcall,

     dynlib: "kernel32", importc: "CreateRemoteThread".}

-proc CreateThread*(lpThreadAttributes: Pointer, dwStackSize: DWORD,

-                   lpStartAddress: TFNThreadStartRoutine, lpParameter: Pointer,

+proc CreateThread*(lpThreadAttributes: pointer, dwStackSize: DWORD,

+                   lpStartAddress: TFNThreadStartRoutine, lpParameter: pointer,

                    dwCreationFlags: DWORD, lpThreadId: var DWORD): THandle{.

     stdcall, dynlib: "kernel32", importc: "CreateThread".}

 proc DdeSetQualityOfService*(hWndClient: HWnd,

@@ -21256,8 +21256,8 @@ proc DescribePixelFormat*(DC: HDC, p2: int, p3: WINUINT,
     dynlib: "gdi32", importc: "DescribePixelFormat".}

   #function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): WINBOOL; stdcall; external 'advapi32' name 'DestroyPrivateObjectSecurity';

 proc DeviceIoControl*(hDevice: THandle, dwIoControlCode: DWORD,

-                      lpInBuffer: Pointer, nInBufferSize: DWORD,

-                      lpOutBuffer: Pointer, nOutBufferSize: DWORD,

+                      lpInBuffer: pointer, nInBufferSize: DWORD,

+                      lpOutBuffer: pointer, nOutBufferSize: DWORD,

                       lpBytesReturned: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "DeviceIoControl".}

 proc DialogBoxIndirectParam*(hInstance: HINST, lpDialogTemplate: TDlgTemplate,

@@ -21311,9 +21311,9 @@ proc DrawTextW*(hDC: HDC, lpString: LPWSTR, nCount: int, lpRect: var TRect,
   #  stdcall; external 'advapi32' name 'DuplicateTokenEx';

 proc EndPaint*(wnd: HWND, lpPaint: TPaintStruct): WINBOOL{.stdcall,

     dynlib: "user32", importc: "EndPaint".}

-  #function EnumDisplayDevices(Unused: Pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDevice; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

-  #function EnumDisplayDevicesA(Unused: Pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceA; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

-  #function EnumDisplayDevicesW(Unused: Pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceW; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesW';

+  #function EnumDisplayDevices(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDevice; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

+  #function EnumDisplayDevicesA(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceA; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesA';

+  #function EnumDisplayDevicesW(Unused: pointer; iDevNum: DWORD; var lpDisplayDevice: TDisplayDeviceW; dwFlags: DWORD): WINBOOL;stdcall; external 'user32' name 'EnumDisplayDevicesW';

 proc EnumDisplaySettings*(lpszDeviceName: cstring, iModeNum: DWORD,

                           lpDevMode: var TDeviceMode): WINBOOL{.stdcall,

     dynlib: "user32", importc: "EnumDisplaySettingsA".}

@@ -21323,13 +21323,13 @@ proc EnumDisplaySettingsA*(lpszDeviceName: LPCSTR, iModeNum: DWORD,
 proc EnumDisplaySettingsW*(lpszDeviceName: LPWSTR, iModeNum: DWORD,

                            lpDevMode: var TDeviceModeW): WINBOOL{.stdcall,

     dynlib: "user32", importc: "EnumDisplaySettingsW".}

-  #function EnumEnhMetaFile(DC: HDC; p2: HENHMETAFILE; p3: TFNEnhMFEnumProc; p4: Pointer; const p5: TRect): WINBOOL; stdcall; external 'gdi32' name 'EnumEnhMetaFile';

+  #function EnumEnhMetaFile(DC: HDC; p2: HENHMETAFILE; p3: TFNEnhMFEnumProc; p4: pointer; const p5: TRect): WINBOOL; stdcall; external 'gdi32' name 'EnumEnhMetaFile';

   #function EnumFontFamiliesEx(DC: HDC; var p2: TLogFont; p3: TFNFontEnumProc; p4: LPARAM; p5: DWORD): WINBOOL;stdcall; external 'gdi32' name 'EnumFontFamiliesExA';

   #function EnumFontFamiliesExA(DC: HDC; var p2: TLogFontA; p3: TFNFontEnumProcA; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExA';

   #function EnumFontFamiliesExW(DC: HDC; var p2: TLogFontW; p3: TFNFontEnumProcW; p4: LPARAM; p5: DWORD): WINBOOL; stdcall; external 'gdi32' name 'EnumFontFamiliesExW';

   #function EqualRect(const lprc1, lprc2: TRect): WINBOOL; stdcall; external 'user32' name 'EqualRect';

 proc ExtCreatePen*(PenStyle, Width: DWORD, Brush: TLogBrush, StyleCount: DWORD,

-                   Style: Pointer): HPEN{.stdcall, dynlib: "gdi32",

+                   Style: pointer): HPEN{.stdcall, dynlib: "gdi32",

     importc: "ExtCreatePen".}

 proc ExtCreateRegion*(p1: PXForm, p2: DWORD, p3: TRgnData): HRGN{.stdcall,

     dynlib: "gdi32", importc: "ExtCreateRegion".}

@@ -21346,7 +21346,7 @@ proc FillConsoleOutputAttribute*(hConsoleOutput: THandle, wAttribute: int16,
                                  nLength: DWORD, dwWriteCoord: TCoord,

                                  lpNumberOfAttrsWritten: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FillConsoleOutputAttribute".}

-proc FillConsoleOutputCharacter*(hConsoleOutput: THandle, cCharacter: Char,

+proc FillConsoleOutputCharacter*(hConsoleOutput: THandle, cCharacter: char,

                                  nLength: DWORD, dwWriteCoord: TCoord,

                                  lpNumberOfCharsWritten: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FillConsoleOutputCharacterA".}

@@ -21365,18 +21365,18 @@ proc FindFirstFileA*(lpFileName: LPCSTR, lpFindFileData: var TWIN32FindDataA): T
     stdcall, dynlib: "kernel32", importc: "FindFirstFileA".}

 proc FindFirstFileW*(lpFileName: LPWSTR, lpFindFileData: var TWIN32FindDataW): THandle{.

     stdcall, dynlib: "kernel32", importc: "FindFirstFileW".}

-  #function FindFirstFreeAce(var pAcl: TACL; var pAce: Pointer): WINBOOL; stdcall; external 'advapi32' name 'FindFirstFreeAce';

+  #function FindFirstFreeAce(var pAcl: TACL; var pAce: pointer): WINBOOL; stdcall; external 'advapi32' name 'FindFirstFreeAce';

 proc FindNextFile*(hFindFile: THandle, lpFindFileData: var TWIN32FindData): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

 proc FindNextFileA*(hFindFile: THandle, lpFindFileData: var TWIN32FindDataA): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FindNextFileA".}

 proc FindNextFileW*(hFindFile: THandle, lpFindFileData: var TWIN32FindDataW): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "FindNextFileW".}

-  #function FlushInstructionCache(hProcess: THandle; const lpBaseAddress: Pointer; dwSize: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushInstructionCache';

-  #function FlushViewOfFile(const lpBaseAddress: Pointer; dwNumberOfBytesToFlush: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushViewOfFile';

+  #function FlushInstructionCache(hProcess: THandle; const lpBaseAddress: pointer; dwSize: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushInstructionCache';

+  #function FlushViewOfFile(const lpBaseAddress: pointer; dwNumberOfBytesToFlush: DWORD): WINBOOL; stdcall; external 'kernel32' name 'FlushViewOfFile';

   #function FrameRect(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall; external 'user32' name 'FrameRect';

-  #function GetAce(const pAcl: TACL; dwAceIndex: DWORD; var pAce: Pointer): WINBOOL; stdcall; external 'advapi32' name 'GetAce';

-  #function GetAclInformation(const pAcl: TACL; pAclInformation: Pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'GetAclInformation';

+  #function GetAce(const pAcl: TACL; dwAceIndex: DWORD; var pAce: pointer): WINBOOL; stdcall; external 'advapi32' name 'GetAce';

+  #function GetAclInformation(const pAcl: TACL; pAclInformation: pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'GetAclInformation';

   #function GetAltTabInfo(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: PChar; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';

   #function GetAltTabInfoA(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPCSTR; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoA';

   #function GetAltTabInfoW(wnd: HWND; iItem: Integer; var pati: TAltTabInfo; pszItemText: LPWSTR; cchItemText: WINUINT): WINBOOL;stdcall; external 'user32' name 'GetAltTabInfoW';

@@ -21507,7 +21507,7 @@ proc GetDefaultCommConfigW*(lpszName: LPWSTR, lpCC: var TCommConfig,
 proc GetDIBColorTable*(DC: HDC, p2, p3: WINUINT, RGBQuadStructs: pointer): WINUINT{.

     stdcall, dynlib: "gdi32", importc: "GetDIBColorTable".}

 proc GetDIBits*(DC: HDC, Bitmap: HBitmap, StartScan, NumScans: WINUINT,

-                Bits: Pointer, BitInfo: var TBitmapInfo, Usage: WINUINT): int{.

+                Bits: pointer, BitInfo: var TBitmapInfo, Usage: WINUINT): int{.

     stdcall, dynlib: "gdi32", importc: "GetDIBits".}

 proc GetDiskFreeSpace*(lpRootPathName: cstring, lpSectorsPerCluster,

     lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: var DWORD): WINBOOL{.

@@ -21531,13 +21531,13 @@ proc GetDiskFreeSpaceW*(lpRootPathName: LPWSTR, lpSectorsPerCluster,
     lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceW".}

 proc GetDiskFreeSpaceEx*(lpDirectoryName: cstring, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: pLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

+    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

 proc GetDiskFreeSpaceExA*(lpDirectoryName: LPCSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: pLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

+    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExA".}

 proc GetDiskFreeSpaceExW*(lpDirectoryName: LPWSTR, lpFreeBytesAvailableToCaller,

-    lpTotalNumberOfBytes: pLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

+    lpTotalNumberOfBytes: PLargeInteger, lpTotalNumberOfFreeBytes: PLargeInteger): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "GetDiskFreeSpaceExW".}

   #function GetEnhMetaFilePixelFormat(p1: HENHMETAFILE; p2: Cardinal; var p3: TPixelFormatDescriptor): WINUINT;stdcall; external 'gdi32' name 'GetEnhMetaFilePixelFormat';

 proc GetExitCodeProcess*(hProcess: THandle, lpExitCode: var DWORD): WINBOOL{.

@@ -21560,13 +21560,13 @@ proc GetFileVersionInfoSizeW*(lptstrFilename: LPWSTR, lpdwHandle: var DWORD): DW
   # function GetFullPathNameA(lpFileName: LPCSTR; nBufferLength: DWORD; lpBuffer: LPCSTR; var lpFilePart: LPCSTR): DWORD; stdcall; external 'kernel32' name 'GetFullPathNameA';

   # function GetFullPathNameW(lpFileName: LPWSTR; nBufferLength: DWORD; lpBuffer: LPWSTR; var lpFilePart: LPWSTR): DWORD; stdcall; external 'kernel32' name 'GetFullPathNameW';

 proc GetGlyphOutline*(DC: HDC, p2, p3: WINUINT, p4: TGlyphMetrics, p5: DWORD,

-                      p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

+                      p6: pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

     importc: "GetGlyphOutlineA".}

 proc GetGlyphOutlineA*(DC: HDC, p2, p3: WINUINT, p4: TGlyphMetrics, p5: DWORD,

-                       p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

+                       p6: pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

     importc: "GetGlyphOutlineA".}

 proc GetGlyphOutlineW*(DC: HDC, p2, p3: WINUINT, p4: TGlyphMetrics, p5: DWORD,

-                       p6: Pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

+                       p6: pointer, p7: TMat2): DWORD{.stdcall, dynlib: "gdi32",

     importc: "GetGlyphOutlineW".}

   #function GetGUIThreadInfo(idThread: DWORD; var pgui: TGUIThreadinfo): WINBOOL;stdcall; external 'user32' name 'GetGUIThreadInfo';

 proc GetHandleInformation*(hObject: THandle, lpdwFlags: var DWORD): WINBOOL{.

@@ -21600,9 +21600,9 @@ proc GetLogColorSpaceA*(p1: HCOLORSPACE, ColorSpace: var TLogColorSpaceA,
                         Size: DWORD): WINBOOL{.stdcall, dynlib: "gdi32",

     importc: "GetLogColorSpaceA".}

   #function GetLogColorSpaceW(p1: HCOLORSPACE; var ColorSpace: TLogColorSpaceW; Size: DWORD): WINBOOL; stdcall; external 'gdi32' name 'GetLogColorSpaceW';

-proc GetMailslotInfo*(hMailslot: THandle, lpMaxMessageSize: Pointer,

+proc GetMailslotInfo*(hMailslot: THandle, lpMaxMessageSize: pointer,

                       lpNextSize: var DWORD,

-                      lpMessageCount, lpReadTimeout: Pointer): WINBOOL{.stdcall,

+                      lpMessageCount, lpReadTimeout: pointer): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "GetMailslotInfo".}

   #function GetMenuBarInfo(hend: HWND; idObject, idItem: Longint; var pmbi: TMenuBarInfo): WINBOOL;stdcall; external 'user32' name 'GetMenuBarInfo';

   #function GetMenuInfo(menu: HMENU; var lpmi: TMenuInfo): WINBOOL;stdcall; external 'user32' name 'GetMenuInfo';

@@ -21625,7 +21625,7 @@ proc GetMiterLimit*(DC: HDC, Limit: var float32): WINBOOL{.stdcall,
     dynlib: "gdi32", importc: "GetMiterLimit".}

   #function GetMouseMovePoints(cbSize: WINUINT; var lppt, lpptBuf: TMouseMovePoint; nBufPoints: Integer; resolution: DWORD): Integer;stdcall; external 'user32' name 'GetMouseMovePoints';

 proc GetNamedPipeInfo*(hNamedPipe: THandle, lpFlags: var DWORD,

-                       lpOutBufferSize, lpInBufferSize, lpMaxInstances: Pointer): WINBOOL{.

+                       lpOutBufferSize, lpInBufferSize, lpMaxInstances: pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "GetNamedPipeInfo".}

 proc GetNumberOfConsoleInputEvents*(hConsoleInput: THandle,

                                     lpNumberOfEvents: var DWORD): WINBOOL{.

@@ -21738,11 +21738,11 @@ proc GetTabbedTextExtentW*(hDC: HDC, lpString: LPWSTR,
                            lpnTabStopPositions: pointer): DWORD{.stdcall,

     dynlib: "user32", importc: "GetTabbedTextExtentW".}

 proc GetTapeParameters*(hDevice: THandle, dwOperation: DWORD,

-                        lpdwSize: var DWORD, lpTapeInformation: Pointer): DWORD{.

+                        lpdwSize: var DWORD, lpTapeInformation: pointer): DWORD{.

     stdcall, dynlib: "kernel32", importc: "GetTapeParameters".}

 proc GetTapePosition*(hDevice: THandle, dwPositionType: DWORD,

                       lpdwPartition, lpdwOffsetLow: var DWORD,

-                      lpdwOffsetHigh: Pointer): DWORD{.stdcall,

+                      lpdwOffsetHigh: pointer): DWORD{.stdcall,

     dynlib: "kernel32", importc: "GetTapePosition".}

 proc GetTextExtentExPoint*(DC: HDC, p2: cstring, p3, p4: int, p5, p6: PInteger,

                            p7: var TSize): WINBOOL{.stdcall, dynlib: "gdi32",

@@ -21784,7 +21784,7 @@ proc GetThreadTimes*(hThread: THandle, lpCreationTime, lpExitTime, lpKernelTime,
 proc GetTimeZoneInformation*(lpTimeZoneInformation: var TTimeZoneInformation): DWORD{.

     stdcall, dynlib: "kernel32", importc: "GetTimeZoneInformation".}

   #function GetTitleBarInfo(wnd: HWND; var pti: TTitleBarInfo): WINBOOL;stdcall; external 'user32' name 'GetTitleBarInfo';

-  #function GetTokenInformation(TokenHandle: THandle; TokenInformationClass: TTokenInformationClass; TokenInformation: Pointer; TokenInformationLength: DWORD; var ReturnLength: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetTokenInformation';

+  #function GetTokenInformation(TokenHandle: THandle; TokenInformationClass: TTokenInformationClass; TokenInformation: pointer; TokenInformationLength: DWORD; var ReturnLength: DWORD): WINBOOL; stdcall; external 'advapi32' name 'GetTokenInformation';

 proc GetUpdateRect*(wnd: HWND, lpRect: var TRect, bErase: WINBOOL): WINBOOL{.

     stdcall, dynlib: "user32", importc: "GetUpdateRect".}

 proc GetUserName*(lpBuffer: cstring, nSize: var DWORD): WINBOOL{.stdcall,

@@ -21793,13 +21793,13 @@ proc GetUserNameA*(lpBuffer: LPCSTR, nSize: var DWORD): WINBOOL{.stdcall,
     dynlib: "advapi32", importc: "GetUserNameA".}

 proc GetUserNameW*(lpBuffer: LPWSTR, nSize: var DWORD): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "GetUserNameW".}

-proc GetUserObjectInformation*(hObj: THandle, nIndex: int, pvInfo: Pointer,

+proc GetUserObjectInformation*(hObj: THandle, nIndex: int, pvInfo: pointer,

                                nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-proc GetUserObjectInformationA*(hObj: THandle, nIndex: int, pvInfo: Pointer,

+proc GetUserObjectInformationA*(hObj: THandle, nIndex: int, pvInfo: pointer,

                                 nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "user32", importc: "GetUserObjectInformationA".}

-proc GetUserObjectInformationW*(hObj: THandle, nIndex: int, pvInfo: Pointer,

+proc GetUserObjectInformationW*(hObj: THandle, nIndex: int, pvInfo: pointer,

                                 nLength: DWORD, lpnLengthNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "user32", importc: "GetUserObjectInformationW".}

 proc GetUserObjectSecurity*(hObj: THandle, pSIRequested: var DWORD,

@@ -21845,7 +21845,7 @@ proc GetWindowRect*(wnd: HWND, lpRect: var TRect): WINBOOL{.stdcall,
     dynlib: "user32", importc: "GetWindowRect".}

 proc GetWorldTransform*(DC: HDC, p2: var TXForm): WINBOOL{.stdcall,

     dynlib: "gdi32", importc: "GetWorldTransform".}

-  #function GradientFill(DC: HDC; var p2: TTriVertex; p3: ULONG; p4: Pointer; p5, p6: ULONG): WINBOOL;stdcall; external 'gdi32' name 'GradientFill';

+  #function GradientFill(DC: HDC; var p2: TTriVertex; p3: ULONG; p4: pointer; p5, p6: ULONG): WINBOOL;stdcall; external 'gdi32' name 'GradientFill';

 proc GlobalMemoryStatus*(Buffer: var MEMORYSTATUS){.stdcall, dynlib: "kernel32",

     importc: "GlobalMemoryStatus".}

 proc HeapWalk*(hHeap: THandle, lpEntry: var TProcessHeapEntry): WINBOOL{.

@@ -21856,7 +21856,7 @@ proc InflateRect*(lprc: var TRect, dx, dy: int): WINBOOL{.stdcall,
     dynlib: "user32", importc: "InflateRect".}

 proc InitializeAcl*(pAcl: var TACL, nAclLength, dwAclRevision: DWORD): WINBOOL{.

     stdcall, dynlib: "advapi32", importc: "InitializeAcl".}

-proc InitializeSid*(Sid: Pointer, pIdentifierAuthority: TSIDIdentifierAuthority,

+proc InitializeSid*(Sid: pointer, pIdentifierAuthority: TSIDIdentifierAuthority,

                     nSubAuthorityCount: int8): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "InitializeSid".}

 proc InsertMenuItemA*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: TMenuItemInfoA): WINBOOL{.

@@ -21958,7 +21958,7 @@ proc MakeAbsoluteSD*(pSelfRelativeSecurityDescriptor: PSecurityDescriptor,
                      pDacl: var TACL, lpdwDaclSize: var DWORD, pSacl: var TACL,

 

                      lpdwSaclSize: var DWORD, pOwner: PSID,

-                     lpdwOwnerSize: var DWORD, pPrimaryGroup: Pointer,

+                     lpdwOwnerSize: var DWORD, pPrimaryGroup: pointer,

                      lpdwPrimaryGroupSize: var DWORD): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "MakeAbsoluteSD".}

 proc MakeSelfRelativeSD*(pAbsoluteSecurityDescriptor: PSecurityDescriptor,

@@ -21983,7 +21983,7 @@ proc MsgWaitForMultipleObjectsEx*(nCount: DWORD, pHandles: pointer,
                                   dwMilliseconds, dwWakeMask, dwFlags: DWORD): DWORD{.

     stdcall, dynlib: "user32", importc: "MsgWaitForMultipleObjectsEx".}

   # function MultiByteToWideChar(CodePage: WINUINT; dwFlags: DWORD; const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; lLPWSTRStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; external 'kernel32' name 'MultiByteToWideChar';

-proc ObjectOpenAuditAlarm*(SubsystemName: cstring, HandleId: Pointer,

+proc ObjectOpenAuditAlarm*(SubsystemName: cstring, HandleId: pointer,

                            ObjectTypeName: cstring, ObjectName: cstring,

                            pSecurityDescriptor: PSecurityDescriptor,

                            ClientToken: THandle,

@@ -21992,7 +21992,7 @@ proc ObjectOpenAuditAlarm*(SubsystemName: cstring, HandleId: Pointer,
                            ObjectCreation, AccessGranted: WINBOOL,

                            GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-proc ObjectOpenAuditAlarmA*(SubsystemName: LPCSTR, HandleId: Pointer,

+proc ObjectOpenAuditAlarmA*(SubsystemName: LPCSTR, HandleId: pointer,

                             ObjectTypeName: LPCSTR, ObjectName: LPCSTR,

                             pSecurityDescriptor: PSecurityDescriptor,

                             ClientToken: THandle,

@@ -22001,7 +22001,7 @@ proc ObjectOpenAuditAlarmA*(SubsystemName: LPCSTR, HandleId: Pointer,
                             ObjectCreation, AccessGranted: WINBOOL,

                             GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "ObjectOpenAuditAlarmA".}

-proc ObjectOpenAuditAlarmW*(SubsystemName: LPWSTR, HandleId: Pointer,

+proc ObjectOpenAuditAlarmW*(SubsystemName: LPWSTR, HandleId: pointer,

                             ObjectTypeName: LPWSTR, ObjectName: LPWSTR,

                             pSecurityDescriptor: PSecurityDescriptor,

                             ClientToken: THandle,

@@ -22010,17 +22010,17 @@ proc ObjectOpenAuditAlarmW*(SubsystemName: LPWSTR, HandleId: Pointer,
                             ObjectCreation, AccessGranted: WINBOOL,

                             GenerateOnClose: var WINBOOL): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "ObjectOpenAuditAlarmW".}

-proc ObjectPrivilegeAuditAlarm*(SubsystemName: cstring, HandleId: Pointer,

+proc ObjectPrivilegeAuditAlarm*(SubsystemName: cstring, HandleId: pointer,

                                 ClientToken: THandle, DesiredAccess: DWORD,

                                 Privileges: var TPrivilegeSet,

                                 AccessGranted: WINBOOL): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-proc ObjectPrivilegeAuditAlarmA*(SubsystemName: LPCSTR, HandleId: Pointer,

+proc ObjectPrivilegeAuditAlarmA*(SubsystemName: LPCSTR, HandleId: pointer,

                                  ClientToken: THandle, DesiredAccess: DWORD,

                                  Privileges: var TPrivilegeSet,

                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,

     dynlib: "advapi32", importc: "ObjectPrivilegeAuditAlarmA".}

-proc ObjectPrivilegeAuditAlarmW*(SubsystemName: LPWSTR, HandleId: Pointer,

+proc ObjectPrivilegeAuditAlarmW*(SubsystemName: LPWSTR, HandleId: pointer,

                                  ClientToken: THandle, DesiredAccess: DWORD,

                                  Privileges: var TPrivilegeSet,

                                  AccessGranted: WINBOOL): WINBOOL{.stdcall,

@@ -22111,21 +22111,21 @@ proc QueryPerformanceCounter*(lpPerformanceCount: var TLargeInteger): WINBOOL{.
     stdcall, dynlib: "kernel32", importc: "QueryPerformanceCounter".}

 proc QueryPerformanceFrequency*(lpFrequency: var TLargeInteger): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "QueryPerformanceFrequency".}

-  #function QueryRecoveryAgents(p1: PChar; var p2: Pointer; var p3: TRecoveryAgentInformation): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

-  #function QueryRecoveryAgentsA(p1: LPCSTR; var p2: Pointer; var p3: TRecoveryAgentInformationA): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

-  #function QueryRecoveryAgentsW(p1: LPWSTR; var p2: Pointer; var p3: TRecoveryAgentInformationW): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsW';

+  #function QueryRecoveryAgents(p1: PChar; var p2: pointer; var p3: TRecoveryAgentInformation): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

+  #function QueryRecoveryAgentsA(p1: LPCSTR; var p2: pointer; var p3: TRecoveryAgentInformationA): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsA';

+  #function QueryRecoveryAgentsW(p1: LPWSTR; var p2: pointer; var p3: TRecoveryAgentInformationW): DWORD;stdcall; external 'kernel32' name 'QueryRecoveryAgentsW';

 proc RaiseException*(dwExceptionCode: DWORD, dwExceptionFlags: DWORD,

                      nNumberOfArguments: DWORD, lpArguments: var DWORD){.

     stdcall, dynlib: "kernel32", importc: "RaiseException".}

 proc UnhandledExceptionFilter*(ExceptionInfo: var emptyrecord): LONG{.stdcall,

     dynlib: "kernel32", importc: "UnhandledExceptionFilter".}

-proc ReadConsole*(hConsoleInput: THandle, lpBuffer: Pointer,

+proc ReadConsole*(hConsoleInput: THandle, lpBuffer: pointer,

                   nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                  lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",

+                  lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "ReadConsoleA".}

-proc ReadConsoleA*(hConsoleInput: THandle, lpBuffer: Pointer,

+proc ReadConsoleA*(hConsoleInput: THandle, lpBuffer: pointer,

                    nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                   lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",

+                   lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "ReadConsoleA".}

 proc ReadConsoleInput*(hConsoleInput: THandle, lpBuffer: var TInputRecord,

                        nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

@@ -22136,15 +22136,15 @@ proc ReadConsoleInputA*(hConsoleInput: THandle, lpBuffer: var TInputRecord,
 proc ReadConsoleInputW*(hConsoleInput: THandle, lpBuffer: var TInputRecord,

                         nLength: DWORD, lpNumberOfEventsRead: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}

-proc ReadConsoleOutput*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc ReadConsoleOutput*(hConsoleOutput: THandle, lpBuffer: pointer,

                         dwBufferSize, dwBufferCoord: TCoord,

                         lpReadRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-proc ReadConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc ReadConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: pointer,

                          dwBufferSize, dwBufferCoord: TCoord,

                          lpReadRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "ReadConsoleOutputA".}

-proc ReadConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: Pointer,

+proc ReadConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: pointer,

                                  nLength: DWORD, dwReadCoord: TCoord,

                                  lpNumberOfAttrsRead: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputAttribute".}

@@ -22160,31 +22160,31 @@ proc ReadConsoleOutputCharacterW*(hConsoleOutput: THandle, lpCharacter: LPCSTR,
                                   nLength: DWORD, dwReadCoord: TCoord,

                                   lpNumberOfCharsRead: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "ReadConsoleOutputCharacterW".}

-proc ReadConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc ReadConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: pointer,

                          dwBufferSize, dwBufferCoord: TCoord,

                          lpReadRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "ReadConsoleOutputW".}

-proc ReadConsoleW*(hConsoleInput: THandle, lpBuffer: Pointer,

+proc ReadConsoleW*(hConsoleInput: THandle, lpBuffer: pointer,

                    nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: var DWORD,

-                   lpReserved: Pointer): WINBOOL{.stdcall, dynlib: "kernel32",

+                   lpReserved: pointer): WINBOOL{.stdcall, dynlib: "kernel32",

     importc: "ReadConsoleW".}

 proc ReadEventLog*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,

-                   lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,

+                   lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

                    pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}

 proc ReadEventLogA*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,

-                    lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,

+                    lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

                     pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "advapi32", importc: "ReadEventLogA".}

 proc ReadEventLogW*(hEventLog: THandle, dwReadFlags, dwRecordOffset: DWORD,

-                    lpBuffer: Pointer, nNumberOfBytesToRead: DWORD,

+                    lpBuffer: pointer, nNumberOfBytesToRead: DWORD,

                     pnBytesRead, pnMinNumberOfBytesNeeded: var DWORD): WINBOOL{.

     stdcall, dynlib: "advapi32", importc: "ReadEventLogW".}

 proc ReadFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: DWORD,

                lpNumberOfBytesRead: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "ReadFile".}

-proc ReadProcessMemory*(hProcess: THandle, lpBaseAddress: Pointer,

-                        lpBuffer: Pointer, nSize: DWORD,

+proc ReadProcessMemory*(hProcess: THandle, lpBaseAddress: pointer,

+                        lpBuffer: pointer, nSize: DWORD,

                         lpNumberOfBytesRead: var DWORD): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "ReadProcessMemory".}

   #function RectInRegion(RGN: HRGN; const p2: TRect): WINBOOL; stdcall; external 'gdi32' name 'RectInRegion';

@@ -22217,27 +22217,27 @@ proc RegCreateKeyExW*(key: HKEY, lpSubKey: LPWSTR, Reserved: DWORD,
 proc RegCreateKeyW*(key: HKEY, lpSubKey: LPWSTR, phkResult: var HKEY): int32{.

     stdcall, dynlib: "advapi32", importc: "RegCreateKeyW".}

 proc RegEnumKeyEx*(key: HKEY, dwIndex: DWORD, lpName: cstring,

-                   lpcbName: var DWORD, lpReserved: Pointer, lpClass: cstring,

+                   lpcbName: var DWORD, lpReserved: pointer, lpClass: cstring,

                    lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

 proc RegEnumKeyExA*(key: HKEY, dwIndex: DWORD, lpName: LPCSTR,

-                    lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPCSTR,

+                    lpcbName: var DWORD, lpReserved: pointer, lpClass: LPCSTR,

                     lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumKeyExA".}

 proc RegEnumKeyExW*(key: HKEY, dwIndex: DWORD, lpName: LPWSTR,

-                    lpcbName: var DWORD, lpReserved: Pointer, lpClass: LPWSTR,

+                    lpcbName: var DWORD, lpReserved: pointer, lpClass: LPWSTR,

                     lpcbClass: PDWORD, lpftLastWriteTime: PFileTime): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumKeyExW".}

 proc RegEnumValue*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                   lpcbValueName: var DWORD, lpReserved: Pointer,

+                   lpcbValueName: var DWORD, lpReserved: pointer,

                    lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

 proc RegEnumValueA*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                    lpcbValueName: var DWORD, lpReserved: Pointer,

+                    lpcbValueName: var DWORD, lpReserved: pointer,

                     lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumValueA".}

 proc RegEnumValueW*(key: HKEY, dwIndex: DWORD, lpValueName: cstring,

-                    lpcbValueName: var DWORD, lpReserved: Pointer,

+                    lpcbValueName: var DWORD, lpReserved: pointer,

                     lpType: PDWORD, lpData: PByte, lpcbData: PDWORD): int32{.

     stdcall, dynlib: "advapi32", importc: "RegEnumValueW".}

 proc RegGetKeySecurity*(key: HKEY, SecurityInformation: SECURITY_INFORMATION,

@@ -22324,10 +22324,10 @@ proc ScrollConsoleScreenBufferW*(hConsoleOutput: THandle,
                                  lpFill: var TCharInfo): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "ScrollConsoleScreenBufferW".}

 proc ScrollWindow*(wnd: HWND, XAmount: int32, YAmount: int32, rect: LPRECT,

-                   lpClipRect: lpRECT): WINBOOL{.stdcall, dynlib: "user32",

+                   lpClipRect: LPRECT): WINBOOL{.stdcall, dynlib: "user32",

     importc: "ScrollWindow".}

-proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: lpRECT,

-                     prcClip: lpRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,

+proc ScrollWindowEx*(wnd: HWND, dx: int32, dy: int32, prcScroll: LPRECT,

+                     prcClip: LPRECT, hrgnUpdate: HRGN, prcUpdate: LPRECT,

                      flags: WINUINT): int32{.stdcall, dynlib: "user32",

     importc: "ScrollWindowEx".}

   #function ScrollDC(DC: HDC; DX, DY: Integer; var Scroll, Clip: TRect; Rgn: HRGN; Update: PRect): WINBOOL; stdcall; external 'user32' name 'ScrollDC';

@@ -22344,7 +22344,7 @@ proc SendMessageTimeoutA*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,
 proc SendMessageTimeoutW*(wnd: HWND, Msg: WINUINT, wp: WPARAM, lp: LPARAM,

                           fuFlags, uTimeout: WINUINT, lpdwResult: var DWORD): LRESULT{.

     stdcall, dynlib: "user32", importc: "SendMessageTimeoutW".}

-  #function SetAclInformation(var pAcl: TACL; pAclInformation: Pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'SetAclInformation';

+  #function SetAclInformation(var pAcl: TACL; pAclInformation: pointer; nAclInformationLength: DWORD; dwAclInformationClass: TAclInformationClass): WINBOOL; stdcall; external 'advapi32' name 'SetAclInformation';

   #function SetColorAdjustment(DC: HDC; const p2: TColorAdjustment): WINBOOL; stdcall; external 'gdi32' name 'SetColorAdjustment';

 proc SetCommConfig*(hCommDev: THandle, lpCC: TCommConfig, dwSize: DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "SetCommConfig".}

@@ -22359,9 +22359,9 @@ proc SetConsoleCursorInfo*(hConsoleOutput: THandle,
 proc SetDIBColorTable*(DC: HDC, p2, p3: WINUINT, RGBQuadSTructs: pointer): WINUINT{.

     stdcall, dynlib: "gdi32", importc: "SetDIBColorTable".}

 proc SetDIBits*(DC: HDC, Bitmap: HBITMAP, StartScan, NumScans: WINUINT,

-                Bits: Pointer, BitsInfo: var TBitmapInfo, Usage: WINUINT): int{.

+                Bits: pointer, BitsInfo: var TBitmapInfo, Usage: WINUINT): int{.

     stdcall, dynlib: "gdi32", importc: "SetDIBits".}

-  #function SetDIBitsToDevice(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD; SrcX, SrcY: Integer; nStartScan, NumScans: WINUINT; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: WINUINT): Integer; stdcall; external 'gdi32' name 'SetDIBitsToDevice';

+  #function SetDIBitsToDevice(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD; SrcX, SrcY: Integer; nStartScan, NumScans: WINUINT; Bits: pointer; var BitsInfo: TBitmapInfo; Usage: WINUINT): Integer; stdcall; external 'gdi32' name 'SetDIBitsToDevice';

 proc SetEnhMetaFileBits*(para1: WINUINT, para2: pointer): HENHMETAFILE{.stdcall,

     dynlib: "gdi32", importc: "SetEnhMetaFileBits".}

 proc SetFileTime*(hFile: HANDLE, lpCreationTime: var FILETIME,

@@ -22378,7 +22378,7 @@ proc SetMenuItemInfoA*(p1: HMENU, p2: WINUINT, p3: WINBOOL, p4: TMenuItemInfoA):
 proc SetMetaFileBitsEx*(p1: WINUINT, p2: cstring): HMETAFILE{.stdcall,

     dynlib: "gdi32", importc: "SetMetaFileBitsEx".}

 proc SetNamedPipeHandleState*(hNamedPipe: THandle, lpMode: var DWORD,

-    lpMaxCollectionCount, lpCollectDataTimeout: Pointer): WINBOOL{.stdcall,

+    lpMaxCollectionCount, lpCollectDataTimeout: pointer): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "SetNamedPipeHandleState".}

 proc SetPaletteEntries*(Palette: HPALETTE, StartIndex, NumEntries: WINUINT,

                         PaletteEntries: pointer): WINUINT{.stdcall,

@@ -22405,7 +22405,7 @@ proc SetUserObjectSecurity*(hObj: THandle, pSIRequested: var DWORD,
     dynlib: "user32", importc: "SetUserObjectSecurity".}

 proc SetWaitableTimer*(hTimer: THandle, lpDueTime: var TLargeInteger,

                        lPeriod: int32, pfnCompletionRoutine: TFNTimerAPCRoutine,

-                       lpArgToCompletionRoutine: Pointer, fResume: WINBOOL): WINBOOL{.

+                       lpArgToCompletionRoutine: pointer, fResume: WINBOOL): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "SetWaitableTimer".}

 proc SetWinMetaFileBits*(p1: WINUINT, p2: cstring, p3: HDC, p4: TMetaFilePict): HENHMETAFILE{.

     stdcall, dynlib: "gdi32", importc: "SetWinMetaFileBits".}

@@ -22415,7 +22415,7 @@ proc StartDoc*(DC: HDC, p2: TDocInfo): int{.stdcall, dynlib: "gdi32",
 proc StartDocA*(DC: HDC, p2: TDocInfoA): int{.stdcall, dynlib: "gdi32",

     importc: "StartDocA".}

   #function StartDocW(DC: HDC; const p2: TDocInfoW): Integer; stdcall; external 'gdi32' name 'StartDocW';

-  #function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX, SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: WINUINT; Rop: DWORD): Integer; stdcall; external 'gdi32' name 'StretchDIBits';

+  #function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX, SrcY, SrcWidth, SrcHeight: Integer; Bits: pointer; var BitsInfo: TBitmapInfo; Usage: WINUINT; Rop: DWORD): Integer; stdcall; external 'gdi32' name 'StretchDIBits';

 proc SubtractRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.

     stdcall, dynlib: "user32", importc: "SubtractRect".}

 proc SystemTimeToFileTime*(lpSystemTime: TSystemTime, lpFileTime: var TFileTime): WINBOOL{.

@@ -22446,8 +22446,8 @@ proc TrackMouseEvent*(lpEventTrack: PTrackMouseEvent): WINBOOL{.stdcall,
 proc TrackPopupMenu*(menu: HMENU, uFlags: WINUINT, x: int32, y: int32,

                      nReserved: int32, wnd: HWND, prcRect: PRect): WINBOOL{.

     stdcall, dynlib: "user32", importc: "TrackPopupMenu".}

-proc TransactNamedPipe*(hNamedPipe: THandle, lpInBuffer: Pointer,

-                        nInBufferSize: DWORD, lpOutBuffer: Pointer,

+proc TransactNamedPipe*(hNamedPipe: THandle, lpInBuffer: pointer,

+                        nInBufferSize: DWORD, lpOutBuffer: pointer,

                         nOutBufferSize: DWORD, lpBytesRead: var DWORD,

                         lpOverlapped: POverlapped): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "TransactNamedPipe".}

@@ -22464,8 +22464,8 @@ proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: TMsg): WINBOOL{.stdcall,
     dynlib: "user32", importc: "TranslateMDISysAccel".}

 proc TranslateMessage*(lpMsg: TMsg): WINBOOL{.stdcall, dynlib: "user32",

     importc: "TranslateMessage".}

-  #function TransparentDIBits(DC: HDC; p2, p3, p4, p5: Integer; const p6: Pointer; const p7: PBitmapInfo; p8: WINUINT; p9, p10, p11, p12: Integer; p13: WINUINT): WINBOOL;stdcall; external 'gdi32' name 'TransparentDIBits';

-proc UnhandledExceptionFilter*(ExceptionInfo: TExceptionPointers): int32{.

+  #function TransparentDIBits(DC: HDC; p2, p3, p4, p5: Integer; const p6: pointer; const p7: PBitmapInfo; p8: WINUINT; p9, p10, p11, p12: Integer; p13: WINUINT): WINBOOL;stdcall; external 'gdi32' name 'TransparentDIBits';

+proc UnhandledExceptionFilter*(ExceptionInfo: TExceptionpointers): int32{.

     stdcall, dynlib: "kernel32", importc: "UnhandledExceptionFilter".}

 proc UnionRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.

     stdcall, dynlib: "user32", importc: "UnionRect".}

@@ -22499,19 +22499,19 @@ proc VerInstallFileW*(uFlags: DWORD, szSrcFileName, szDestFileName, szSrcDir,
                                      szDestDir, szCurDir, szTmpFile: LPWSTR,

                       lpuTmpFileLen: var WINUINT): DWORD{.stdcall,

     dynlib: "version", importc: "VerInstallFileW".}

-proc VerQueryValue*(pBlock: Pointer, lpSubBlock: cstring,

-                    lplpBuffer: var Pointer, puLen: var WINUINT): WINBOOL{.stdcall,

+proc VerQueryValue*(pBlock: pointer, lpSubBlock: cstring,

+                    lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.stdcall,

     dynlib: "version", importc: "VerQueryValueA".}

-proc VerQueryValueA*(pBlock: Pointer, lpSubBlock: LPCSTR,

-                     lplpBuffer: var Pointer, puLen: var WINUINT): WINBOOL{.

+proc VerQueryValueA*(pBlock: pointer, lpSubBlock: LPCSTR,

+                     lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.

     stdcall, dynlib: "version", importc: "VerQueryValueA".}

-proc VerQueryValueW*(pBlock: Pointer, lpSubBlock: LPWSTR,

-                     lplpBuffer: var Pointer, puLen: var WINUINT): WINBOOL{.

+proc VerQueryValueW*(pBlock: pointer, lpSubBlock: LPWSTR,

+                     lplpBuffer: var pointer, puLen: var WINUINT): WINBOOL{.

     stdcall, dynlib: "version", importc: "VerQueryValueW".}

-proc VirtualQuery*(lpAddress: Pointer, lpBuffer: var TMemoryBasicInformation,

+proc VirtualQuery*(lpAddress: pointer, lpBuffer: var TMemoryBasicInformation,

                    dwLength: DWORD): DWORD{.stdcall, dynlib: "kernel32",

     importc: "VirtualQuery".}

-proc VirtualQueryEx*(hProcess: THandle, lpAddress: Pointer,

+proc VirtualQueryEx*(hProcess: THandle, lpAddress: pointer,

                      lpBuffer: var TMemoryBasicInformation, dwLength: DWORD): DWORD{.

     stdcall, dynlib: "kernel32", importc: "VirtualQueryEx".}

 proc WaitCommEvent*(hFile: THandle, lpEvtMask: var DWORD,

@@ -22528,7 +22528,7 @@ proc wglSetLayerPaletteEntries*(p1: HDC, p2, p3, p4: int, pcr: pointer): int{.
     stdcall, dynlib: "opengl32", importc: "wglSetLayerPaletteEntries".}

   #function wglSwapMultipleBuffers(p1: WINUINT; const p2: PWGLSwap): DWORD;stdcall; external 'opengl32' name 'wglSwapMultipleBuffers';

   #function WinSubmitCertificate(var lpCertificate: TWinCertificate): WINBOOL;stdcall; external 'imaghlp' name 'WinSubmitCertificate';

-  #function WinVerifyTrust(wnd: HWND; const ActionID: TGUID; ActionData: Pointer): Longint;stdcall; external 'imaghlp' name 'WinVerifyTrust';

+  #function WinVerifyTrust(wnd: HWND; const ActionID: TGUID; ActionData: pointer): Longint;stdcall; external 'imaghlp' name 'WinVerifyTrust';

 proc WNetAddConnection2*(lpNetResource: var TNetResource,

                          lpPassword, lpUserName: cstring, dwFlags: DWORD): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetAddConnection2A".}

@@ -22553,13 +22553,13 @@ proc WNetDisconnectDialog1*(lpConnDlgStruct: var TDiscDlgStruct): DWORD{.
 proc WNetDisconnectDialog1A*(lpConnDlgStruct: var TDiscDlgStructA): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetDisconnectDialog1A".}

   #function WNetDisconnectDialog1W(var lpConnDlgStruct: TDiscDlgStructW): DWORD; stdcall; external 'mpr' name 'WNetDisconnectDialog1W';

-proc WNetEnumResource*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: Pointer,

+proc WNetEnumResource*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: pointer,

                        lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

     importc: "WNetEnumResourceA".}

-proc WNetEnumResourceA*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: Pointer,

+proc WNetEnumResourceA*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: pointer,

                         lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

     importc: "WNetEnumResourceA".}

-proc WNetEnumResourceW*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: Pointer,

+proc WNetEnumResourceW*(hEnum: THandle, lpcCount: var DWORD, lpBuffer: pointer,

                         lpBufferSize: var DWORD): DWORD{.stdcall, dynlib: "mpr",

     importc: "WNetEnumResourceW".}

 proc WNetGetConnection*(lpLocalName: cstring, lpRemoteName: cstring,

@@ -22601,21 +22601,21 @@ proc WNetGetProviderNameA*(dwNetType: DWORD, lpProviderName: LPCSTR,
 proc WNetGetProviderNameW*(dwNetType: DWORD, lpProviderName: LPWSTR,

                            lpBufferSize: var DWORD): DWORD{.stdcall,

     dynlib: "mpr", importc: "WNetGetProviderNameW".}

-proc WNetGetResourceParent*(lpNetResource: PNetResource, lpBuffer: Pointer,

+proc WNetGetResourceParent*(lpNetResource: PNetResource, lpBuffer: pointer,

                             cbBuffer: var DWORD): DWORD{.stdcall, dynlib: "mpr",

     importc: "WNetGetResourceParentA".}

-proc WNetGetResourceParentA*(lpNetResource: PNetResourceA, lpBuffer: Pointer,

+proc WNetGetResourceParentA*(lpNetResource: PNetResourceA, lpBuffer: pointer,

                              cbBuffer: var DWORD): DWORD{.stdcall,

     dynlib: "mpr", importc: "WNetGetResourceParentA".}

-  #function WNetGetResourceParentW(lpNetResource: PNetResourceW; lpBuffer: Pointer; var cbBuffer: DWORD): DWORD;stdcall; external 'mpr' name 'WNetGetResourceParentW';

+  #function WNetGetResourceParentW(lpNetResource: PNetResourceW; lpBuffer: pointer; var cbBuffer: DWORD): DWORD;stdcall; external 'mpr' name 'WNetGetResourceParentW';

 proc WNetGetUniversalName*(lpLocalPath: cstring, dwInfoLevel: DWORD,

-                           lpBuffer: Pointer, lpBufferSize: var DWORD): DWORD{.

+                           lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

 proc WNetGetUniversalNameA*(lpLocalPath: LPCSTR, dwInfoLevel: DWORD,

-                            lpBuffer: Pointer, lpBufferSize: var DWORD): DWORD{.

+                            lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameA".}

 proc WNetGetUniversalNameW*(lpLocalPath: LPWSTR, dwInfoLevel: DWORD,

-                            lpBuffer: Pointer, lpBufferSize: var DWORD): DWORD{.

+                            lpBuffer: pointer, lpBufferSize: var DWORD): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetGetUniversalNameW".}

 proc WNetGetUser*(lpName: cstring, lpUserName: cstring, lpnLength: var DWORD): DWORD{.

     stdcall, dynlib: "mpr", importc: "WNetGetUserA".}

@@ -22641,13 +22641,13 @@ proc WNetUseConnectionA*(hwndOwner: HWND, lpNetResource: var TNetResourceA,
                          lpResult: var DWORD): DWORD{.stdcall, dynlib: "mpr",

     importc: "WNetUseConnectionA".}

   #function WNetUseConnectionW(hwndOwner: HWND; var lpNetResource: TNetResourceW; lpUserID: LPWSTR; lpPassword: LPWSTR; dwFlags: DWORD; lpAccessName: LPWSTR; var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall; external 'mpr' name 'WNetUseConnectionW';

-proc WriteConsole*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsole*(hConsoleOutput: THandle, lpBuffer: pointer,

                    nNumberOfCharsToWrite: DWORD,

-                   lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.

+                   lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

-proc WriteConsoleA*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsoleA*(hConsoleOutput: THandle, lpBuffer: pointer,

                     nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.

+                    lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleA".}

 proc WriteConsoleInput*(hConsoleInput: THandle, lpBuffer: TInputRecord,

                         nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.

@@ -22658,15 +22658,15 @@ proc WriteConsoleInputA*(hConsoleInput: THandle, lpBuffer: TInputRecord,
 proc WriteConsoleInputW*(hConsoleInput: THandle, lpBuffer: TInputRecord,

                          nLength: DWORD, lpNumberOfEventsWritten: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleInputW".}

-proc WriteConsoleOutput*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsoleOutput*(hConsoleOutput: THandle, lpBuffer: pointer,

                          dwBufferSize, dwBufferCoord: TCoord,

                          lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-proc WriteConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsoleOutputA*(hConsoleOutput: THandle, lpBuffer: pointer,

                           dwBufferSize, dwBufferCoord: TCoord,

                           lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "WriteConsoleOutputA".}

-proc WriteConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: Pointer,

+proc WriteConsoleOutputAttribute*(hConsoleOutput: THandle, lpAttribute: pointer,

                                   nLength: DWORD, dwWriteCoord: TCoord,

                                   lpNumberOfAttrsWritten: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputAttribute".}

@@ -22682,18 +22682,18 @@ proc WriteConsoleOutputCharacterW*(hConsoleOutput: THandle, lpCharacter: LPWSTR,
                                    nLength: DWORD, dwWriteCoord: TCoord,

                                    lpNumberOfCharsWritten: var DWORD): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleOutputCharacterW".}

-proc WriteConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsoleOutputW*(hConsoleOutput: THandle, lpBuffer: pointer,

                           dwBufferSize, dwBufferCoord: TCoord,

                           lpWriteRegion: var TSmallRect): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "WriteConsoleOutputW".}

-proc WriteConsoleW*(hConsoleOutput: THandle, lpBuffer: Pointer,

+proc WriteConsoleW*(hConsoleOutput: THandle, lpBuffer: pointer,

                     nNumberOfCharsToWrite: DWORD,

-                    lpNumberOfCharsWritten: var DWORD, lpReserved: Pointer): WINBOOL{.

+                    lpNumberOfCharsWritten: var DWORD, lpReserved: pointer): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteConsoleW".}

 proc WriteFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToWrite: DWORD,

                 lpNumberOfBytesWritten: var DWORD, lpOverlapped: POverlapped): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WriteFile".}

-proc WriteFileEx*(hFile: THandle, lpBuffer: Pointer,

+proc WriteFileEx*(hFile: THandle, lpBuffer: pointer,

                   nNumberOfBytesToWrite: DWORD, lpOverlapped: TOverlapped,

                   lpCompletionRoutine: FARPROC): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "WriteFileEx".}

@@ -22707,8 +22707,8 @@ proc WritePrivateProfileStructW*(lpszSection, lpszKey: LPCWSTR,
 proc WritePrivateProfileStruct*(lpszSection, lpszKey: LPCTSTR, lpStruct: LPVOID,

                                 uSizeStruct: WINUINT, szFile: LPCTSTR): WINBOOL{.

     stdcall, dynlib: "kernel32", importc: "WritePrivateProfileStructA".}

-proc WriteProcessMemory*(hProcess: THandle, lpBaseAddress: Pointer,

-                         lpBuffer: Pointer, nSize: DWORD,

+proc WriteProcessMemory*(hProcess: THandle, lpBaseAddress: pointer,

+                         lpBuffer: pointer, nSize: DWORD,

                          lpNumberOfBytesWritten: var DWORD): WINBOOL{.stdcall,

     dynlib: "kernel32", importc: "WriteProcessMemory".}

 proc SHFileOperation*(para1: var SHFILEOPSTRUCT): int32{.stdcall,

@@ -22821,7 +22821,7 @@ proc INDEXTOSTATEIMAGEMASK*(i: int32): int32 =
   result = i shl 12'i32

 

 proc MAKEINTATOM*(i: int32): LPTSTR =

-  result = cast[LPTSTR](cast[ULONG_PTR](ToU16(i)))

+  result = cast[LPTSTR](cast[ULONG_PTR](toU16(i)))

 

 proc MAKELANGID*(p, s: int32): int32 =

   # return type might be wrong

@@ -22849,10 +22849,10 @@ proc MAKEROP4*(fore, back: int32): DWORD =
 proc MAKEWPARAM*(L, h: int32): WPARAM =

   result = WPARAM(MAKELONG(L, h))

 

-proc GET_X_LPARAM*(lp: Windows.LParam): int32 =

+proc GET_X_LPARAM*(lp: windows.LParam): int32 =

   result = LOWORD(lp.int32)

 

-proc GET_Y_LPARAM*(lp: Windows.LParam): int32 =

+proc GET_Y_LPARAM*(lp: windows.LParam): int32 =

   result = HIWORD(lp.int32)

 

 proc UNICODE_NULL*(): WCHAR =

@@ -23229,10 +23229,10 @@ proc set_fAckReq(a: var DDEUP, fAckReq: int16) =
   a.flag0 = a.flag0 or ((fAckReq shl bp_DDEUP_fAckReq) and bm_DDEUP_fAckReq)

 

 proc CreateWindowA(lpClassName: LPCSTR, lpWindowName: LPCSTR, dwStyle: DWORD,

-                   X: int32, Y: int32, nWidth: int32, nHeight: int32,

+                   X, Y, nWidth, nHeight: int32,

                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

                    lpParam: LPVOID): HWND =

-  result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,

+  result = CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

                            nHeight, hWndParent, menu, hInstance, lpParam)

 

 proc CreateDialogA(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

@@ -23259,7 +23259,7 @@ proc CreateWindowW(lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD,
                    X: int32, Y: int32, nWidth: int32, nHeight: int32,

                    hWndParent: HWND, menu: HMENU, hInstance: HINST,

                    lpParam: LPVOID): HWND =

-  result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,

+  result = CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

                            nHeight, hWndParent, menu, hInstance, lpParam)

 

 proc CreateDialogW(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

@@ -23285,7 +23285,7 @@ when defined(winUnicode):
                     X: int32, Y: int32, nWidth: int32, nHeight: int32,

                     hWndParent: HWND, menu: HMENU, hInstance: HINST,

                     lpParam: LPVOID): HWND =

-    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,

+    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

                             nHeight, hWndParent, hMenu, hInstance, lpParam)

 

   proc CreateDialog(hInstance: HINST, lpName: LPCWSTR, hWndParent: HWND,

@@ -23311,7 +23311,7 @@ else:
                     X: int32, Y: int32, nWidth: int32, nHeight: int32,

                     hWndParent: HWND, menu: HMENU, hInstance: HINST,

                     lpParam: LPVOID): HWND =

-    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, x, y, nWidth,

+    result = CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y, nWidth,

                             nHeight, hWndParent, menu, hInstance, lpParam)

 

   proc CreateDialog(hInstance: HINST, lpTemplateName: LPCSTR, hWndParent: HWND,

@@ -23334,24 +23334,24 @@ else:
     result = DialogBoxIndirectParam(hInstance, hDialogTemplate, hWndParent,

                                     lpDialogFunc, 0)

 

-proc GlobalAllocPtr(flags, cb: DWord): Pointer =

+proc GlobalAllocPtr(flags, cb: DWord): pointer =

   result = GlobalLock(GlobalAlloc(flags, cb))

 

-proc GlobalFreePtr(lp: Pointer): Pointer =

-  result = cast[Pointer](GlobalFree(cast[HWND](GlobalUnlockPtr(lp))))

+proc GlobalFreePtr(lp: pointer): pointer =

+  result = cast[pointer](GlobalFree(cast[HWND](GlobalUnlockPtr(lp))))

 

-proc GlobalUnlockPtr(lp: pointer): Pointer =

+proc GlobalUnlockPtr(lp: pointer): pointer =

   discard GlobalUnlock(GlobalHandle(lp))

   result = lp

 

-proc GlobalLockPtr(lp: pointer): Pointer =

+proc GlobalLockPtr(lp: pointer): pointer =

   result = GlobalLock(GlobalHandle(lp))

 

-proc GlobalReAllocPtr(lp: Pointer, cbNew, flags: DWord): Pointer =

+proc GlobalReAllocPtr(lp: pointer, cbNew, flags: DWord): pointer =

   result = GlobalLock(GlobalReAlloc(cast[HWND](GlobalUnlockPtr(lp)), cbNew, flags))

 

-proc GlobalPtrHandle(lp: pointer): Pointer =

-  result = cast[Pointer](GlobalHandle(lp))

+proc GlobalPtrHandle(lp: pointer): pointer =

+  result = cast[pointer](GlobalHandle(lp))

 

 proc ImageList_AddIcon(himl: HIMAGELIST, hicon: HICON): int32 =

   result = ImageList_ReplaceIcon(himl, -1, hicon)

@@ -23502,7 +23502,7 @@ proc ListView_GetCountPerPage(hwndLV: HWND): LRESULT =
 proc ListView_GetEditControl(hwndLV: HWND): LRESULT =

   result = SendMessage(hwndLV, LVM_GETEDITCONTROL, 0, 0)

 

-proc ListView_GetImageList(wnd: HWND, iImageList: wINT): LRESULT =

+proc ListView_GetImageList(wnd: HWND, iImageList: WINT): LRESULT =

   result = SendMessage(wnd, LVM_GETIMAGELIST, WPARAM(iImageList), 0)

 

 proc ListView_GetISearchString(hwndLV: HWND, lpsz: LPTSTR): LRESULT =

@@ -23702,7 +23702,7 @@ proc TreeView_SetItem(wnd: HWND, item: var TV_ITEM): LRESULT =
   result = SendMessage(wnd, TVM_SETITEM, 0, cast[LPARAM](addr(item)))

 

 proc TreeView_EditLabel(wnd: HWND, hitem: HTREEITEM): LRESULT =

-  Result = SendMessage(wnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem))

+  result = SendMessage(wnd, TVM_EDITLABEL, 0, cast[LPARAM](hitem))

 

 proc TreeView_GetEditControl(wnd: HWND): LRESULT =

   result = SendMessage(wnd, TVM_GETEDITCONTROL, 0, 0)

@@ -23854,10 +23854,10 @@ proc CommDlg_OpenSave_SetDefExt(hdlg: HWND, pszext: LPSTR): LRESULT =
 proc InternalGetLargestConsoleWindowSize(hConsoleOutput: HANDLE): DWord{.

     stdcall, dynlib: "kernel32", importc: "GetLargestConsoleWindowSize".}

 proc GetLargestConsoleWindowSize(hConsoleOutput: HANDLE): COORD =

-  var res: dword

+  var res: DWORD

   res = InternalGetLargestConsoleWindowSize(hConsoleOutput)

-  result.y = toU16(res and 0x0000ffff) # XXX: correct?

-  result.x = toU16(res shr 16)

+  result.Y = toU16(res and 0x0000ffff) # XXX: correct?

+  result.X = toU16(res shr 16)

 

 proc Succeeded(Status: HRESULT): WINBOOL =

   result = (Status and 0x80000000).WinBool

diff --git a/lib/windows/winlean.nim b/lib/windows/winlean.nim
index 09696b67f..cc633d90b 100644
--- a/lib/windows/winlean.nim
+++ b/lib/windows/winlean.nim
@@ -1,6 +1,6 @@
 #
 #
-#            Nimrod's Runtime Library
+#            Nim's Runtime Library
 #        (c) Copyright 2012 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
@@ -8,7 +8,7 @@
 #
 
 ## This module implements a small wrapper for some needed Win API procedures,
-## so that the Nimrod compiler does not depend on the huge Windows module.
+## so that the Nim compiler does not depend on the huge Windows module.
 
 const
   useWinUnicode* = not defined(useWinAnsi)
@@ -104,11 +104,11 @@ proc closeHandle*(hObject: THandle): WINBOOL {.stdcall, dynlib: "kernel32",
     importc: "CloseHandle".}
     
 proc readFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToRead: int32,
-               lpNumberOfBytesRead: var int32, lpOverlapped: pointer): WINBOOL{.
+               lpNumberOfBytesRead: ptr int32, lpOverlapped: pointer): WINBOOL{.
     stdcall, dynlib: "kernel32", importc: "ReadFile".}
     
 proc writeFile*(hFile: THandle, Buffer: pointer, nNumberOfBytesToWrite: int32,
-                lpNumberOfBytesWritten: var int32, 
+                lpNumberOfBytesWritten: ptr int32, 
                 lpOverlapped: pointer): WINBOOL{.
     stdcall, dynlib: "kernel32", importc: "WriteFile".}
 
@@ -199,14 +199,14 @@ else:
     importc: "GetCurrentDirectoryA", dynlib: "kernel32", stdcall.}
   proc setCurrentDirectoryA*(lpPathName: cstring): int32 {.
     importc: "SetCurrentDirectoryA", dynlib: "kernel32", stdcall.}
-  proc createDirectoryA*(pathName: cstring, security: Pointer=nil): int32 {.
+  proc createDirectoryA*(pathName: cstring, security: pointer=nil): int32 {.
     importc: "CreateDirectoryA", dynlib: "kernel32", stdcall.}
   proc removeDirectoryA*(lpPathName: cstring): int32 {.
     importc: "RemoveDirectoryA", dynlib: "kernel32", stdcall.}
   proc setEnvironmentVariableA*(lpName, lpValue: cstring): int32 {.
     stdcall, dynlib: "kernel32", importc: "SetEnvironmentVariableA".}
 
-  proc getModuleFileNameA*(handle: THandle, buf: CString, size: int32): int32 {.
+  proc getModuleFileNameA*(handle: THandle, buf: cstring, size: int32): int32 {.
     importc: "GetModuleFileNameA", dynlib: "kernel32", stdcall.}
 
 when useWinUnicode:
@@ -304,7 +304,7 @@ else:
                            dwFileAttributes: int32): WINBOOL {.
       stdcall, dynlib: "kernel32", importc: "SetFileAttributesA".}
 
-  proc copyFileA*(lpExistingFileName, lpNewFileName: CString,
+  proc copyFileA*(lpExistingFileName, lpNewFileName: cstring,
                  bFailIfExists: cint): cint {.
     importc: "CopyFileA", stdcall, dynlib: "kernel32".}
 
@@ -363,48 +363,50 @@ const
 proc wsaGetLastError*(): cint {.importc: "WSAGetLastError", dynlib: ws2dll.}
 
 type
-  TSocketHandle* = distinct int
+  SocketHandle* = distinct int
+
+{.deprecated: [TSocketHandle: SocketHandle].}
 
 type
-  TWSAData* {.pure, final, importc: "WSADATA", header: "Winsock2.h".} = object 
+  WSAData* {.importc: "WSADATA", header: "Winsock2.h".} = object 
     wVersion, wHighVersion: int16
     szDescription: array[0..WSADESCRIPTION_LEN, char]
     szSystemStatus: array[0..WSASYS_STATUS_LEN, char]
     iMaxSockets, iMaxUdpDg: int16
     lpVendorInfo: cstring
     
-  TSockAddr* {.pure, final, importc: "SOCKADDR", header: "Winsock2.h".} = object 
+  SockAddr* {.importc: "SOCKADDR", header: "Winsock2.h".} = object 
     sa_family*: int16 # unsigned
     sa_data: array[0..13, char]
 
-  TInAddr* {.pure, final, importc: "IN_ADDR", header: "Winsock2.h".} = object
+  InAddr* {.importc: "IN_ADDR", header: "Winsock2.h".} = object
     s_addr*: int32  # IP address
   
-  Tsockaddr_in* {.pure, final, importc: "SOCKADDR_IN", 
+  Sockaddr_in* {.importc: "SOCKADDR_IN", 
                   header: "Winsock2.h".} = object
     sin_family*: int16
     sin_port*: int16 # unsigned
-    sin_addr*: TInAddr
+    sin_addr*: InAddr
     sin_zero*: array[0..7, char]
 
-  Tin6_addr* {.pure, final, importc: "IN6_ADDR", header: "Winsock2.h".} = object 
+  In6_addr* {.importc: "IN6_ADDR", header: "Winsock2.h".} = object 
     bytes*: array[0..15, char]
 
-  Tsockaddr_in6* {.pure, final, importc: "SOCKADDR_IN6", 
+  Sockaddr_in6* {.importc: "SOCKADDR_IN6", 
                    header: "Winsock2.h".} = object
     sin6_family*: int16
     sin6_port*: int16 # unsigned
     sin6_flowinfo*: int32 # unsigned
-    sin6_addr*: Tin6_addr
+    sin6_addr*: In6_addr
     sin6_scope_id*: int32 # unsigned
 
-  Tsockaddr_in6_old* {.pure, final.} = object
+  Sockaddr_in6_old* = object
     sin6_family*: int16
     sin6_port*: int16 # unsigned
     sin6_flowinfo*: int32 # unsigned
-    sin6_addr*: Tin6_addr
+    sin6_addr*: In6_addr
 
-  TServent* {.pure, final.} = object
+  Servent* = object
     s_name*: cstring
     s_aliases*: cstringArray
     when defined(cpu64):
@@ -414,35 +416,42 @@ type
       s_port*: int16
       s_proto*: cstring
 
-  Thostent* {.pure, final.} = object
+  Hostent* = object
     h_name*: cstring
     h_aliases*: cstringArray
     h_addrtype*: int16
     h_length*: int16
     h_addr_list*: cstringArray
   
-  TFdSet* {.pure, final.} = object
+  TFdSet* = object
     fd_count*: cint # unsigned
-    fd_array*: array[0..FD_SETSIZE-1, TSocketHandle]
+    fd_array*: array[0..FD_SETSIZE-1, SocketHandle]
     
-  TTimeval* {.pure, final.} = object
+  Timeval* = object
     tv_sec*, tv_usec*: int32
     
-  TAddrInfo* {.pure, final.} = object
+  AddrInfo* = object
     ai_flags*: cint         ## Input flags. 
     ai_family*: cint        ## Address family of socket. 
     ai_socktype*: cint      ## Socket type. 
     ai_protocol*: cint      ## Protocol of socket. 
     ai_addrlen*: int        ## Length of socket address. 
     ai_canonname*: cstring  ## Canonical name of service location.
-    ai_addr*: ptr TSockAddr ## Socket address of socket. 
-    ai_next*: ptr TAddrInfo ## Pointer to next in list. 
+    ai_addr*: ptr SockAddr ## Socket address of socket. 
+    ai_next*: ptr AddrInfo ## Pointer to next in list. 
+
+  SockLen* = cuint
+
+{.deprecated: [TSockaddr_in: Sockaddr_in, TAddrinfo: AddrInfo,
+    TSockAddr: SockAddr, TSockLen: SockLen, TTimeval: Timeval,
+    TWSADATA: WSADATA, Thostent: Hostent, TServent: Servent,
+    TInAddr: InAddr, Tin6_addr: In6_addr, Tsockaddr_in6: Sockaddr_in6,
+    Tsockaddr_in6_old: Sockaddr_in6_old].}
 
-  TSockLen* = cuint
 
 var
   SOMAXCONN* {.importc, header: "Winsock2.h".}: cint
-  INVALID_SOCKET* {.importc, header: "Winsock2.h".}: TSocketHandle
+  INVALID_SOCKET* {.importc, header: "Winsock2.h".}: SocketHandle
   SOL_SOCKET* {.importc, header: "Winsock2.h".}: cint
   SO_DEBUG* {.importc, header: "Winsock2.h".}: cint ## turn on debugging info recording
   SO_ACCEPTCONN* {.importc, header: "Winsock2.h".}: cint # socket has had listen()
@@ -458,94 +467,94 @@ var
   SO_EXCLUSIVEADDRUSE* {.importc, header: "Winsock2.h".}: cint # disallow local address reuse
   SO_ERROR* {.importc, header: "Winsock2.h".}: cint
 
-proc `==`*(x, y: TSocketHandle): bool {.borrow.}
+proc `==`*(x, y: SocketHandle): bool {.borrow.}
 
-proc getservbyname*(name, proto: cstring): ptr TServent {.
+proc getservbyname*(name, proto: cstring): ptr Servent {.
   stdcall, importc: "getservbyname", dynlib: ws2dll.}
 
-proc getservbyport*(port: cint, proto: cstring): ptr TServent {.
+proc getservbyport*(port: cint, proto: cstring): ptr Servent {.
   stdcall, importc: "getservbyport", dynlib: ws2dll.}
 
-proc gethostbyaddr*(ip: ptr TInAddr, len: cuint, theType: cint): ptr Thostent {.
+proc gethostbyaddr*(ip: ptr InAddr, len: cuint, theType: cint): ptr Hostent {.
   stdcall, importc: "gethostbyaddr", dynlib: ws2dll.}
 
-proc gethostbyname*(name: cstring): ptr Thostent {.
+proc gethostbyname*(name: cstring): ptr Hostent {.
   stdcall, importc: "gethostbyname", dynlib: ws2dll.}
 
-proc socket*(af, typ, protocol: cint): TSocketHandle {.
+proc socket*(af, typ, protocol: cint): SocketHandle {.
   stdcall, importc: "socket", dynlib: ws2dll.}
 
-proc closesocket*(s: TSocketHandle): cint {.
+proc closesocket*(s: SocketHandle): cint {.
   stdcall, importc: "closesocket", dynlib: ws2dll.}
 
-proc accept*(s: TSocketHandle, a: ptr TSockAddr, addrlen: ptr TSockLen): TSocketHandle {.
+proc accept*(s: SocketHandle, a: ptr SockAddr, addrlen: ptr SockLen): SocketHandle {.
   stdcall, importc: "accept", dynlib: ws2dll.}
-proc bindSocket*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {.
+proc bindSocket*(s: SocketHandle, name: ptr SockAddr, namelen: SockLen): cint {.
   stdcall, importc: "bind", dynlib: ws2dll.}
-proc connect*(s: TSocketHandle, name: ptr TSockAddr, namelen: TSockLen): cint {.
+proc connect*(s: SocketHandle, name: ptr SockAddr, namelen: SockLen): cint {.
   stdcall, importc: "connect", dynlib: ws2dll.}
-proc getsockname*(s: TSocketHandle, name: ptr TSockAddr, 
-                  namelen: ptr TSockLen): cint {.
+proc getsockname*(s: SocketHandle, name: ptr SockAddr, 
+                  namelen: ptr SockLen): cint {.
   stdcall, importc: "getsockname", dynlib: ws2dll.}
-proc getsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer,
-                 optlen: ptr TSockLen): cint {.
+proc getsockopt*(s: SocketHandle, level, optname: cint, optval: pointer,
+                 optlen: ptr SockLen): cint {.
   stdcall, importc: "getsockopt", dynlib: ws2dll.}
-proc setsockopt*(s: TSocketHandle, level, optname: cint, optval: pointer,
-                 optlen: TSockLen): cint {.
+proc setsockopt*(s: SocketHandle, level, optname: cint, optval: pointer,
+                 optlen: SockLen): cint {.
   stdcall, importc: "setsockopt", dynlib: ws2dll.}
 
-proc listen*(s: TSocketHandle, backlog: cint): cint {.
+proc listen*(s: SocketHandle, backlog: cint): cint {.
   stdcall, importc: "listen", dynlib: ws2dll.}
-proc recv*(s: TSocketHandle, buf: pointer, len, flags: cint): cint {.
+proc recv*(s: SocketHandle, buf: pointer, len, flags: cint): cint {.
   stdcall, importc: "recv", dynlib: ws2dll.}
-proc recvfrom*(s: TSocketHandle, buf: cstring, len, flags: cint, 
-               fromm: ptr TSockAddr, fromlen: ptr TSockLen): cint {.
+proc recvfrom*(s: SocketHandle, buf: cstring, len, flags: cint, 
+               fromm: ptr SockAddr, fromlen: ptr SockLen): cint {.
   stdcall, importc: "recvfrom", dynlib: ws2dll.}
 proc select*(nfds: cint, readfds, writefds, exceptfds: ptr TFdSet,
-             timeout: ptr TTimeval): cint {.
+             timeout: ptr Timeval): cint {.
   stdcall, importc: "select", dynlib: ws2dll.}
-proc send*(s: TSocketHandle, buf: pointer, len, flags: cint): cint {.
+proc send*(s: SocketHandle, buf: pointer, len, flags: cint): cint {.
   stdcall, importc: "send", dynlib: ws2dll.}
-proc sendto*(s: TSocketHandle, buf: pointer, len, flags: cint,
-             to: ptr TSockAddr, tolen: TSockLen): cint {.
+proc sendto*(s: SocketHandle, buf: pointer, len, flags: cint,
+             to: ptr SockAddr, tolen: SockLen): cint {.
   stdcall, importc: "sendto", dynlib: ws2dll.}
 
-proc shutdown*(s: TSocketHandle, how: cint): cint {.
+proc shutdown*(s: SocketHandle, how: cint): cint {.
   stdcall, importc: "shutdown", dynlib: ws2dll.}
   
-proc getnameinfo*(a1: ptr TSockAddr, a2: TSockLen,
-                  a3: cstring, a4: TSockLen, a5: cstring,
-                  a6: TSockLen, a7: cint): cint {.
+proc getnameinfo*(a1: ptr SockAddr, a2: SockLen,
+                  a3: cstring, a4: SockLen, a5: cstring,
+                  a6: SockLen, a7: cint): cint {.
   stdcall, importc: "getnameinfo", dynlib: ws2dll.}
   
 proc inet_addr*(cp: cstring): int32 {.
   stdcall, importc: "inet_addr", dynlib: ws2dll.} 
 
-proc WSAFDIsSet(s: TSocketHandle, FDSet: var TFdSet): bool {.
+proc WSAFDIsSet(s: SocketHandle, set: var TFdSet): bool {.
   stdcall, importc: "__WSAFDIsSet", dynlib: ws2dll, noSideEffect.}
 
-proc FD_ISSET*(Socket: TSocketHandle, FDSet: var TFdSet): cint = 
-  result = if WSAFDIsSet(Socket, FDSet): 1'i32 else: 0'i32
+proc FD_ISSET*(socket: SocketHandle, set: var TFdSet): cint = 
+  result = if WSAFDIsSet(socket, set): 1'i32 else: 0'i32
 
-proc FD_SET*(Socket: TSocketHandle, FDSet: var TFdSet) = 
-  if FDSet.fd_count < FD_SETSIZE:
-    FDSet.fd_array[int(FDSet.fd_count)] = Socket
-    inc(FDSet.fd_count)
+proc fdSet*(socket: SocketHandle, s: var TFdSet) = 
+  if s.fd_count < FD_SETSIZE:
+    s.fd_array[int(s.fd_count)] = socket
+    inc(s.fd_count)
 
-proc FD_ZERO*(FDSet: var TFdSet) =
-  FDSet.fd_count = 0
+proc FD_ZERO*(s: var TFdSet) =
+  s.fd_count = 0
 
-proc wsaStartup*(wVersionRequired: int16, WSData: ptr TWSAData): cint {.
+proc wsaStartup*(wVersionRequired: int16, WSData: ptr WSAData): cint {.
   stdcall, importc: "WSAStartup", dynlib: ws2dll.}
 
-proc getaddrinfo*(nodename, servname: cstring, hints: ptr TAddrInfo,
-                  res: var ptr TAddrInfo): cint {.
+proc getaddrinfo*(nodename, servname: cstring, hints: ptr AddrInfo,
+                  res: var ptr AddrInfo): cint {.
   stdcall, importc: "getaddrinfo", dynlib: ws2dll.}
 
-proc freeaddrinfo*(ai: ptr TAddrInfo) {.
+proc freeaddrinfo*(ai: ptr AddrInfo) {.
   stdcall, importc: "freeaddrinfo", dynlib: ws2dll.}
 
-proc inet_ntoa*(i: TInAddr): cstring {.
+proc inet_ntoa*(i: InAddr): cstring {.
   stdcall, importc, dynlib: ws2dll.}
 
 const
@@ -564,12 +573,14 @@ proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray,
 
 const
   GENERIC_READ* = 0x80000000'i32
+  GENERIC_WRITE* = 0x40000000'i32
   GENERIC_ALL* = 0x10000000'i32
   FILE_SHARE_READ* = 1'i32
   FILE_SHARE_DELETE* = 4'i32
   FILE_SHARE_WRITE* = 2'i32
  
   CREATE_ALWAYS* = 2'i32
+  CREATE_NEW* = 1'i32
   OPEN_EXISTING* = 3'i32
   FILE_BEGIN* = 0'i32
   INVALID_SET_FILE_POINTER* = -1'i32
@@ -586,6 +597,7 @@ const
 # Error Constants
 const
   ERROR_ACCESS_DENIED* = 5
+  ERROR_HANDLE_EOF* = 38
 
 when useWinUnicode:
   proc createFileW*(lpFileName: WideCString, dwDesiredAccess, dwShareMode: DWORD,
@@ -640,11 +652,11 @@ proc unmapViewOfFile*(lpBaseAddress: pointer): WINBOOL {.stdcall,
 
 type
   TOVERLAPPED* {.pure, inheritable.} = object
-    Internal*: PULONG
-    InternalHigh*: PULONG
-    Offset*: DWORD
-    OffsetHigh*: DWORD
-    hEvent*: THANDLE
+    internal*: PULONG
+    internalHigh*: PULONG
+    offset*: DWORD
+    offsetHigh*: DWORD
+    hEvent*: THandle
 
   POVERLAPPED* = ptr TOVERLAPPED
 
@@ -659,6 +671,7 @@ type
 
 const
   ERROR_IO_PENDING* = 997 # a.k.a WSA_IO_PENDING
+  FILE_FLAG_OVERLAPPED* = 1073741824
   WSAECONNABORTED* = 10053
   WSAECONNRESET* = 10054
   WSAEDISCON* = 10101
@@ -666,17 +679,21 @@ const
   WSAETIMEDOUT* = 10060
   ERROR_NETNAME_DELETED* = 64
 
-proc CreateIoCompletionPort*(FileHandle: THANDLE, ExistingCompletionPort: THANDLE,
+proc createIoCompletionPort*(FileHandle: THandle, ExistingCompletionPort: THandle,
                              CompletionKey: DWORD,
-                             NumberOfConcurrentThreads: DWORD): THANDLE{.stdcall,
+                             NumberOfConcurrentThreads: DWORD): THandle{.stdcall,
     dynlib: "kernel32", importc: "CreateIoCompletionPort".}
 
-proc GetQueuedCompletionStatus*(CompletionPort: THandle,
+proc getQueuedCompletionStatus*(CompletionPort: THandle,
     lpNumberOfBytesTransferred: PDWORD, lpCompletionKey: PULONG,
-                                lpOverlapped: ptr POverlapped,
+                                lpOverlapped: ptr POVERLAPPED,
                                 dwMilliseconds: DWORD): WINBOOL{.stdcall,
     dynlib: "kernel32", importc: "GetQueuedCompletionStatus".}
 
+proc getOverlappedResult*(hFile: THandle, lpOverlapped: TOVERLAPPED,
+              lpNumberOfBytesTransferred: var DWORD, bWait: WINBOOL): WINBOOL{.
+    stdcall, dynlib: "kernel32", importc: "GetOverlappedResult".}
+
 const 
  IOC_OUT* = 0x40000000
  IOC_IN*  = 0x80000000
@@ -697,9 +714,9 @@ var
   WSAID_GETACCEPTEXSOCKADDRS*: TGUID = TGUID(D1: 0xb5367df2'i32, D2: 0xcbac'i16, D3: 0x11cf, D4: [
     0x95'i8, 0xca'i8, 0x00'i8, 0x80'i8, 0x5f'i8, 0x48'i8, 0xa1'i8, 0x92'i8])
 
-proc WSAIoctl*(s: TSocketHandle, dwIoControlCode: DWORD, lpvInBuffer: pointer,
+proc WSAIoctl*(s: SocketHandle, dwIoControlCode: DWORD, lpvInBuffer: pointer,
   cbInBuffer: DWORD, lpvOutBuffer: pointer, cbOutBuffer: DWORD,
-  lpcbBytesReturned: PDword, lpOverlapped: POVERLAPPED,
+  lpcbBytesReturned: PDWORD, lpOverlapped: POVERLAPPED,
   lpCompletionRoutine: POVERLAPPED_COMPLETION_ROUTINE): cint 
   {.stdcall, importc: "WSAIoctl", dynlib: "Ws2_32.dll".}
 
@@ -708,17 +725,17 @@ type
     len*: ULONG
     buf*: cstring
 
-proc WSARecv*(s: TSocketHandle, buf: ptr TWSABuf, bufCount: DWORD,
-  bytesReceived, flags: PDWORD, lpOverlapped: POverlapped,
+proc WSARecv*(s: SocketHandle, buf: ptr TWSABuf, bufCount: DWORD,
+  bytesReceived, flags: PDWORD, lpOverlapped: POVERLAPPED,
   completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.
   stdcall, importc: "WSARecv", dynlib: "Ws2_32.dll".}
 
-proc WSASend*(s: TSocketHandle, buf: ptr TWSABuf, bufCount: DWORD,
-  bytesSent: PDWord, flags: DWORD, lpOverlapped: POverlapped,
+proc WSASend*(s: SocketHandle, buf: ptr TWSABuf, bufCount: DWORD,
+  bytesSent: PDWORD, flags: DWORD, lpOverlapped: POVERLAPPED,
   completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {.
   stdcall, importc: "WSASend", dynlib: "Ws2_32.dll".}
 
-proc get_osfhandle*(fd:TFileHandle): THandle {.
+proc get_osfhandle*(fd:FileHandle): THandle {.
   importc: "_get_osfhandle", header:"<io.h>".}
 
 proc getSystemTimes*(lpIdleTime, lpKernelTime,