Closed Bug 906350 Opened 11 years ago Closed 11 years ago

WinUtils Initialize() checks the return result of LoadLibrary using the wrong value

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: jimm, Assigned: avih)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Is the cast even needed? I'm pretty sure HMODULE is just a void pointer under the hood.
Depends on: 907635
> // MSDN: "If the function succeeds, the return value is greater than 31."
Where in MSDN? I was unable to find the statement at least here:
http://msdn.microsoft.com/library/ms684175.aspx
Assignee: nobody → avihpit
Attachment #795188 - Flags: review?(roc)
It seems that all around the code we either check LoadLibraryW for non-null, or just go ahead with GetProcAddress without checking, and count on it to return null if the HMODULE is invalid.
Attachment #795188 - Attachment is obsolete: true
Attachment #795188 - Flags: review?(roc)
Attachment #795190 - Flags: review?(roc)
Comment on attachment 795190 [details] [diff] [review]
Forgot to removed the comment about >31

Review of attachment 795190 [details] [diff] [review]:
-----------------------------------------------------------------

I think I was looking at http://msdn.microsoft.com/en-us/library/windows/desktop/ms684183%28v=vs.85%29.aspx
Attachment #795190 - Flags: review?(roc) → review+
https://hg.mozilla.org/mozilla-central/rev/1a6fa04f0c9e
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: