2 * Copyright (C) 1998 Marcus Meissner
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber
30 #define RAS_MaxDeviceName 128
31 #define RAS_MaxDeviceType 16
32 #define RAS_MaxEntryName 256
33 #define RAS_MaxPhoneNumber 128
34 #define RAS_MaxAreaCode 10
35 #define RAS_MaxPadType 32
36 #define RAS_MaxX25Address 200
37 #define RAS_MaxFacilities 200
38 #define RAS_MaxUserData 200
39 #define RAS_MaxDnsSuffix 256
41 /* szDeviceType strings for RASDEVINFO */
42 #define RASDT_Direct "direct"
43 #define RASDT_Modem "modem"
44 #define RASDT_Isdn "isdn"
45 #define RASDT_X25 "x25"
48 #define ERROR_BUFFER_TOO_SMALL (RASBASE+3)
49 #define ERROR_INVALID_SIZE (RASBASE+32)
51 typedef struct tagRASDEVINFOA
{
53 CHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
54 CHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
55 } RASDEVINFOA
, *LPRASDEVINFOA
;
57 typedef struct tagRASDEVINFOW
{
59 WCHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
60 WCHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
61 } RASDEVINFOW
, *LPRASDEVINFOW
;
63 DECL_WINELIB_TYPE_AW(RASDEVINFO
)
64 DECL_WINELIB_TYPE_AW(LPRASDEVINFO
)
66 DECLARE_HANDLE(HRASCONN
);
67 typedef HRASCONN
* LPHRASCONN
;
69 typedef struct tagRASCONNA
{
72 CHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
73 CHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
74 CHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
75 CHAR szPhonebook
[ MAX_PATH
];
77 } RASCONNA
,*LPRASCONNA
;
79 typedef struct tagRASCONNW
{
82 WCHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
83 WCHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
84 WCHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
85 WCHAR szPhonebook
[ MAX_PATH
];
87 } RASCONNW
,*LPRASCONNW
;
89 DECL_WINELIB_TYPE_AW(RASCONN
)
90 DECL_WINELIB_TYPE_AW(LPRASCONN
)
92 typedef struct tagRASENTRYNAMEA
{
94 CHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
95 } RASENTRYNAMEA
, *LPRASENTRYNAMEA
;
97 typedef struct tagRASENTRYNAMEW
{
99 WCHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
100 } RASENTRYNAMEW
, *LPRASENTRYNAMEW
;
102 DECL_WINELIB_TYPE_AW(RASENTRYNAME
)
103 DECL_WINELIB_TYPE_AW(LPRASENTRYNAME
)
105 typedef struct tagRASDIALPARAMSA
{
107 CHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
108 CHAR szPhoneNumber
[ RAS_MaxPhoneNumber
+ 1 ];
109 CHAR szCallbackNumber
[ RAS_MaxCallbackNumber
+ 1 ];
110 CHAR szUserName
[ UNLEN
+ 1 ];
111 CHAR szPassword
[ PWLEN
+ 1 ];
112 CHAR szDomain
[ DNLEN
+ 1 ];
115 } RASDIALPARAMSA
, *LPRASDIALPARAMSA
;
117 typedef struct tagRASDIALPARAMSW
{
119 WCHAR szEntryName
[ RAS_MaxEntryName
+ 1 ];
120 WCHAR szPhoneNumber
[ RAS_MaxPhoneNumber
+ 1 ];
121 WCHAR szCallbackNumber
[ RAS_MaxCallbackNumber
+ 1 ];
122 WCHAR szUserName
[ UNLEN
+ 1 ];
123 WCHAR szPassword
[ PWLEN
+ 1 ];
124 WCHAR szDomain
[ DNLEN
+ 1 ];
127 } RASDIALPARAMSW
, *LPRASDIALPARAMSW
;
129 DECL_WINELIB_TYPE_AW(RASDIALPARAMS
)
130 DECL_WINELIB_TYPE_AW(LPRASDIALPARAMS
)
132 typedef struct tagRASIPADDR
{
133 BYTE classA
,classB
,classC
,classD
;
136 #define RASEO_UseCountryAndAreaCodes 0x0001
137 #define RASEO_SpecificIpAddr 0x0002
138 #define RASEO_SpecificNameServers 0x0004
139 #define RASEO_IpHeaderCompression 0x0008
140 #define RASEO_RemoteDefaultGateway 0x0010
141 #define RASEO_DisableLcpExtensions 0x0020
142 #define RASEO_TerminalBeforeDial 0x0040
143 #define RASEO_TerminalAfterDial 0x0080
144 #define RASEO_ModemLights 0x0100
145 #define RASEO_SwCompression 0x0200
146 #define RASEO_RequireEncryptedPw 0x0400
147 #define RASEO_RequireMsEncryptedPw 0x0800
148 #define RASEO_RequireDataEncryption 0x1000
149 #define RASEO_NetworkLogon 0x2000
150 #define RASEO_UseLogonCredentials 0x4000
151 #define RASEO_PromoteAlternates 0x8000
152 typedef struct tagRASENTRYA
{
160 CHAR szAreaCode
[ RAS_MaxAreaCode
+ 1 ];
161 CHAR szLocalPhoneNumber
[ RAS_MaxPhoneNumber
+ 1 ];
162 DWORD dwAlternateOffset
;
164 /* IP related stuff */
168 RASIPADDR ipaddrDnsAlt
;
169 RASIPADDR ipaddrWins
;
170 RASIPADDR ipaddrWinsAlt
;
172 /* Framing (for ppp/isdn etc...) */
175 DWORD dwfNetProtocols
;
176 DWORD dwFramingProtocol
;
178 CHAR szScript
[ MAX_PATH
];
180 CHAR szAutodialDll
[ MAX_PATH
];
181 CHAR szAutodialFunc
[ MAX_PATH
];
183 CHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
184 CHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
188 CHAR szX25PadType
[ RAS_MaxPadType
+ 1 ];
189 CHAR szX25Address
[ RAS_MaxX25Address
+ 1 ];
190 CHAR szX25Facilities
[ RAS_MaxFacilities
+ 1 ];
191 CHAR szX25UserData
[ RAS_MaxUserData
+ 1 ];
197 /* Multilink and BAP */
201 DWORD dwDialExtraPercent
;
202 DWORD dwDialExtraSampleSeconds
;
203 DWORD dwHangUpExtraPercent
;
204 DWORD dwHangUpExtraSampleSeconds
;
207 DWORD dwIdleDisconnectSeconds
;
209 DWORD dwType
; /* entry type */
210 DWORD dwEncryptionType
; /* type of encryption to use */
211 DWORD dwCustomAuthKey
; /* authentication key for EAP */
212 GUID guidId
; /* guid that represents the phone-book entry */
213 CHAR szCustomDialDll
[MAX_PATH
]; /* DLL for custom dialing */
214 DWORD dwVpnStrategy
; /* specifies type of VPN protocol */
218 CHAR szDnsSuffix
[RAS_MaxDnsSuffix
];
219 DWORD dwTcpWindowSize
;
220 CHAR szPrerequisitePbk
[MAX_PATH
];
221 CHAR szPrerequisiteEntry
[RAS_MaxEntryName
+ 1];
224 } RASENTRYA
, *LPRASENTRYA
;
226 typedef struct tagRASENTRYW
{
234 WCHAR szAreaCode
[ RAS_MaxAreaCode
+ 1 ];
235 WCHAR szLocalPhoneNumber
[ RAS_MaxPhoneNumber
+ 1 ];
236 DWORD dwAlternateOffset
;
238 /* IP related stuff */
242 RASIPADDR ipaddrDnsAlt
;
243 RASIPADDR ipaddrWins
;
244 RASIPADDR ipaddrWinsAlt
;
246 /* Framing (for ppp/isdn etc...) */
249 DWORD dwfNetProtocols
;
250 DWORD dwFramingProtocol
;
252 WCHAR szScript
[ MAX_PATH
];
254 WCHAR szAutodialDll
[ MAX_PATH
];
255 WCHAR szAutodialFunc
[ MAX_PATH
];
257 WCHAR szDeviceType
[ RAS_MaxDeviceType
+ 1 ];
258 WCHAR szDeviceName
[ RAS_MaxDeviceName
+ 1 ];
262 WCHAR szX25PadType
[ RAS_MaxPadType
+ 1 ];
263 WCHAR szX25Address
[ RAS_MaxX25Address
+ 1 ];
264 WCHAR szX25Facilities
[ RAS_MaxFacilities
+ 1 ];
265 WCHAR szX25UserData
[ RAS_MaxUserData
+ 1 ];
271 /* Multilink and BAP */
275 DWORD dwDialExtraPercent
;
276 DWORD dwDialExtraSampleSeconds
;
277 DWORD dwHangUpExtraPercent
;
278 DWORD dwHangUpExtraSampleSeconds
;
281 DWORD dwIdleDisconnectSeconds
;
283 DWORD dwType
; /* entry type */
284 DWORD dwEncryptionType
; /* type of encryption to use */
285 DWORD dwCustomAuthKey
; /* authentication key for EAP */
286 GUID guidId
; /* guid that represents the phone-book entry */
287 WCHAR szCustomDialDll
[MAX_PATH
]; /* DLL for custom dialing */
288 DWORD dwVpnStrategy
; /* specifies type of VPN protocol */
292 WCHAR szDnsSuffix
[RAS_MaxDnsSuffix
];
293 DWORD dwTcpWindowSize
;
294 WCHAR szPrerequisitePbk
[MAX_PATH
];
295 WCHAR szPrerequisiteEntry
[RAS_MaxEntryName
+ 1];
298 } RASENTRYW
, *LPRASENTRYW
;
300 DECL_WINELIB_TYPE_AW(RASENTRY
)
302 #define RASCS_PAUSED 0x1000
303 #define RASCS_DONE 0x2000
304 typedef enum tagRASCONNSTATE
309 RASCS_DeviceConnected
,
310 RASCS_AllDevicesConnected
,
315 RASCS_AuthChangePassword
,
319 RASCS_ReAuthenticate
,
321 RASCS_PrepareForCallback
,
322 RASCS_WaitForModemReset
,
323 RASCS_WaitForCallback
,
325 RASCS_StartAuthentication
,
326 RASCS_CallbackComplete
,
328 RASCS_SubEntryConnected
,
329 RASCS_SubEntryDisconnected
,
330 RASCS_Interactive
= RASCS_PAUSED
,
331 RASCS_RetryAuthentication
,
332 RASCS_CallbackSetByCaller
,
333 RASCS_PasswordExpired
,
334 RASCS_Connected
= RASCS_DONE
,
336 } RASCONNSTATE
, *LPRASCONNSTATE
;
338 typedef struct tagRASCONNSTATUSA
341 RASCONNSTATE rasconnstate
;
343 CHAR szDeviceType
[RAS_MaxDeviceType
+ 1];
344 CHAR szDeviceName
[RAS_MaxDeviceName
+ 1];
345 } RASCONNSTATUSA
, *LPRASCONNSTATUSA
;
347 typedef struct tagRASCONNSTATUSW
350 RASCONNSTATE rasconnstate
;
352 WCHAR szDeviceType
[RAS_MaxDeviceType
+ 1];
353 WCHAR szDeviceName
[RAS_MaxDeviceName
+ 1];
354 } RASCONNSTATUSW
, *LPRASCONNSTATUSW
;
356 DECL_WINELIB_TYPE_AW(RASCONNSTATUS
)
358 typedef enum tagRASPROJECTION
361 RASP_PppNbf
= 0x803F,
362 RASP_PppIpx
= 0x802B,
364 RASP_PppLcp
= 0xC021,
366 } RASPROJECTION
, *LPRASPROJECTION
;
368 typedef struct tagRASSUBENTRYA
372 CHAR szDeviceType
[RAS_MaxDeviceType
+ 1];
373 CHAR szDeviceName
[RAS_MaxDeviceName
+ 1];
374 CHAR szLocalPhoneNumber
[RAS_MaxPhoneNumber
+ 1];
375 DWORD dwAlternateOffset
;
376 } RASSUBENTRYA
, *LPRASSUBENTRYA
;
378 typedef struct tagRASSUBENTRYW
382 WCHAR szDeviceType
[RAS_MaxDeviceType
+ 1];
383 WCHAR szDeviceName
[RAS_MaxDeviceName
+ 1];
384 WCHAR szLocalPhoneNumber
[RAS_MaxPhoneNumber
+ 1];
385 DWORD dwAlternateOffset
;
386 } RASSUBENTRYW
, *LPRASSUBENTRYW
;
388 typedef struct tagRASDIALEXTENSIONS
394 } RASDIALEXTENSIONS
, *LPRASDIALEXTENSIONS
;
396 typedef struct tagRASAUTODIALENTRYA
400 DWORD dwDialingLocation
;
401 CHAR szEntry
[ RAS_MaxEntryName
+ 1 ];
402 } RASAUTODIALENTRYA
, *LPRASAUTODIALENTRYA
;
404 typedef struct tagRASAUTODIALENTRYW
408 DWORD dwDialingLocation
;
409 WCHAR szEntry
[ RAS_MaxEntryName
+ 1 ];
410 } RASAUTODIALENTRYW
, *LPRASAUTODIALENTRYW
;
413 DWORD WINAPI
RasConnectionNotificationA(HRASCONN
,HANDLE
,DWORD
);
414 DWORD WINAPI
RasConnectionNotificationW(HRASCONN
,HANDLE
,DWORD
);
415 #define RasConnectionNotification WINELIB_NAME_AW(RasConnectionNotification)
416 DWORD WINAPI
RasCreatePhonebookEntryA(HWND
,LPCSTR
);
417 DWORD WINAPI
RasCreatePhonebookEntryW(HWND
,LPCWSTR
);
418 #define RasCreatePhonebookEntry WINELIB_NAME_AW(RasCreatePhonebookEntry)
419 DWORD WINAPI
RasDeleteEntryA(LPCSTR
,LPCSTR
);
420 DWORD WINAPI
RasDeleteEntryW(LPCWSTR
,LPCWSTR
);
421 #define RasDeleteEntry WINELIB_NAME_AW(RasDeleteEntry)
422 DWORD WINAPI
RasDeleteSubEntryA(LPCSTR
,LPCSTR
,DWORD
);
423 DWORD WINAPI
RasDeleteSubEntryW(LPCWSTR
,LPCWSTR
,DWORD
);
424 #define RasDeleteSubEntry WINELIB_NAME_AW(RasDeleteSubEntry)
425 DWORD WINAPI
RasDialA(LPRASDIALEXTENSIONS
,LPCSTR
,LPRASDIALPARAMSA
,DWORD
,LPVOID
,LPHRASCONN
);
426 DWORD WINAPI
RasDialW(LPRASDIALEXTENSIONS
,LPCWSTR
,LPRASDIALPARAMSW
,DWORD
,LPVOID
,LPHRASCONN
);
427 #define RasDial WINELIB_NAME_AW(RasDial)
428 DWORD WINAPI
RasEditPhonebookEntryA(HWND
,LPCSTR
,LPCSTR
);
429 DWORD WINAPI
RasEditPhonebookEntryW(HWND
,LPCWSTR
,LPCWSTR
);
430 #define RasEditPhonebookEntry WINELIB_NAME_AW(RasEditPhonebookEntry)
431 DWORD WINAPI
RasEnumAutodialAddressesA(LPSTR
*,LPDWORD
,LPDWORD
);
432 DWORD WINAPI
RasEnumAutodialAddressesW(LPWSTR
*,LPDWORD
,LPDWORD
);
433 #define RasEnumAutodialAddresses WINELIB_NAME_AW(RasEnumAutodialAddresses)
434 DWORD WINAPI
RasEnumConnectionsA(LPRASCONNA
,LPDWORD
,LPDWORD
);
435 DWORD WINAPI
RasEnumConnectionsW(LPRASCONNW
,LPDWORD
,LPDWORD
);
436 #define RasEnumConnections WINELIB_NAME_AW(RasEnumConnections)
437 DWORD WINAPI
RasEnumDevicesA(LPRASDEVINFOA
,LPDWORD
,LPDWORD
);
438 DWORD WINAPI
RasEnumDevicesW(LPRASDEVINFOW
,LPDWORD
,LPDWORD
);
439 #define RasEnumDevices WINELIB_NAME_AW(RasEnumDevices)
440 DWORD WINAPI
RasEnumEntriesA(LPCSTR
,LPCSTR
,LPRASENTRYNAMEA
,LPDWORD
,LPDWORD
);
441 DWORD WINAPI
RasEnumEntriesW(LPCWSTR
,LPCWSTR
,LPRASENTRYNAMEW
,LPDWORD
,LPDWORD
);
442 #define RasEnumEntries WINELIB_NAME_AW(RasEnumEntries)
443 DWORD WINAPI
RasGetAutodialAddressA(LPCSTR
,LPDWORD
,LPRASAUTODIALENTRYA
,LPDWORD
,LPDWORD
);
444 DWORD WINAPI
RasGetAutodialAddressW(LPCWSTR
,LPDWORD
,LPRASAUTODIALENTRYW
,LPDWORD
,LPDWORD
);
445 #define RasGetAutodialAddresses WINELIB_NAME_AW(RasGetAutodialAddresses)
446 DWORD WINAPI
RasGetAutodialEnableA(DWORD
,LPBOOL
);
447 DWORD WINAPI
RasGetAutodialEnableW(DWORD
,LPBOOL
);
448 #define RasGetAutodialEnable WINELIB_NAME_AW(RasGetAutodialEnable)
449 DWORD WINAPI
RasGetAutodialParamA(DWORD dwKey
, LPVOID lpvValue
, LPDWORD lpdwcbValue
);
450 DWORD WINAPI
RasGetAutodialParamW(DWORD dwKey
, LPVOID lpvValue
, LPDWORD lpdwcbValue
);
451 #define RasGetAutodialParam WINELIB_NAME_AW(RasGetAutodialParam)
452 DWORD WINAPI
RasGetConnectStatusA(HRASCONN
,LPRASCONNSTATUSA
);
453 DWORD WINAPI
RasGetConnectStatusW(HRASCONN
,LPRASCONNSTATUSW
);
454 #define RasGetConnectStatus WINELIB_NAME_AW(RasGetConnectStatus)
455 DWORD WINAPI
RasGetEntryDialParamsA(LPCSTR
,LPRASDIALPARAMSA
,LPBOOL
);
456 DWORD WINAPI
RasGetEntryDialParamsW(LPCWSTR
,LPRASDIALPARAMSW
,LPBOOL
);
457 #define RasGetEntryDialParams WINELIB_NAME_AW(RasGetEntryDialParams)
458 DWORD WINAPI
RasGetEntryPropertiesA(LPCSTR
,LPCSTR
,LPRASENTRYA
,LPDWORD
,LPBYTE
,LPDWORD
);
459 DWORD WINAPI
RasGetEntryPropertiesW(LPCWSTR
,LPCWSTR
,LPRASENTRYW
,LPDWORD
,LPBYTE
,LPDWORD
);
460 #define RasGetEntryProperties WINELIB_NAME_AW(RasGetEntryProperties)
461 DWORD WINAPI
RasGetErrorStringA(UINT
,LPSTR
,DWORD
);
462 DWORD WINAPI
RasGetErrorStringW(UINT
,LPWSTR
,DWORD
);
463 #define RasGetErrorString WINELIB_NAME_AW(RasGetErrorString)
464 DWORD WINAPI
RasGetProjectionInfoA(HRASCONN
,RASPROJECTION
,LPVOID
,LPDWORD
);
465 DWORD WINAPI
RasGetProjectionInfoW(HRASCONN
,RASPROJECTION
,LPVOID
,LPDWORD
);
466 #define RasGetProjectionInfo WINELIB_NAME_AW(RasGetProjectionInfo)
467 DWORD WINAPI
RasHangUpA(HRASCONN
);
468 DWORD WINAPI
RasHangUpW(HRASCONN
);
469 #define RasHangUp WINELIB_NAME_AW(RasHangUp)
470 DWORD WINAPI
RasRenameEntryA(LPCSTR
,LPCSTR
,LPCSTR
);
471 DWORD WINAPI
RasRenameEntryW(LPCWSTR
,LPCWSTR
,LPCWSTR
);
472 #define RasRenameEntry WINELIB_NAME_AW(RasRenameEntry)
473 DWORD WINAPI
RasSetAutodialAddressA(LPCSTR
,DWORD
,LPRASAUTODIALENTRYA
,DWORD
,DWORD
);
474 DWORD WINAPI
RasSetAutodialAddressW(LPCWSTR
,DWORD
,LPRASAUTODIALENTRYW
,DWORD
,DWORD
);
475 #define RasSetAutodialAddress WINELIB_NAME_AW(RasSetAutodialAddress)
476 DWORD WINAPI
RasSetAutodialParamA(DWORD
,LPVOID
,DWORD
);
477 DWORD WINAPI
RasSetAutodialParamW(DWORD
,LPVOID
,DWORD
);
478 #define RasSetAutodialParam WINELIB_NAME_AW(RasSetAutodialParam)
479 DWORD WINAPI
RasSetEntryDialParamsA(LPCSTR
,LPRASDIALPARAMSA
,BOOL
);
480 DWORD WINAPI
RasSetEntryDialParamsW(LPCWSTR
,LPRASDIALPARAMSW
,BOOL
);
481 #define RasSetEntryDialParams WINELIB_NAME_AW(RasSetEntryDialParams)
482 DWORD WINAPI
RasSetSubEntryPropertiesA(LPCSTR
,LPCSTR
,DWORD
,LPRASSUBENTRYA
,DWORD
,LPBYTE
,DWORD
);
483 DWORD WINAPI
RasSetSubEntryPropertiesW(LPCWSTR
,LPCWSTR
,DWORD
,LPRASSUBENTRYW
,DWORD
,LPBYTE
,DWORD
);
484 #define RasSetSubEntryProperties WINELIB_NAME_AW(RasSetSubEntryProperties)
485 DWORD WINAPI
RasValidateEntryNameA(LPCSTR lpszPhonebook
, LPCSTR lpszEntry
);
486 DWORD WINAPI
RasValidateEntryNameW(LPCWSTR lpszPhonebook
, LPCWSTR lpszEntry
);
487 #define RasValidateEntryName WINELIB_NAME_AW(RasValidateEntryName)
488 DWORD WINAPI
RasSetEntryPropertiesA(LPCSTR
,LPCSTR
,LPRASENTRYA
,DWORD
,LPBYTE
,DWORD
);
489 DWORD WINAPI
RasSetEntryPropertiesW(LPCWSTR
,LPCWSTR
,LPRASENTRYW
,DWORD
,LPBYTE
,DWORD
);
490 #define RasSetEntryProperties WINELIB_NAME_AW(RasSetEntryProperties)
491 DWORD WINAPI
RasSetAutodialEnableA(DWORD dwDialingLocation
, BOOL fEnabled
);
492 DWORD WINAPI
RasSetAutodialEnableW(DWORD dwDialingLocation
, BOOL fEnabled
);
493 #define RasSetAutodialEnable WINELIB_NAME_AW(RasSetAutodialEnable)