Skip to content
  • Ahmad Fatoum's avatar
    Nullable pointers now wrapped in Maybe (#83) · 73a7b785
    Ahmad Fatoum authored
    A fix for Issue #24
    
    A number of WinAPI functions have a default action,
    when NULL is passed in place of a valid pointer, mostly strings.
    We now use Maybe wrapped types for these arguments.
    
    This breaks API. In total 15 functions were amended:
    appendMenu
    insertMenu
    modifyMenu
    messageBox
    findWindow
    findWindowEx
    moveFileEx
    setDllDirectory
    defineDosDevice
    setVolumeLabel
    getVolumeInformation
    searchPath
    regCreateKeyEx
    regReplaceKey
    getTimeFormat
    
    And 2 functions' Maybe was removed because passing in Nothing was equal to Just "":
    RegQueryValue
    RegQueryValueKey
    
    createWindow[Ex] can also have NULL as HINSTANCE. As HINSTANCE is a pointer anyway,
    we'll provide a nullHINSTANCE instead of breaking this function's API too
    73a7b785