Ticket #1033: AutoIT.UDFs.w.DLLCalls.No.Error.Checks.+ANSI.txt

File AutoIT.UDFs.w.DLLCalls.No.Error.Checks.+ANSI.txt, 9.3 KB (added by Ascendant, 15 years ago)

AutoIT UDFs with DLLCalls missing proper @error checks and/or calling ANSI variants

Line 
1I've gone through and compiled a list of all standard include UDF's (as of version 3.3.0.0) that are missing @error checks after DLLCall's, where either the return 'array' or a passed structure is accessed after. It's a big list, so I wish you the best of luck in getting this worked out.
2
3*ALSO another problem, many are using ANSI calls rather than Unicode (wide calls). I've marked down as much info regarding this as possible
4
5Note: Some additional details are added for certain functions. Most are only 1 DLL Call, some are more - I commented on some, but there may be more than one DLLCall on some I didn't comment on.
6
7<Clipboard.au3>
8_ClipBoard_Close
9_ClipBoard_CountFormats
10_ClipBoard_Empty
11_ClipBoard_EnumFormats
12_ClipBoard_GetDataEx
13_ClipBoard_GetFormatName: Additionally, the ANSI version is being called instead of the Unicode (wide) version
14_ClipBoard_GetOpenWindow
15_ClipBoard_GetOwner
16_ClipBoard_GetPriorityFormat
17_ClipBoard_GetSequenceNumber
18_ClipBoard_GetViewer
19_ClipBoard_IsFormatAvailable
20_ClipBoard_Open
21_ClipBoard_RegisterFormat
22_ClipBoard_SetDataEx
23_ClipBoard_SetViewer
24
25
26<Date.au3>
27
28_SetDate: DLLCalls: GetLocalTime (if @error, the next 2 DLLCall's should be avoided), & GetLastError
29_SetTime: DLLCalls: GetLocalTime (if @error, the next 2 DLLCall's should be avoided), & GetLastError
30_Date_Time_CompareFileTime
31_Date_Time_DOSDateTimeToFileTime
32_Date_Time_FileTimeToDOSDateTime
33_Date_Time_FileTimeToLocalFileTime
34_Date_Time_FileTimeToSystemTime
35_Date_Time_GetFileTime
36_Date_Time_GetLocalTime
37_Date_Time_GetSystemTime
38_Date_Time_GetSystemTimeAdjustment
39_Date_Time_GetSystemTimeAsFileTime
40_Date_Time_GetSystemTimes
41_Date_Time_GetTickCount
42_Date_Time_GetTimeZoneInformation
43_Date_Time_LocalFileTimeToFileTime
44_Date_Time_SetFileTime
45_Date_Time_SetLocalTime: 2 unchecked calls to SetLocalTime
46_Date_Time_SetSystemTime
47_Date_Time_SetSystemTimeAdjustment
48_Date_Time_SetTimeZoneInformation
49_Date_Time_SystemTimeToFileTime
50_Date_Time_SystemTimeToTzSpecificLocalTime
51_Date_Time_TzSpecificLocalTimeToSystemTime
52
53
54<EventLog.au3>
55
56NOTE on most of these functions: the ANSI version of the function is being called. These should be updated to Unicode (wide) calls.
57
58_EventLog__Backup
59_EventLog__Clear
60_EventLog__Close
61_EventLog__Count
62_EventLog__DeregisterSource
63_EventLog__Full: returns value in a DLLStruct that wouldn't be touched if there was a DLLCall error
64_EventLog__Notify
65_EventLog__Oldest: returns value in a DLLStruct that wouldn't be touched if there was a DLLCall error
66_EventLog__Open:
67_EventLog__OpenBackup
68_EventLog__Read: multiple unchecked ReadEventLogA calls
69_EventLog__RegisterSource
70_EventLog__Report
71
72
73<File.au3>
74
75_FilePrint: (should check for @error and Return 0 before other checks)
76
77<GDIPlus.au3>
78
79_GDIPlus_DrawImagePoints
80_GDIPlus_GraphicsDrawImageRect
81
82
83<GuiImageList.au3>
84
85_GUIImageList_Add
86_GUIImageList_AddMasked
87_GUIImageList_BeginDrag
88_GUIImageList_Copy
89_GUIImageList_Create
90_GUIImageList_Destroy
91_GUIImageList_DragEnter
92_GUIImageList_DragLeave
93_GUIImageList_DragMove
94_GUIImageList_DragShowNolock
95_GUIImageList_Draw
96_GUIImageList_DrawEx
97_GUIImageList_Duplicate
98_GUIImageList_GetBkColor
99_GUIImageList_GetIcon
100_GUIImageList_GetIconSizeEx
101_GUIImageList_GetImageCount
102_GUIImageList_GetImageInfoEx
103_GUIImageList_Merge
104_GUIImageList_Remove
105_GUIImageList_Replace
106_GUIImageList_ReplaceIcon
107_GUIImageList_SetBkColor
108_GUIImageList_SetDragCursorImage
109_GUIImageList_SetIconSize
110_GUIImageList_SetImageCount
111_GUIImageList_SetOverlayImage
112_GUIImageList_Swap
113
114
115<GuiListView.au3>
116
117_GUICtrlListView_Create
118_GUICtrlListView_Draw
119_GUICtrlListView_HitTest
120_GUICtrlListView_InsertMarkHitTest
121
122
123<GuiMenu.au3>
124
125_GUICtrlMenu_AddMenuItem: actually, this looks like a coding error also, as it looks at the return as a non-array (and DLLCall doesn't explicitly say it returns anything for error situations)
126_GUICtrlMenu_AppendMenu
127_GUICtrlMenu_CheckMenuItem
128_GUICtrlMenu_CheckRadioItem
129_GUICtrlMenu_CreateMenu
130_GUICtrlMenu_CreatePopup
131_GUICtrlMenu_DeleteMenu
132_GUICtrlMenu_DestroyMenu
133_GUICtrlMenu_DrawMenuBar
134_GUICtrlMenu_EnableMenuItem
135_GUICtrlMenu_EndMenu
136_GUICtrlMenu_GetItemCount
137_GUICtrlMenu_GetItemInfo
138_GUICtrlMenu_GetItemRectEx
139_GUICtrlMenu_GetItemSubMenu
140_GUICtrlMenu_GetItemText
141_GUICtrlMenu_GetMenu
142_GUICtrlMenu_GetMenuBarInfo
143_GUICtrlMenu_GetMenuDefaultItem
144_GUICtrlMenu_GetMenuInfo
145_GUICtrlMenu_GetSystemMenu
146_GUICtrlMenu_InsertMenuItem
147_GUICtrlMenu_InsertMenuItemEx
148_GUICtrlMenu_IsMenu
149_GUICtrlMenu_LoadMenu
150_GUICtrlMenu_MenuItemFromPoint
151_GUICtrlMenu_RemoveMenu
152_GUICtrlMenu_SetItemBitmaps
153_GUICtrlMenu_SetItemInfo
154_GUICtrlMenu_SetMenu
155_GUICtrlMenu_SetMenuDefaultItem
156_GUICtrlMenu_SetMenuInfo
157_GUICtrlMenu_TrackPopupMenu
158
159<GuiReBar.au3>
160
161_GUICtrlRebar_HitTest
162
163<GuiScrollBars.au3>
164
165_GUIScrollBars_Init: 4 different DLL calls w/o error checks
166
167<GuiStatusBar.au3>
168
169_GUICtrlStatusBar_Create
170_GUICtrlStatusBar_SetIcon
171
172
173<GuiTreeView.au3>
174
175_GUICtrlTreeView_GetImageListIconHandle
176_GUICtrlTreeView_SetIcon: multiple unchecked DLL calls
177
178
179<IE.au3>
180
181__IEControlGetObjFromHWND
182
183
184<Inet.au3>
185
186_INetGetSource: only 1 call is unchecked: InternetReadFile
187
188<Memory.au3>
189
190_MemGlobalAlloc
191_MemGlobalFree
192_MemGlobalLock
193_MemGlobalSize
194_MemGlobalUnlock
195_MemMoveMemory: while it doesn't access an array or structure, it's supposed to modify memory pointed to by passed parameters, so an @error + False return would make sense if the DLLCall failed
196_MemVirtualAlloc
197_MemVirtualAllocEx
198_MemVirtualFree
199_MemVirtualFreeEx
200
201<Misc.au3>
202
203_ChooseColor
204_ChooseFont
205_ClipPutFile: actually only 1 call (GetLastError) is fudged up - it doesn't check for @error, and accesses the returned value as a non-array variable
206_MouseTrap
207_Singleton: CreateMutex (array accessed after next DLL Call),& GetLastError
208_MISC_GetDeviceCaps
209_MISC_ReleaseDC
210
211<NamedPipes.au3>
212
213_NamedPipes_CallNamedPipe
214_NamedPipes_ConnectNamedPipe
215_NamedPipes_CreateNamedPipe
216_NamedPipes_CreatePipe
217_NamedPipes_DisconnectNamedPipe
218_NamedPipes_GetNamedPipeHandleState
219_NamedPipes_GetNamedPipeInfo
220_NamedPipes_PeekNamedPipe
221_NamedPipes_SetNamedPipeHandleState
222_NamedPipes_TransactNamedPipe
223_NamedPipes_WaitNamedPipe
224
225<NetShare.au3>
226
227_Net_Share_APIBufferFree
228_Net_Share_ConnectionEnum
229_Net_Share_FileClose
230_Net_Share_FileEnum
231_Net_Share_FileGetInfo
232_Net_Share_SessionDel
233_Net_Share_SessionEnum
234_Net_Share_SessionGetInfo
235_Net_Share_ShareAdd
236_Net_Share_ShareCheck
237_Net_Share_ShareDel
238_Net_Share_ShareEnum
239_Net_Share_ShareGetInfo
240_Net_Share_ShareSetInfo
241_Net_Share_StatisticsGetSvr
242_Net_Share_StatisticsGetWrk
243
244<Process.au3>
245
246_ProcessGetPriority
247
248<Security.au3>
249
250_Security__AdjustTokenPrivileges
251_Security__GetLengthSid
252_Security__GetTokenInformation
253_Security__ImpersonateSelf
254_Security__IsValidSid
255_Security__LookupAccountName
256_Security__LookupAccountSid
257_Security__LookupPrivilegeValue
258_Security__OpenProcessToken
259_Security__OpenThreadToken
260_Security__SidToStringSid
261_Security__StringSidToSid: actually, this looks like a coding error also, as it looks at the return as a non-array (and DLLCall doesn't explicitly say it returns anything for error situations)
262
263<Timers.au3>
264
265_Timer_GetIdleTime
266
267
268<WinApi.au3>
269
270_WinAPI_CloseHandle
271_WinAPI_CopyIcon
272_WinAPI_CreateBitmap
273_WinAPI_CreateCompatibleBitmap
274_WinAPI_CreateCompatibleDC
275_WinAPI_CreateWindowEx
276_WinAPI_DeleteDC
277_WinAPI_DestroyIcon
278_WinAPI_DrawIcon
279_WinAPI_DrawIconEx
280_WinAPI_ExpandEnvironmentStrings: also uses ANSI rather than Unicode (wide) variant
281_WinAPI_GetClientRect
282_WinAPI_GetCursorInfo
283_WinAPI_GetDC
284_WinAPI_GetDIBits
285_WinAPI_GetIconInfo
286_WinAPI_GetFileSizeEx
287_WinAPI_GetModuleHandle
288_WinAPI_GetObject
289_WinAPI_GetOverlappedResult
290_WinAPI_GetStdHandle
291_WinAPI_GetTextExtentPoint32
292_WinAPI_LoadBitmap
293_WinAPI_LocalFree
294_WinAPI_MessageBeep
295_WinAPI_MulDiv
296_WinAPI_OpenProcess: a few unchecked ones
297_WinAPI_ReadFile
298_WinAPI_ReadProcessMemory
299_WinAPI_RegisterWindowMessage
300_WinAPI_SetEvent
301_WinAPI_SetHandleInformation
302_WinAPI_SetProcessAffinityMask
303_WinAPI_SetWindowPos
304_WinAPI_WaitForInputIdle
305_WinAPI_WaitForMultipleObjects
306_WinAPI_WaitForSingleObject
307_WinAPI_WriteConsole
308_WinAPI_WriteFile
309_WinAPI_WriteProcessMemory
310
311
312<WinNet.au3>
313
314NOTE on most of these functions: the ANSI version of the function is being called. These should be updated to Unicode (wide) calls.
315
316_WinNet_AddConnection
317_WinNet_AddConnection2
318_WinNet_AddConnection3
319_WinNet_CancelConnection
320_WinNet_CancelConnection2
321_WinNet_CloseEnum
322_WinNet_ConnectionDialog
323_WinNet_ConnectionDialog1
324_WinNet_DisconnectDialog
325_WinNet_DisconnectDialog1
326_WinNet_EnumResource
327_WinNet_GetConnection
328_WinNet_GetConnectionPerformance
329_WinNet_GetLastError
330_WinNet_GetNetworkInformation
331_WinNet_GetProviderName
332_WinNet_GetResourceInformation
333_WinNet_GetResourceParent
334_WinNet_GetUniversalName
335_WinNet_GetUser
336_WinNet_OpenEnum
337_WinNet_RestoreConnection
338_WinNet_UseConnection
339
340
341-----------------------------------------------------------
342Additionally, the following DLL calls, which have proper @error handling, are using the ANSI call variants rather than Unicode (wide) DllCalls:
343-----------------------------------------------------------
344
345<Sound.au3>
346__RandomStr
347
348
349<WinAPI.au3>
350_WinAPI_FormatMessage
351_WinAPI_LoadLibrary
352_WinAPI_LoadLibraryEx
353_WinAPI_PostMessage
354_WinAPI_SetDefaultPrinter