1 /***********************************************************************\
2 *                                rasdlg.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.rasdlg;
12 version(Windows):
13 
14 import win32.ras;
15 private import win32.lmcons, win32.windef;
16 
17 enum {
18 	RASPBDEVENT_AddEntry = 1,
19 	RASPBDEVENT_EditEntry,
20 	RASPBDEVENT_RemoveEntry,
21 	RASPBDEVENT_DialEntry,
22 	RASPBDEVENT_EditGlobals,
23 	RASPBDEVENT_NoUser,
24 	RASPBDEVENT_NoUserEdit
25 }
26 
27 const RASPBDFLAG_PositionDlg      =  1;
28 const RASPBDFLAG_ForceCloseOnDial =  2;
29 const RASPBDFLAG_NoUser           = 16;
30 
31 const RASEDFLAG_PositionDlg = 1;
32 const RASEDFLAG_NewEntry    = 2;
33 const RASEDFLAG_CloneEntry  = 4;
34 
35 const RASDDFLAG_PositionDlg = 1;
36 
37 align(4):
38 
39 struct RASENTRYDLGA {
40 	DWORD     dwSize = RASENTRYDLGA.sizeof;
41 	HWND      hwndOwner;
42 	DWORD     dwFlags;
43 	LONG      xDlg;
44 	LONG      yDlg;
45 	CHAR[RAS_MaxEntryName + 1] szEntry;
46 	DWORD     dwError;
47 	ULONG_PTR reserved;
48 	ULONG_PTR reserved2;
49 }
50 alias RASENTRYDLGA* LPRASENTRYDLGA;
51 
52 struct RASENTRYDLGW {
53 	DWORD     dwSize = RASENTRYDLGW.sizeof;
54 	HWND      hwndOwner;
55 	DWORD     dwFlags;
56 	LONG      xDlg;
57 	LONG      yDlg;
58 	WCHAR[RAS_MaxEntryName + 1] szEntry;
59 	DWORD     dwError;
60 	ULONG_PTR reserved;
61 	ULONG_PTR reserved2;
62 }
63 alias RASENTRYDLGW* LPRASENTRYDLGW;
64 
65 struct RASDIALDLG {
66 	DWORD     dwSize;
67 	HWND      hwndOwner;
68 	DWORD     dwFlags;
69 	LONG      xDlg;
70 	LONG      yDlg;
71 	DWORD     dwSubEntry;
72 	DWORD     dwError;
73 	ULONG_PTR reserved;
74 	ULONG_PTR reserved2;
75 }
76 alias RASDIALDLG* LPRASDIALDLG;
77 
78 // Application-defined callback functions
79 extern (Windows) {
80 	alias VOID function(DWORD, DWORD, LPWSTR, LPVOID) RASPBDLGFUNCW;
81 	alias VOID function(DWORD, DWORD, LPSTR, LPVOID) RASPBDLGFUNCA;
82 }
83 
84 struct RASPBDLGA {
85 	DWORD         dwSize = RASPBDLGA.sizeof;
86 	HWND          hwndOwner;
87 	DWORD         dwFlags;
88 	LONG          xDlg;
89 	LONG          yDlg;
90 	ULONG_PTR     dwCallbackId;
91 	RASPBDLGFUNCA pCallback;
92 	DWORD         dwError;
93 	ULONG_PTR     reserved;
94 	ULONG_PTR     reserved2;
95 }
96 alias RASPBDLGA* LPRASPBDLGA;
97 
98 struct RASPBDLGW {
99 	DWORD         dwSize = RASPBDLGW.sizeof;
100 	HWND          hwndOwner;
101 	DWORD         dwFlags;
102 	LONG          xDlg;
103 	LONG          yDlg;
104 	ULONG_PTR     dwCallbackId;
105 	RASPBDLGFUNCW pCallback;
106 	DWORD         dwError;
107 	ULONG_PTR     reserved;
108 	ULONG_PTR     reserved2;
109 }
110 alias RASPBDLGW* LPRASPBDLGW;
111 
112 struct RASNOUSERA
113 {
114 	DWORD           dwSize = RASNOUSERA.sizeof;
115 	DWORD           dwFlags;
116 	DWORD           dwTimeoutMs;
117 	CHAR[UNLEN + 1] szUserName;
118 	CHAR[PWLEN + 1] szPassword;
119 	CHAR[DNLEN + 1] szDomain;
120 }
121 alias RASNOUSERA* LPRASNOUSERA;
122 
123 struct RASNOUSERW {
124 	DWORD            dwSize = RASNOUSERW.sizeof;
125 	DWORD            dwFlags;
126 	DWORD            dwTimeoutMs;
127 	WCHAR[UNLEN + 1] szUserName;
128 	WCHAR[PWLEN + 1] szPassword;
129 	WCHAR[DNLEN + 1] szDomain;
130 }
131 alias RASNOUSERW* LPRASNOUSERW;
132 
133 extern (Windows) {
134 	BOOL RasDialDlgA(LPSTR, LPSTR, LPSTR, LPRASDIALDLG);
135 	BOOL RasDialDlgW(LPWSTR, LPWSTR, LPWSTR, LPRASDIALDLG);
136 	BOOL RasEntryDlgA(LPSTR, LPSTR, LPRASENTRYDLGA);
137 	BOOL RasEntryDlgW(LPWSTR, LPWSTR, LPRASENTRYDLGW);
138 	BOOL RasPhonebookDlgA(LPSTR, LPSTR, LPRASPBDLGA);
139 	BOOL RasPhonebookDlgW(LPWSTR, LPWSTR, LPRASPBDLGW);
140 }
141 
142 version (Unicode) {
143 	alias RASENTRYDLGW RASENTRYDLG;
144 	alias RASPBDLGW RASPBDLG;
145 	alias RASNOUSERW RASNOUSER;
146 	alias RasDialDlgW RasDialDlg;
147 	alias RasEntryDlgW RasEntryDlg;
148 	alias RasPhonebookDlgW RasPhonebookDlg;
149 } else {
150 	alias RASENTRYDLGA RASENTRYDLG;
151 	alias RASPBDLGA RASPBDLG;
152 	alias RASNOUSERA RASNOUSER;
153 	alias RasDialDlgA RasDialDlg;
154 	alias RasEntryDlgA RasEntryDlg;
155 	alias RasPhonebookDlgA RasPhonebookDlg;
156 }
157 
158 alias RASENTRYDLG* LPRASENTRYDLG;
159 alias RASPBDLG* LPRASPBDLG;
160 alias RASNOUSER* LPRASNOUSER;