Differences From Artifact [4c380b195643fbdf]:
- File
src/win32/ras.d
- 2015-04-21 10:46:55 - part of checkin [4e2933c620] on branch trunk - Rebased to the latest verson dmd 2.067. Not yet verified the outcome. (user: kinaba) [annotate]
To Artifact [d951e56f7ba4f779]:
- File
src/win32/ras.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
4 4 * Windows API header module *
5 5 * *
6 6 * Translated from MinGW Windows headers *
7 7 * *
8 8 * Placed into public domain *
9 9 \***********************************************************************/
10 10 module win32.ras;
11 -pragma(lib, "rasapi32.lib");
11 +pragma(lib, "rasapi32");
12 12
13 13 private import win32.basetyps, win32.lmcons, win32.w32api, win32.windef;
14 14
15 15 align(4):
16 16
17 17 const RAS_MaxDeviceType = 16;
18 18 const RAS_MaxPhoneNumber = 128;
................................................................................
91 91 RASDT_Parallel = "PARALLEL";
92 92
93 93 const RASET_Phone = 1;
94 94 const RASET_Vpn = 2;
95 95 const RASET_Direct = 3;
96 96 const RASET_Internet = 4;
97 97
98 -static if (WINVER >= 0x0401) {
98 +static if (_WIN32_WINNT >= 0x401) {
99 99 const RASEO_SecureLocalFiles = 0x00010000;
100 100 const RASCN_Connection = 0x00000001;
101 101 const RASCN_Disconnection = 0x00000002;
102 102 const RASCN_BandwidthAdded = 0x00000004;
103 103 const RASCN_BandwidthRemoved = 0x00000008;
104 104 const RASEDM_DialAll = 1;
105 105 const RASEDM_DialAsNeeded = 2;
................................................................................
111 111 const RASCM_Domain = 0x00000004;
112 112 const RASADP_DisableConnectionQuery = 0;
113 113 const RASADP_LoginSessionDisable = 1;
114 114 const RASADP_SavedAddressesLimit = 2;
115 115 const RASADP_FailedConnectionTimeout = 3;
116 116 const RASADP_ConnectionQueryTimeout = 4;
117 117 }
118 -static if (WINVER >= 0x0500) {
118 +static if (_WIN32_WINNT >= 0x500) {
119 119 const RDEOPT_CustomDial = 0x00001000;
120 120 const RASLCPAP_PAP = 0xC023;
121 121 const RASLCPAP_SPAP = 0xC027;
122 122 const RASLCPAP_CHAP = 0xC223;
123 123 const RASLCPAP_EAP = 0xC227;
124 124 const RASLCPAD_CHAP_MD5 = 0x05;
125 125 const RASLCPAD_CHAP_MS = 0x80;
................................................................................
196 196 RASCS_LogonNetwork,
197 197 RASCS_SubEntryConnected,
198 198 RASCS_SubEntryDisconnected,
199 199 RASCS_Interactive = RASCS_PAUSED,
200 200 RASCS_RetryAuthentication,
201 201 RASCS_CallbackSetByCaller,
202 202 RASCS_PasswordExpired,
203 -// static if (WINVER >= 0x0500) {
203 +// static if (_WIN32_WINNT >= 0x500) {
204 204 RASCS_InvokeEapUI,
205 205 // }
206 206 RASCS_Connected = RASCS_DONE,
207 207 RASCS_Disconnected
208 208 }
209 209 alias RASCONNSTATE* LPRASCONNSTATE;
210 210
211 211 enum RASPROJECTION {
212 212 RASP_Amb = 0x10000,
213 213 RASP_PppNbf = 0x803F,
214 214 RASP_PppIpx = 0x802B,
215 215 RASP_PppIp = 0x8021,
216 -// static if (WINVER >= 0x0500) {
216 +// static if (_WIN32_WINNT >= 0x500) {
217 217 RASP_PppCcp = 0x80FD,
218 218 // }
219 219 RASP_PppLcp = 0xC021,
220 220 RASP_Slip = 0x20000
221 221 }
222 222 alias RASPROJECTION* LPRASPROJECTION;
223 223
224 -alias HANDLE HRASCONN;
224 +alias TypeDef!(HANDLE) HRASCONN;
225 225 alias HRASCONN* LPHRASCONN;
226 226
227 227 struct RASCONNW {
228 228 DWORD dwSize;
229 229 HRASCONN hrasconn;
230 - WCHAR szEntryName[RAS_MaxEntryName + 1];
231 - static if (WINVER >= 0x0400) {
232 - WCHAR szDeviceType[RAS_MaxDeviceType + 1];
233 - WCHAR szDeviceName[RAS_MaxDeviceName + 1];
234 - }
235 - static if (WINVER >= 0x0401) {
236 - WCHAR szPhonebook[MAX_PATH];
230 + WCHAR[RAS_MaxEntryName + 1] szEntryName;
231 + WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
232 + WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
233 + static if (_WIN32_WINNT >= 0x401) {
234 + WCHAR[MAX_PATH] szPhonebook;
237 235 DWORD dwSubEntry;
238 236 }
239 - static if (WINVER >= 0x0500) {
237 + static if (_WIN32_WINNT >= 0x500) {
240 238 GUID guidEntry;
241 239 }
242 - static if (WINVER >= 0x0501) {
240 + static if (_WIN32_WINNT >= 0x501) {
243 241 DWORD dwFlags;
244 242 LUID luid;
245 243 }
246 244 }
247 245 alias RASCONNW* LPRASCONNW;
248 246
249 247 struct RASCONNA {
250 248 DWORD dwSize;
251 249 HRASCONN hrasconn;
252 - CHAR szEntryName[RAS_MaxEntryName + 1];
253 - static if (WINVER >= 0x0400) {
254 - CHAR szDeviceType[RAS_MaxDeviceType + 1];
255 - CHAR szDeviceName[RAS_MaxDeviceName + 1];
256 - }
257 - static if (WINVER >= 0x0401) {
258 - CHAR szPhonebook[MAX_PATH];
250 + CHAR[RAS_MaxEntryName + 1] szEntryName;
251 + CHAR[RAS_MaxDeviceType + 1] szDeviceType;
252 + CHAR[RAS_MaxDeviceName + 1] szDeviceName;
253 + static if (_WIN32_WINNT >= 0x401) {
254 + CHAR[MAX_PATH] szPhonebook;
259 255 DWORD dwSubEntry;
260 256 }
261 - static if (WINVER >= 0x0500) {
257 + static if (_WIN32_WINNT >= 0x500) {
262 258 GUID guidEntry;
263 259 }
264 - static if (WINVER >= 0x0501) {
260 + static if (_WIN32_WINNT >= 0x501) {
265 261 DWORD dwFlags;
266 262 LUID luid;
267 263 }
268 264 }
269 265 alias RASCONNA* LPRASCONNA;
270 266
271 267 struct RASCONNSTATUSW {
272 268 DWORD dwSize;
273 269 RASCONNSTATE rasconnstate;
274 270 DWORD dwError;
275 - WCHAR szDeviceType[RAS_MaxDeviceType + 1];
276 - WCHAR szDeviceName[RAS_MaxDeviceName + 1];
277 - static if (WINVER >= 0x0401) {
278 - WCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
271 + WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
272 + WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
273 + static if (_WIN32_WINNT >= 0x401) {
274 + WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
279 275 }
280 276 }
281 277 alias RASCONNSTATUSW* LPRASCONNSTATUSW;
282 278
283 279 struct RASCONNSTATUSA {
284 280 DWORD dwSize;
285 281 RASCONNSTATE rasconnstate;
286 282 DWORD dwError;
287 - CHAR szDeviceType[RAS_MaxDeviceType + 1];
288 - CHAR szDeviceName[RAS_MaxDeviceName + 1];
289 - static if (WINVER >= 0x0401) {
290 - CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
283 + CHAR[RAS_MaxDeviceType + 1] szDeviceType;
284 + CHAR[RAS_MaxDeviceName + 1] szDeviceName;
285 + static if (_WIN32_WINNT >= 0x401) {
286 + CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
291 287 }
292 288 }
293 289 alias RASCONNSTATUSA* LPRASCONNSTATUSA;
294 290
295 291 struct RASDIALPARAMSW {
296 292 DWORD dwSize;
297 - WCHAR szEntryName[RAS_MaxEntryName + 1];
298 - WCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
299 - WCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
300 - WCHAR szUserName[UNLEN + 1];
301 - WCHAR szPassword[PWLEN + 1];
302 - WCHAR szDomain[DNLEN + 1];
303 - static if (WINVER >= 0x0401) {
293 + WCHAR[RAS_MaxEntryName + 1] szEntryName;
294 + WCHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
295 + WCHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber;
296 + WCHAR[UNLEN + 1] szUserName;
297 + WCHAR[PWLEN + 1] szPassword;
298 + WCHAR[DNLEN + 1] szDomain;
299 + static if (_WIN32_WINNT >= 0x401) {
304 300 DWORD dwSubEntry;
305 301 ULONG_PTR dwCallbackId;
306 302 }
307 303 }
308 304 alias RASDIALPARAMSW* LPRASDIALPARAMSW;
309 305
310 306 struct RASDIALPARAMSA{
311 307 DWORD dwSize;
312 - CHAR szEntryName[RAS_MaxEntryName + 1];
313 - CHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
314 - CHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
315 - CHAR szUserName[UNLEN + 1];
316 - CHAR szPassword[PWLEN + 1];
317 - CHAR szDomain[DNLEN + 1];
318 - static if (WINVER >= 0x0401) {
308 + CHAR[RAS_MaxEntryName + 1] szEntryName;
309 + CHAR[RAS_MaxPhoneNumber + 1] szPhoneNumber;
310 + CHAR[RAS_MaxCallbackNumber + 1] szCallbackNumber;
311 + CHAR[UNLEN + 1] szUserName;
312 + CHAR[PWLEN + 1] szPassword;
313 + CHAR[DNLEN + 1] szDomain;
314 + static if (_WIN32_WINNT >= 0x401) {
319 315 DWORD dwSubEntry;
320 316 ULONG_PTR dwCallbackId;
321 317 }
322 318 }
323 319 alias RASDIALPARAMSA* LPRASDIALPARAMSA;
324 320
325 -static if (WINVER >= 0x0500) {
321 +static if (_WIN32_WINNT >= 0x500) {
326 322 struct RASEAPINFO {
327 323 DWORD dwSizeofEapInfo;
328 324 BYTE *pbEapInfo;
329 325 }
330 326 }
331 327
332 328 struct RASDIALEXTENSIONS {
333 329 DWORD dwSize;
334 330 DWORD dwfOptions;
335 331 HWND hwndParent;
336 332 ULONG_PTR reserved;
337 - static if (WINVER >= 0x0500) {
333 + static if (_WIN32_WINNT >= 0x500) {
338 334 ULONG_PTR reserved1;
339 335 RASEAPINFO RasEapInfo;
340 336 }
341 337 }
342 338 alias RASDIALEXTENSIONS* LPRASDIALEXTENSIONS;
343 339
344 340 struct RASENTRYNAMEW {
345 341 DWORD dwSize;
346 - WCHAR szEntryName[RAS_MaxEntryName + 1];
347 - static if (WINVER >= 0x0500) {
342 + WCHAR[RAS_MaxEntryName + 1] szEntryName;
343 + static if (_WIN32_WINNT >= 0x500) {
348 344 DWORD dwFlags;
349 - WCHAR szPhonebookPath[MAX_PATH + 1];
345 + WCHAR[MAX_PATH + 1] szPhonebookPath;
350 346 }
351 347 }
352 348 alias RASENTRYNAMEW* LPRASENTRYNAMEW;
353 349
354 350 struct RASENTRYNAMEA{
355 351 DWORD dwSize;
356 - CHAR szEntryName[RAS_MaxEntryName + 1];
357 - static if (WINVER >= 0x0500) {
352 + CHAR[RAS_MaxEntryName + 1] szEntryName;
353 + static if (_WIN32_WINNT >= 0x500) {
358 354 DWORD dwFlags;
359 - CHAR szPhonebookPath[MAX_PATH + 1];
355 + CHAR[MAX_PATH + 1] szPhonebookPath;
360 356 }
361 357 }
362 358 alias RASENTRYNAMEA* LPRASENTRYNAMEA;
363 359
364 360 struct RASAMBW{
365 361 DWORD dwSize;
366 362 DWORD dwError;
367 - WCHAR szNetBiosError[NETBIOS_NAME_LEN + 1];
363 + WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
368 364 BYTE bLana;
369 365 }
370 366 alias RASAMBW* LPRASAMBW;
371 367
372 368 struct RASAMBA{
373 369 DWORD dwSize;
374 370 DWORD dwError;
375 - CHAR szNetBiosError[NETBIOS_NAME_LEN + 1];
371 + CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
376 372 BYTE bLana;
377 373 }
378 374 alias RASAMBA* LPRASAMBA;
379 375
380 376 struct RASPPPNBFW{
381 377 DWORD dwSize;
382 378 DWORD dwError;
383 379 DWORD dwNetBiosError;
384 - WCHAR szNetBiosError[NETBIOS_NAME_LEN + 1];
385 - WCHAR szWorkstationName[NETBIOS_NAME_LEN + 1];
380 + WCHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
381 + WCHAR[NETBIOS_NAME_LEN + 1] szWorkstationName;
386 382 BYTE bLana;
387 383 }
388 384 alias RASPPPNBFW* LPRASPPPNBFW;
389 385
390 386 struct RASPPPNBFA{
391 387 DWORD dwSize;
392 388 DWORD dwError;
393 389 DWORD dwNetBiosError;
394 - CHAR szNetBiosError[NETBIOS_NAME_LEN + 1];
395 - CHAR szWorkstationName[NETBIOS_NAME_LEN + 1];
390 + CHAR[NETBIOS_NAME_LEN + 1] szNetBiosError;
391 + CHAR[NETBIOS_NAME_LEN + 1] szWorkstationName;
396 392 BYTE bLana;
397 393 }
398 394 alias RASPPPNBFA* LPRASPPPNBFA;
399 395
400 396 struct RASPPPIPXW {
401 397 DWORD dwSize;
402 398 DWORD dwError;
403 - WCHAR szIpxAddress[RAS_MaxIpxAddress + 1];
399 + WCHAR[RAS_MaxIpxAddress + 1] szIpxAddress;
404 400 }
405 401 alias RASPPPIPXW* LPRASPPPIPXW;
406 402
407 403 struct RASPPPIPXA {
408 404 DWORD dwSize;
409 405 DWORD dwError;
410 - CHAR szIpxAddress[RAS_MaxIpxAddress + 1];
406 + CHAR[RAS_MaxIpxAddress + 1] szIpxAddress;
411 407 }
412 408 alias RASPPPIPXA* LPRASPPPIPXA;
413 409
414 410 struct RASPPPIPW{
415 411 DWORD dwSize;
416 412 DWORD dwError;
417 - WCHAR szIpAddress[RAS_MaxIpAddress + 1];
413 + WCHAR[RAS_MaxIpAddress + 1] szIpAddress;
418 414 //#ifndef WINNT35COMPATIBLE
419 - WCHAR szServerIpAddress[RAS_MaxIpAddress + 1];
415 + WCHAR[RAS_MaxIpAddress + 1] szServerIpAddress;
420 416 //#endif
421 - static if (WINVER >= 0x0500) {
417 + static if (_WIN32_WINNT >= 0x500) {
422 418 DWORD dwOptions;
423 419 DWORD dwServerOptions;
424 420 }
425 421 }
426 422 alias RASPPPIPW* LPRASPPPIPW;
427 423
428 424 struct RASPPPIPA{
429 425 DWORD dwSize;
430 426 DWORD dwError;
431 - CHAR szIpAddress[RAS_MaxIpAddress + 1];
427 + CHAR[RAS_MaxIpAddress + 1] szIpAddress;
432 428 //#ifndef WINNT35COMPATIBLE
433 - CHAR szServerIpAddress[RAS_MaxIpAddress + 1];
429 + CHAR[RAS_MaxIpAddress + 1] szServerIpAddress;
434 430 //#endif
435 - static if (WINVER >= 0x0500) {
431 + static if (_WIN32_WINNT >= 0x500) {
436 432 DWORD dwOptions;
437 433 DWORD dwServerOptions;
438 434 }
439 435 }
440 436 alias RASPPPIPA* LPRASPPPIPA;
441 437
442 438 struct RASPPPLCPW{
443 439 DWORD dwSize;
444 440 BOOL fBundled;
445 - static if (WINVER >= 0x0500) {
441 + static if (_WIN32_WINNT >= 0x500) {
446 442 DWORD dwError;
447 443 DWORD dwAuthenticationProtocol;
448 444 DWORD dwAuthenticationData;
449 445 DWORD dwEapTypeId;
450 446 DWORD dwServerAuthenticationProtocol;
451 447 DWORD dwServerAuthenticationData;
452 448 DWORD dwServerEapTypeId;
453 449 BOOL fMultilink;
454 450 DWORD dwTerminateReason;
455 451 DWORD dwServerTerminateReason;
456 - WCHAR szReplyMessage[RAS_MaxReplyMessage];
452 + WCHAR[RAS_MaxReplyMessage] szReplyMessage;
457 453 DWORD dwOptions;
458 454 DWORD dwServerOptions;
459 455 }
460 456 }
461 457 alias RASPPPLCPW* LPRASPPPLCPW;
462 458
463 459 struct RASPPPLCPA{
464 460 DWORD dwSize;
465 461 BOOL fBundled;
466 - static if (WINVER >= 0x0500) {
462 + static if (_WIN32_WINNT >= 0x500) {
467 463 DWORD dwError;
468 464 DWORD dwAuthenticationProtocol;
469 465 DWORD dwAuthenticationData;
470 466 DWORD dwEapTypeId;
471 467 DWORD dwServerAuthenticationProtocol;
472 468 DWORD dwServerAuthenticationData;
473 469 DWORD dwServerEapTypeId;
474 470 BOOL fMultilink;
475 471 DWORD dwTerminateReason;
476 472 DWORD dwServerTerminateReason;
477 - CHAR szReplyMessage[RAS_MaxReplyMessage];
473 + CHAR[RAS_MaxReplyMessage] szReplyMessage;
478 474 DWORD dwOptions;
479 475 DWORD dwServerOptions;
480 476 }
481 477 }
482 478 alias RASPPPLCPA* LPRASPPPLCPA;
483 479
484 480 struct RASSLIPW{
485 481 DWORD dwSize;
486 482 DWORD dwError;
487 - WCHAR szIpAddress[RAS_MaxIpAddress + 1];
483 + WCHAR[RAS_MaxIpAddress + 1] szIpAddress;
488 484 }
489 485 alias RASSLIPW* LPRASSLIPW;
490 486
491 487 struct RASSLIPA{
492 488 DWORD dwSize;
493 489 DWORD dwError;
494 - CHAR szIpAddress[RAS_MaxIpAddress + 1];
490 + CHAR[RAS_MaxIpAddress + 1] szIpAddress;
495 491 }
496 492 alias RASSLIPA* LPRASSLIPA;
497 493
498 494 struct RASDEVINFOW{
499 495 DWORD dwSize;
500 - WCHAR szDeviceType[RAS_MaxDeviceType + 1];
501 - WCHAR szDeviceName[RAS_MaxDeviceName + 1];
496 + WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
497 + WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
502 498 }
503 499 alias RASDEVINFOW* LPRASDEVINFOW;
504 500
505 501 struct RASDEVINFOA{
506 502 DWORD dwSize;
507 - CHAR szDeviceType[RAS_MaxDeviceType + 1];
508 - CHAR szDeviceName[RAS_MaxDeviceName + 1];
503 + CHAR[RAS_MaxDeviceType + 1] szDeviceType;
504 + CHAR[RAS_MaxDeviceName + 1] szDeviceName;
509 505 }
510 506 alias RASDEVINFOA* LPRASDEVINFOA;
511 507
512 508 struct RASCTRYINFO {
513 509 DWORD dwSize;
514 510 DWORD dwCountryID;
515 511 DWORD dwNextCountryID;
................................................................................
529 525 }
530 526
531 527 struct RASENTRYW {
532 528 DWORD dwSize;
533 529 DWORD dwfOptions;
534 530 DWORD dwCountryID;
535 531 DWORD dwCountryCode;
536 - WCHAR szAreaCode[RAS_MaxAreaCode + 1];
537 - WCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1];
532 + WCHAR[RAS_MaxAreaCode + 1] szAreaCode;
533 + WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
538 534 DWORD dwAlternateOffset;
539 535 RASIPADDR ipaddr;
540 536 RASIPADDR ipaddrDns;
541 537 RASIPADDR ipaddrDnsAlt;
542 538 RASIPADDR ipaddrWins;
543 539 RASIPADDR ipaddrWinsAlt;
544 540 DWORD dwFrameSize;
545 541 DWORD dwfNetProtocols;
546 542 DWORD dwFramingProtocol;
547 - WCHAR szScript[MAX_PATH];
548 - WCHAR szAutodialDll[MAX_PATH];
549 - WCHAR szAutodialFunc[MAX_PATH];
550 - WCHAR szDeviceType[RAS_MaxDeviceType + 1];
551 - WCHAR szDeviceName[RAS_MaxDeviceName + 1];
552 - WCHAR szX25PadType[RAS_MaxPadType + 1];
553 - WCHAR szX25Address[RAS_MaxX25Address + 1];
554 - WCHAR szX25Facilities[RAS_MaxFacilities + 1];
555 - WCHAR szX25UserData[RAS_MaxUserData + 1];
543 + WCHAR[MAX_PATH] szScript;
544 + WCHAR[MAX_PATH] szAutodialDll;
545 + WCHAR[MAX_PATH] szAutodialFunc;
546 + WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
547 + WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
548 + WCHAR[RAS_MaxPadType + 1] szX25PadType;
549 + WCHAR[RAS_MaxX25Address + 1] szX25Address;
550 + WCHAR[RAS_MaxFacilities + 1] szX25Facilities;
551 + WCHAR[RAS_MaxUserData + 1] szX25UserData;
556 552 DWORD dwChannels;
557 553 DWORD dwReserved1;
558 554 DWORD dwReserved2;
559 - static if (WINVER >= 0x0401) {
555 + static if (_WIN32_WINNT >= 0x401) {
560 556 DWORD dwSubEntries;
561 557 DWORD dwDialMode;
562 558 DWORD dwDialExtraPercent;
563 559 DWORD dwDialExtraSampleSeconds;
564 560 DWORD dwHangUpExtraPercent;
565 561 DWORD dwHangUpExtraSampleSeconds;
566 562 DWORD dwIdleDisconnectSeconds;
567 563 }
568 - static if (WINVER >= 0x0500) {
564 + static if (_WIN32_WINNT >= 0x500) {
569 565 DWORD dwType;
570 566 DWORD dwEncryptionType;
571 567 DWORD dwCustomAuthKey;
572 568 GUID guidId;
573 - WCHAR szCustomDialDll[MAX_PATH];
569 + WCHAR[MAX_PATH] szCustomDialDll;
574 570 DWORD dwVpnStrategy;
575 571 }
576 572 }
577 573 alias RASENTRYW* LPRASENTRYW;
578 574
579 575 struct RASENTRYA {
580 576 DWORD dwSize;
581 577 DWORD dwfOptions;
582 578 DWORD dwCountryID;
583 579 DWORD dwCountryCode;
584 - CHAR szAreaCode[RAS_MaxAreaCode + 1];
585 - CHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1];
580 + CHAR[RAS_MaxAreaCode + 1] szAreaCode;
581 + CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
586 582 DWORD dwAlternateOffset;
587 583 RASIPADDR ipaddr;
588 584 RASIPADDR ipaddrDns;
589 585 RASIPADDR ipaddrDnsAlt;
590 586 RASIPADDR ipaddrWins;
591 587 RASIPADDR ipaddrWinsAlt;
592 588 DWORD dwFrameSize;
593 589 DWORD dwfNetProtocols;
594 590 DWORD dwFramingProtocol;
595 - CHAR szScript[MAX_PATH];
596 - CHAR szAutodialDll[MAX_PATH];
597 - CHAR szAutodialFunc[MAX_PATH];
598 - CHAR szDeviceType[RAS_MaxDeviceType + 1];
599 - CHAR szDeviceName[RAS_MaxDeviceName + 1];
600 - CHAR szX25PadType[RAS_MaxPadType + 1];
601 - CHAR szX25Address[RAS_MaxX25Address + 1];
602 - CHAR szX25Facilities[RAS_MaxFacilities + 1];
603 - CHAR szX25UserData[RAS_MaxUserData + 1];
591 + CHAR[MAX_PATH] szScript;
592 + CHAR[MAX_PATH] szAutodialDll;
593 + CHAR[MAX_PATH] szAutodialFunc;
594 + CHAR[RAS_MaxDeviceType + 1] szDeviceType;
595 + CHAR[RAS_MaxDeviceName + 1] szDeviceName;
596 + CHAR[RAS_MaxPadType + 1] szX25PadType;
597 + CHAR[RAS_MaxX25Address + 1] szX25Address;
598 + CHAR[RAS_MaxFacilities + 1] szX25Facilities;
599 + CHAR[RAS_MaxUserData + 1] szX25UserData;
604 600 DWORD dwChannels;
605 601 DWORD dwReserved1;
606 602 DWORD dwReserved2;
607 - static if (WINVER >= 0x0401) {
603 + static if (_WIN32_WINNT >= 0x401) {
608 604 DWORD dwSubEntries;
609 605 DWORD dwDialMode;
610 606 DWORD dwDialExtraPercent;
611 607 DWORD dwDialExtraSampleSeconds;
612 608 DWORD dwHangUpExtraPercent;
613 609 DWORD dwHangUpExtraSampleSeconds;
614 610 DWORD dwIdleDisconnectSeconds;
615 611 }
616 - static if (WINVER >= 0x0500) {
612 + static if (_WIN32_WINNT >= 0x500) {
617 613 DWORD dwType;
618 614 DWORD dwEncryptionType;
619 615 DWORD dwCustomAuthKey;
620 616 GUID guidId;
621 - CHAR szCustomDialDll[MAX_PATH];
617 + CHAR[MAX_PATH] szCustomDialDll;
622 618 DWORD dwVpnStrategy;
623 619 }
624 620 }
625 621 alias RASENTRYA* LPRASENTRYA;
626 622
627 623
628 -static if (WINVER >= 0x0401) {
624 +static if (_WIN32_WINNT >= 0x401) {
629 625 struct RASADPARAMS {
630 626 DWORD dwSize;
631 627 HWND hwndOwner;
632 628 DWORD dwFlags;
633 629 LONG xDlg;
634 630 LONG yDlg;
635 631 }
636 632 alias RASADPARAMS* LPRASADPARAMS;
637 633
638 634 struct RASSUBENTRYW{
639 635 DWORD dwSize;
640 636 DWORD dwfFlags;
641 - WCHAR szDeviceType[RAS_MaxDeviceType + 1];
642 - WCHAR szDeviceName[RAS_MaxDeviceName + 1];
643 - WCHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1];
637 + WCHAR[RAS_MaxDeviceType + 1] szDeviceType;
638 + WCHAR[RAS_MaxDeviceName + 1] szDeviceName;
639 + WCHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
644 640 DWORD dwAlternateOffset;
645 641 }
646 642 alias RASSUBENTRYW* LPRASSUBENTRYW;
647 643
648 644 struct RASSUBENTRYA{
649 645 DWORD dwSize;
650 646 DWORD dwfFlags;
651 - CHAR szDeviceType[RAS_MaxDeviceType + 1];
652 - CHAR szDeviceName[RAS_MaxDeviceName + 1];
653 - CHAR szLocalPhoneNumber[RAS_MaxPhoneNumber + 1];
647 + CHAR[RAS_MaxDeviceType + 1] szDeviceType;
648 + CHAR[RAS_MaxDeviceName + 1] szDeviceName;
649 + CHAR[RAS_MaxPhoneNumber + 1] szLocalPhoneNumber;
654 650 DWORD dwAlternateOffset;
655 651 }
656 652 alias RASSUBENTRYA* LPRASSUBENTRYA;
657 653
658 654 struct RASCREDENTIALSW{
659 655 DWORD dwSize;
660 656 DWORD dwMask;
661 - WCHAR szUserName[UNLEN + 1];
662 - WCHAR szPassword[PWLEN + 1];
663 - WCHAR szDomain[DNLEN + 1];
657 + WCHAR[UNLEN + 1] szUserName;
658 + WCHAR[PWLEN + 1] szPassword;
659 + WCHAR[DNLEN + 1] szDomain;
664 660 }
665 661 alias RASCREDENTIALSW* LPRASCREDENTIALSW;
666 662
667 663 struct RASCREDENTIALSA{
668 664 DWORD dwSize;
669 665 DWORD dwMask;
670 - CHAR szUserName[UNLEN + 1];
671 - CHAR szPassword[PWLEN + 1];
672 - CHAR szDomain[DNLEN + 1];
666 + CHAR[UNLEN + 1] szUserName;
667 + CHAR[PWLEN + 1] szPassword;
668 + CHAR[DNLEN + 1] szDomain;
673 669 }
674 670 alias RASCREDENTIALSA* LPRASCREDENTIALSA;
675 671
676 672 struct RASAUTODIALENTRYW{
677 673 DWORD dwSize;
678 674 DWORD dwFlags;
679 675 DWORD dwDialingLocation;
680 - WCHAR szEntry[RAS_MaxEntryName + 1];
676 + WCHAR[RAS_MaxEntryName + 1] szEntry;
681 677 }
682 678 alias RASAUTODIALENTRYW* LPRASAUTODIALENTRYW;
683 679
684 680 struct RASAUTODIALENTRYA{
685 681 DWORD dwSize;
686 682 DWORD dwFlags;
687 683 DWORD dwDialingLocation;
688 - CHAR szEntry[RAS_MaxEntryName + 1];
684 + CHAR[RAS_MaxEntryName + 1] szEntry;
689 685 }
690 686 alias RASAUTODIALENTRYA* LPRASAUTODIALENTRYA;
691 687 }
692 688
693 -static if (WINVER >= 0x0500) {
689 +static if (_WIN32_WINNT >= 0x500) {
694 690 struct RASPPPCCP{
695 691 DWORD dwSize;
696 692 DWORD dwError;
697 693 DWORD dwCompressionAlgorithm;
698 694 DWORD dwOptions;
699 695 DWORD dwServerCompressionAlgorithm;
700 696 DWORD dwServerOptions;
701 697 }
702 698 alias RASPPPCCP* LPRASPPPCCP;
703 699
704 700 struct RASEAPUSERIDENTITYW{
705 - WCHAR szUserName[UNLEN + 1];
701 + WCHAR[UNLEN + 1] szUserName;
706 702 DWORD dwSizeofEapInfo;
707 - BYTE pbEapInfo[1];
703 + BYTE[1] pbEapInfo;
708 704 }
709 705 alias RASEAPUSERIDENTITYW* LPRASEAPUSERIDENTITYW;
710 706
711 707 struct RASEAPUSERIDENTITYA{
712 - CHAR szUserName[UNLEN + 1];
708 + CHAR[UNLEN + 1] szUserName;
713 709 DWORD dwSizeofEapInfo;
714 - BYTE pbEapInfo[1];
710 + BYTE[1] pbEapInfo;
715 711 }
716 712 alias RASEAPUSERIDENTITYA* LPRASEAPUSERIDENTITYA;
717 713
718 714 struct RAS_STATS{
719 715 DWORD dwSize;
720 716 DWORD dwBytesXmited;
721 717 DWORD dwBytesRcved;
................................................................................
747 743 alias RASPPPIPXW RASPPPIPX;
748 744 alias RASPPPIPW RASPPPIP;
749 745 alias RASPPPLCPW RASPPPLCP;
750 746 alias RASSLIPW RASSLIP;
751 747 alias RASDEVINFOW RASDEVINFO;
752 748 alias RASENTRYNAMEW RASENTRYNAME;
753 749
754 - static if (WINVER >= 0x0401) {
750 + static if (_WIN32_WINNT >= 0x401) {
755 751 alias RASSUBENTRYW RASSUBENTRY;
756 752 alias RASCREDENTIALSW RASCREDENTIALS;
757 753 alias RASAUTODIALENTRYW RASAUTODIALENTRY;
758 754 }
759 755
760 - static if (WINVER >= 0x0500) {
756 + static if (_WIN32_WINNT >= 0x500) {
761 757 alias RASEAPUSERIDENTITYW RASEAPUSERIDENTITY;
762 758 }
763 759
764 760 } else { // ! defined UNICODE
765 761
766 762 alias RASCONNA RASCONN;
767 763 alias RASENTRYA RASENTRY;
................................................................................
772 768 alias RASPPPIPXA RASPPPIPX;
773 769 alias RASPPPIPA RASPPPIP;
774 770 alias RASPPPLCPA RASPPPLCP;
775 771 alias RASSLIPA RASSLIP;
776 772 alias RASDEVINFOA RASDEVINFO;
777 773 alias RASENTRYNAMEA RASENTRYNAME;
778 774
779 - static if (WINVER >= 0x0401) {
775 + static if (_WIN32_WINNT >= 0x401) {
780 776 alias RASSUBENTRYA RASSUBENTRY;
781 777 alias RASCREDENTIALSA RASCREDENTIALS;
782 778 alias RASAUTODIALENTRYA RASAUTODIALENTRY;
783 779 }
784 - static if (WINVER >= 0x0500) {
780 + static if (_WIN32_WINNT >= 0x500) {
785 781 alias RASEAPUSERIDENTITYA RASEAPUSERIDENTITY;
786 782 }
787 783 }// ! UNICODE
788 784
789 785
790 786 alias RASCONN* LPRASCONN;
791 787 alias RASENTRY* LPRASENTRY;
................................................................................
796 792 alias RASPPPIPX* LPRASPPPIPX;
797 793 alias RASPPPIP* LPRASPPPIP;
798 794 alias RASPPPLCP* LPRASPPPLCP;
799 795 alias RASSLIP* LPRASSLIP;
800 796 alias RASDEVINFO* LPRASDEVINFO;
801 797 alias RASENTRYNAME* LPRASENTRYNAME;
802 798
803 -static if (WINVER >= 0x0401) {
799 +static if (_WIN32_WINNT >= 0x401) {
804 800 alias RASSUBENTRY* LPRASSUBENTRY;
805 801 alias RASCREDENTIALS* LPRASCREDENTIALS;
806 802 alias RASAUTODIALENTRY* LPRASAUTODIALENTRY;
807 803 }
808 -static if (WINVER >= 0x0500) {
804 +static if (_WIN32_WINNT >= 0x500) {
809 805 alias RASEAPUSERIDENTITY* LPRASEAPUSERIDENTITY;
810 806 }
811 807
812 808 /* Callback prototypes */
813 809 deprecated {
814 810 alias BOOL function (HWND, LPSTR, DWORD, LPDWORD) ORASADFUNC;
815 811 }
................................................................................
864 860 DWORD RasRenameEntryA (LPCSTR, LPCSTR, LPCSTR);
865 861 DWORD RasRenameEntryW (LPCWSTR, LPCWSTR, LPCWSTR);
866 862 DWORD RasDeleteEntryA (LPCSTR, LPCSTR);
867 863 DWORD RasDeleteEntryW (LPCWSTR, LPCWSTR);
868 864 DWORD RasValidateEntryNameA (LPCSTR, LPCSTR);
869 865 DWORD RasValidateEntryNameW (LPCWSTR, LPCWSTR);
870 866
871 -static if (WINVER >= 0x0401) {
867 +static if (_WIN32_WINNT >= 0x401) {
872 868 alias BOOL function (LPSTR, LPSTR, LPRASADPARAMS, LPDWORD) RASADFUNCA;
873 869 alias BOOL function (LPWSTR, LPWSTR, LPRASADPARAMS, LPDWORD) RASADFUNCW;
874 870
875 871 DWORD RasGetSubEntryHandleA (HRASCONN, DWORD, LPHRASCONN);
876 872 DWORD RasGetSubEntryHandleW (HRASCONN, DWORD, LPHRASCONN);
877 873 DWORD RasGetCredentialsA (LPCSTR, LPCSTR, LPRASCREDENTIALSA);
878 874 DWORD RasGetCredentialsW (LPCWSTR, LPCWSTR, LPRASCREDENTIALSW);
................................................................................
904 900 DWORD RasSetAutodialEnableW (DWORD, BOOL);
905 901 DWORD RasGetAutodialParamA (DWORD, LPVOID, LPDWORD);
906 902 DWORD RasGetAutodialParamW (DWORD, LPVOID, LPDWORD);
907 903 DWORD RasSetAutodialParamA (DWORD, LPVOID, DWORD);
908 904 DWORD RasSetAutodialParamW (DWORD, LPVOID, DWORD);
909 905 }
910 906
911 -static if (WINVER >= 0x0500) {
907 +static if (_WIN32_WINNT >= 0x500) {
912 908 alias DWORD function (HRASCONN) RasCustomHangUpFn;
913 909 alias DWORD function (LPCTSTR, LPCTSTR, DWORD) RasCustomDeleteEntryNotifyFn;
914 910 alias DWORD function (HINSTANCE, LPRASDIALEXTENSIONS,
915 911 LPCTSTR, LPRASDIALPARAMS, DWORD, LPVOID, LPHRASCONN, DWORD) RasCustomDialFn;
916 912
917 913 DWORD RasInvokeEapUI (HRASCONN, DWORD, LPRASDIALEXTENSIONS, HWND);
918 914 DWORD RasGetLinkStatistics (HRASCONN, DWORD, RAS_STATS*);
................................................................................
951 947 alias RasGetCountryInfoW RasGetCountryInfo;
952 948 alias RasGetEntryPropertiesW RasGetEntryProperties;
953 949 alias RasSetEntryPropertiesW RasSetEntryProperties;
954 950 alias RasRenameEntryW RasRenameEntry;
955 951 alias RasDeleteEntryW RasDeleteEntry;
956 952 alias RasValidateEntryNameW RasValidateEntryName;
957 953
958 - static if (WINVER >= 0x0401) {
954 + static if (_WIN32_WINNT >= 0x401) {
959 955 alias RASADFUNCW RASADFUNC;
960 956 alias RasGetSubEntryHandleW RasGetSubEntryHandle;
961 957 alias RasConnectionNotificationW RasConnectionNotification;
962 958 alias RasGetSubEntryPropertiesW RasGetSubEntryProperties;
963 959 alias RasSetSubEntryPropertiesW RasSetSubEntryProperties;
964 960 alias RasGetCredentialsW RasGetCredentials;
965 961 alias RasSetCredentialsW RasSetCredentials;
................................................................................
968 964 alias RasEnumAutodialAddressesW RasEnumAutodialAddresses;
969 965 alias RasGetAutodialEnableW RasGetAutodialEnable;
970 966 alias RasSetAutodialEnableW RasSetAutodialEnable;
971 967 alias RasGetAutodialParamW RasGetAutodialParam;
972 968 alias RasSetAutodialParamW RasSetAutodialParam;
973 969 }
974 970
975 - static if (WINVER >= 0x0500) {
971 + static if (_WIN32_WINNT >= 0x500) {
976 972 alias RasGetEapUserDataW RasGetEapUserData;
977 973 alias RasSetEapUserDataW RasSetEapUserData;
978 974 alias RasGetCustomAuthDataW RasGetCustomAuthData;
979 975 alias RasSetCustomAuthDataW RasSetCustomAuthData;
980 976 alias RasGetEapUserIdentityW RasGetEapUserIdentity;
981 977 alias RasFreeEapUserIdentityW RasFreeEapUserIdentity;
982 978 }
983 979
984 -} else { // ! defined UNICODE
980 +} else { // !Unicode
985 981 alias RasDialA RasDial;
986 982 alias RasEnumConnectionsA RasEnumConnections;
987 983 alias RasEnumEntriesA RasEnumEntries;
988 984 alias RasGetConnectStatusA RasGetConnectStatus;
989 985 alias RasGetErrorStringA RasGetErrorString;
990 986 alias RasHangUpA RasHangUp;
991 987 alias RasGetProjectionInfoA RasGetProjectionInfo;
................................................................................
997 993 alias RasGetCountryInfoA RasGetCountryInfo;
998 994 alias RasGetEntryPropertiesA RasGetEntryProperties;
999 995 alias RasSetEntryPropertiesA RasSetEntryProperties;
1000 996 alias RasRenameEntryA RasRenameEntry;
1001 997 alias RasDeleteEntryA RasDeleteEntry;
1002 998 alias RasValidateEntryNameA RasValidateEntryName;
1003 999
1004 - static if (WINVER >= 0x0401) {
1000 + static if (_WIN32_WINNT >= 0x401) {
1005 1001 alias RASADFUNCA RASADFUNC;
1006 1002 alias RasGetSubEntryHandleA RasGetSubEntryHandle;
1007 1003 alias RasConnectionNotificationA RasConnectionNotification;
1008 1004 alias RasGetSubEntryPropertiesA RasGetSubEntryProperties;
1009 1005 alias RasSetSubEntryPropertiesA RasSetSubEntryProperties;
1010 1006 alias RasGetCredentialsA RasGetCredentials;
1011 1007 alias RasSetCredentialsA RasSetCredentials;
................................................................................
1014 1010 alias RasEnumAutodialAddressesA RasEnumAutodialAddresses;
1015 1011 alias RasGetAutodialEnableA RasGetAutodialEnable;
1016 1012 alias RasSetAutodialEnableA RasSetAutodialEnable;
1017 1013 alias RasGetAutodialParamA RasGetAutodialParam;
1018 1014 alias RasSetAutodialParamA RasSetAutodialParam;
1019 1015 }
1020 1016
1021 - static if (WINVER >= 0x0500) {
1017 + static if (_WIN32_WINNT >= 0x500) {
1022 1018 alias RasGetEapUserDataA RasGetEapUserData;
1023 1019 alias RasSetEapUserDataA RasSetEapUserData;
1024 1020 alias RasGetCustomAuthDataA RasGetCustomAuthData;
1025 1021 alias RasSetCustomAuthDataA RasSetCustomAuthData;
1026 1022 alias RasGetEapUserIdentityA RasGetEapUserIdentity;
1027 1023 alias RasFreeEapUserIdentityA RasFreeEapUserIdentity;
1028 1024 }
1029 -} //#endif // ! UNICODE
1025 +} //#endif // !Unicode