1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _NPAPI_INCLUDED 7 #define _NPAPI_INCLUDED 8 9 #include <_mingw_unicode.h> 10 11 typedef DWORD (WINAPI *PF_NPAddConnection)(LPNETRESOURCEW lpNetResource,LPWSTR lpPassword,LPWSTR lpUserName); 12 typedef DWORD (WINAPI *PF_NPAddConnection3)(HWND hwndOwner,LPNETRESOURCEW lpNetResource,LPWSTR lpPassword,LPWSTR lpUserName,DWORD dwFlags); 13 typedef DWORD (WINAPI *PF_NPCancelConnection)(LPWSTR lpName,WINBOOL fForce); 14 typedef DWORD (WINAPI *PF_NPGetConnection)(LPWSTR lpLocalName,LPWSTR lpRemoteName,LPDWORD lpnBufferLen); 15 16 #define WNGETCON_CONNECTED 0x00000000 17 #define WNGETCON_DISCONNECTED 0x00000001 18 19 typedef DWORD (WINAPI *PF_NPGetConnection3)(LPCWSTR lpLocalName,DWORD dwLevel,LPVOID lpBuffer,LPDWORD lpBufferSize); 20 typedef DWORD (WINAPI *PF_NPGetConnectionPerformance)(LPCWSTR lpRemoteName,LPNETCONNECTINFOSTRUCT lpNetConnectInfo); 21 typedef DWORD (WINAPI *PF_NPGetUniversalName)(LPWSTR lpLocalPath,DWORD dwInfoLevel,LPVOID lpBuffer,LPDWORD lpnBufferSize); 22 typedef DWORD (WINAPI *PF_NPOpenEnum)(DWORD dwScope,DWORD dwType,DWORD dwUsage,LPNETRESOURCEW lpNetResource,LPHANDLE lphEnum); 23 typedef DWORD (WINAPI *PF_NPEnumResource)(HANDLE hEnum,LPDWORD lpcCount,LPVOID lpBuffer,LPDWORD lpBufferSize); 24 25 DWORD WINAPI NPAddConnection(LPNETRESOURCEW lpNetResource,LPWSTR lpPassword,LPWSTR lpUserName); 26 DWORD WINAPI NPAddConnection3(HWND hwndOwner,LPNETRESOURCEW lpNetResource,LPTSTR lpPassword,LPTSTR lpUserName,DWORD dwFlags); 27 DWORD WINAPI NPCancelConnection(LPWSTR lpName,WINBOOL fForce); 28 DWORD WINAPI NPGetConnection(LPWSTR lpLocalName,LPWSTR lpRemoteName,LPDWORD lpnBufferLen); 29 DWORD WINAPI NPGetConnection3(LPCWSTR lpLocalName,DWORD dwLevel,LPVOID lpBuffer,LPDWORD lpBufferSize); 30 DWORD WINAPI NPGetConnectionPerformance(LPCWSTR lpRemoteName,LPNETCONNECTINFOSTRUCT lpNetConnectInfo); 31 DWORD WINAPI NPGetUniversalName(LPWSTR lpLocalPath,DWORD dwInfoLevel,LPVOID lpBuffer,LPDWORD lpBufferSize); 32 DWORD WINAPI NPOpenEnum(DWORD dwScope,DWORD dwType,DWORD dwUsage,LPNETRESOURCEW lpNetResource,LPHANDLE lphEnum); 33 DWORD WINAPI NPEnumResource(HANDLE hEnum,LPDWORD lpcCount,LPVOID lpBuffer,LPDWORD lpBufferSize); 34 DWORD WINAPI NPCloseEnum(HANDLE hEnum); 35 36 typedef DWORD (*PF_NPCloseEnum)(HANDLE hEnum); 37 38 #define WNNC_SPEC_VERSION 0x00000001 39 #define WNNC_SPEC_VERSION51 0x00050001 40 #define WNNC_NET_TYPE 0x00000002 41 #define WNNC_NET_NONE 0x00000000 42 43 #define WNNC_DRIVER_VERSION 0x00000003 44 45 #define WNNC_USER 0x00000004 46 #define WNNC_USR_GETUSER 0x00000001 47 48 #define WNNC_CONNECTION 0x00000006 49 #define WNNC_CON_ADDCONNECTION 0x00000001 50 #define WNNC_CON_CANCELCONNECTION 0x00000002 51 #define WNNC_CON_GETCONNECTIONS 0x00000004 52 #define WNNC_CON_ADDCONNECTION3 0x00000008 53 #define WNNC_CON_GETPERFORMANCE 0x00000040 54 #define WNNC_CON_DEFER 0x00000080 55 56 #define WNNC_DIALOG 0x00000008 57 #define WNNC_DLG_DEVICEMODE 0x00000001 58 #define WNNC_DLG_PROPERTYDIALOG 0x00000020 59 #define WNNC_DLG_SEARCHDIALOG 0x00000040 60 #define WNNC_DLG_FORMATNETWORKNAME 0x00000080 61 #define WNNC_DLG_PERMISSIONEDITOR 0x00000100 62 #define WNNC_DLG_GETRESOURCEPARENT 0x00000200 63 #define WNNC_DLG_GETRESOURCEINFORMATION 0x00000800 64 65 #define WNNC_ADMIN 0x00000009 66 #define WNNC_ADM_GETDIRECTORYTYPE 0x00000001 67 #define WNNC_ADM_DIRECTORYNOTIFY 0x00000002 68 69 #define WNNC_ENUMERATION 0x0000000B 70 #define WNNC_ENUM_GLOBAL 0x00000001 71 #define WNNC_ENUM_LOCAL 0x00000002 72 #define WNNC_ENUM_CONTEXT 0x00000004 73 #define WNNC_ENUM_SHAREABLE 0x00000008 74 75 #define WNNC_START 0x0000000C 76 #define WNNC_WAIT_FOR_START 0x00000001 77 78 typedef DWORD (WINAPI *PF_NPGetCaps)(DWORD ndex); 79 typedef DWORD (WINAPI *PF_NPGetUser)(LPWSTR lpName,LPWSTR lpUserName,LPDWORD lpnBufferLen); 80 81 DWORD WINAPI NPGetCaps (DWORD ndex); 82 DWORD WINAPI NPGetUser(LPWSTR lpName,LPWSTR lpUserName,LPDWORD lpnBufferLen); 83 84 85 #define WNTYPE_DRIVE 1 86 #define WNTYPE_FILE 2 87 #define WNTYPE_PRINTER 3 88 #define WNTYPE_COMM 4 89 90 #define WNPS_FILE 0 91 #define WNPS_DIR 1 92 #define WNPS_MULT 2 93 94 #define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001 95 96 typedef DWORD (WINAPI *PF_NPDeviceMode)(HWND hParent); 97 typedef DWORD (WINAPI *PF_NPSearchDialog)(HWND hwndParent,LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,DWORD cbBuffer,LPDWORD lpnFlags); 98 typedef DWORD (WINAPI *PF_NPGetResourceParent)(LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,LPDWORD lpBufferSize); 99 typedef DWORD (WINAPI *PF_NPGetResourceInformation)(LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,LPDWORD lpBufferSize,LPWSTR *lplpSystem); 100 typedef DWORD (WINAPI *PF_NPFormatNetworkName)(LPWSTR lpRemoteName,LPWSTR lpFormattedName,LPDWORD lpnLength,DWORD dwFlags,DWORD dwAveCharPerLine); 101 typedef DWORD (WINAPI *PF_NPGetPropertyText)(DWORD iButton,DWORD nPropSel,LPWSTR lpName,LPWSTR lpButtonName,DWORD nButtonNameLen,DWORD nType); 102 typedef DWORD (WINAPI *PF_NPPropertyDialog)(HWND hwndParent,DWORD iButtonDlg,DWORD nPropSel,LPWSTR lpFileName,DWORD nType); 103 104 DWORD WINAPI NPDeviceMode(HWND hParent); 105 DWORD WINAPI NPSearchDialog(HWND hwndParent,LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,DWORD cbBuffer,LPDWORD lpnFlags); 106 DWORD WINAPI NPGetResourceParent(LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,LPDWORD lpBufferSize); 107 DWORD WINAPI NPGetResourceInformation(LPNETRESOURCEW lpNetResource,LPVOID lpBuffer,LPDWORD lpBufferSize,LPWSTR *lplpSystem); 108 DWORD WINAPI NPFormatNetworkName(LPWSTR lpRemoteName,LPWSTR lpFormattedName,LPDWORD lpnLength,DWORD dwFlags,DWORD dwAveCharPerLine); 109 DWORD WINAPI NPGetPropertyText(DWORD iButton,DWORD nPropSel,LPWSTR lpName,LPWSTR lpButtonName,DWORD nButtonNameLen,DWORD nType); 110 DWORD WINAPI NPPropertyDialog(HWND hwndParent,DWORD iButtonDlg,DWORD nPropSel,LPWSTR lpFileName,DWORD nType); 111 112 #define WNDT_NORMAL 0 113 #define WNDT_NETWORK 1 114 115 #define WNDN_MKDIR 1 116 #define WNDN_RMDIR 2 117 #define WNDN_MVDIR 3 118 119 typedef DWORD (WINAPI *PF_NPGetDirectoryType)(LPWSTR lpName,LPINT lpType,WINBOOL bFlushCache); 120 typedef DWORD (WINAPI *PF_NPDirectoryNotify)(HWND hwnd,LPWSTR lpDir,DWORD dwOper); 121 122 DWORD WINAPI NPGetDirectoryType(LPWSTR lpName,LPINT lpType,WINBOOL bFlushCache); 123 DWORD WINAPI NPDirectoryNotify(HWND hwnd,LPWSTR lpDir,DWORD dwOper); 124 VOID WNetSetLastErrorA(DWORD err,LPSTR lpError,LPSTR lpProviders); 125 VOID WNetSetLastErrorW(DWORD err,LPWSTR lpError,LPWSTR lpProviders); 126 127 #define WNetSetLastError __MINGW_NAME_AW(WNetSetLastError) 128 129 #define WN_NETWORK_CLASS 0x00000001 130 #define WN_CREDENTIAL_CLASS 0x00000002 131 #define WN_PRIMARY_AUTHENT_CLASS 0x00000004 132 #define WN_SERVICE_CLASS 0x00000008 133 134 #define WN_VALID_LOGON_ACCOUNT 0x00000001 135 #define WN_NT_PASSWORD_CHANGED 0x00000002 136 137 typedef DWORD (WINAPI *PF_NPLogonNotify) (PLUID lpLogonId,LPCWSTR lpAuthentInfoType,LPVOID lpAuthentInfo,LPCWSTR lpPreviousAuthentInfoType,LPVOID lpPreviousAuthentInfo,LPWSTR lpStationName,LPVOID StationHandle,LPWSTR *lpLogonScript); 138 typedef DWORD (WINAPI *PF_NPPasswordChangeNotify) (LPCWSTR lpAuthentInfoType,LPVOID lpAuthentInfo,LPCWSTR lpPreviousAuthentInfoType,LPVOID lpPreviousAuthentInfo,LPWSTR lpStationName,LPVOID StationHandle,DWORD dwChangeInfo); 139 140 DWORD WINAPI NPLogonNotify (PLUID lpLogonId,LPCWSTR lpAuthentInfoType,LPVOID lpAuthentInfo,LPCWSTR lpPreviousAuthentInfoType,LPVOID lpPreviousAuthentInfo,LPWSTR lpStationName,LPVOID StationHandle,LPWSTR *lpLogonScript); 141 DWORD WINAPI NPPasswordChangeNotify (LPCWSTR lpAuthentInfoType,LPVOID lpAuthentInfo,LPCWSTR lpPreviousAuthentInfoType,LPVOID lpPreviousAuthentInfo,LPWSTR lpStationName,LPVOID StationHandle,DWORD dwChangeInfo); 142 143 #define NOTIFY_PRE 0x00000001 144 #define NOTIFY_POST 0x00000002 145 146 #define WNPERMC_PERM 0x00000001 147 #define WNPERMC_AUDIT 0x00000002 148 #define WNPERMC_OWNER 0x00000004 149 150 #define WNPERM_DLG_PERM 0 151 #define WNPERM_DLG_AUDIT 1 152 #define WNPERM_DLG_OWNER 2 153 154 typedef struct _NOTIFYINFO { 155 DWORD dwNotifyStatus; 156 DWORD dwOperationStatus; 157 LPVOID lpContext; 158 } NOTIFYINFO,*LPNOTIFYINFO; 159 160 typedef struct _NOTIFYADD { 161 HWND hwndOwner; 162 NETRESOURCE NetResource; 163 DWORD dwAddFlags; 164 } NOTIFYADD,*LPNOTIFYADD; 165 166 typedef struct _NOTIFYCANCEL { 167 LPTSTR lpName; 168 LPTSTR lpProvider; 169 DWORD dwFlags; 170 WINBOOL fForce; 171 } NOTIFYCANCEL,*LPNOTIFYCANCEL; 172 173 typedef DWORD (WINAPI *PF_AddConnectNotify) (LPNOTIFYINFO lpNotifyInfo,LPNOTIFYADD lpAddInfo); 174 typedef DWORD (WINAPI *PF_CancelConnectNotify) (LPNOTIFYINFO lpNotifyInfo,LPNOTIFYCANCEL lpCancelInfo); 175 typedef DWORD (WINAPI *PF_NPFMXGetPermCaps)(LPWSTR lpDriveName); 176 typedef DWORD (WINAPI *PF_NPFMXEditPerm)(LPWSTR lpDriveName,HWND hwndFMX,DWORD nDialogType); 177 typedef DWORD (WINAPI *PF_NPFMXGetPermHelp)(LPWSTR lpDriveName,DWORD nDialogType,WINBOOL fDirectory,LPVOID lpFileNameBuffer,LPDWORD lpBufferSize,LPDWORD lpnHelpContext); 178 179 DWORD WINAPI AddConnectNotify (LPNOTIFYINFO lpNotifyInfo,LPNOTIFYADD lpAddInfo); 180 DWORD WINAPI CancelConnectNotify (LPNOTIFYINFO lpNotifyInfo,LPNOTIFYCANCEL lpCancelInfo); 181 DWORD WINAPI NPFMXGetPermCaps(LPWSTR lpDriveName); 182 DWORD WINAPI NPFMXEditPerm(LPWSTR lpDriveName,HWND hwndFMX,DWORD nDialogType); 183 DWORD WINAPI NPFMXGetPermHelp(LPWSTR lpDriveName,DWORD nDialogType,WINBOOL fDirectory,LPVOID lpFileNameBuffer,LPDWORD lpBufferSize,LPDWORD lpnHelpContext); 184 185 #endif 186