The OpenD Programming Language

1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * Authors: Stewart Gordon
7  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
8  * Source: $(DRUNTIMESRC core/sys/windows/_nddeapi.d)
9  */
10 module core.sys.windows.nddeapi;
11 version (Windows):
12 
13 version (ANSI) {} else version = Unicode;
14 
15 import core.sys.windows.windef;
16 
17 // FIXME: check types and grouping of constants
18 
19 /+
20 #ifndef CNLEN /* also in lmcons.h */
21 #define CNLEN 15
22 #define UNCLEN (CNLEN + 2)
23 #endif
24 +/
25 
26 enum char    SEP_CHAR  = ',';
27 const char[]  BAR_CHAR  = "|";
28 enum wchar   SEP_WCHAR = ',';
29 const wchar[] BAR_WCHAR = "|";
30 
31 enum {
32     NDDE_NO_ERROR,
33     NDDE_ACCESS_DENIED,
34     NDDE_BUF_TOO_SMALL,
35     NDDE_ERROR_MORE_DATA,
36     NDDE_INVALID_SERVER,
37     NDDE_INVALID_SHARE,
38     NDDE_INVALID_PARAMETER,
39     NDDE_INVALID_LEVEL,
40     NDDE_INVALID_PASSWORD,
41     NDDE_INVALID_ITEMNAME,
42     NDDE_INVALID_TOPIC,
43     NDDE_INTERNAL_ERROR,
44     NDDE_OUT_OF_MEMORY,
45     NDDE_INVALID_APPNAME,
46     NDDE_NOT_IMPLEMENTED,
47     NDDE_SHARE_ALREADY_EXIST,
48     NDDE_SHARE_NOT_EXIST,
49     NDDE_INVALID_FILENAME,
50     NDDE_NOT_RUNNING,
51     NDDE_INVALID_WINDOW,
52     NDDE_INVALID_SESSION,
53     NDDE_INVALID_ITEM_LIST,
54     NDDE_SHARE_DATA_CORRUPTED,
55     NDDE_REGISTRY_ERROR,
56     NDDE_CANT_ACCESS_SERVER,
57     NDDE_INVALID_SPECIAL_COMMAND,
58     NDDE_INVALID_SECURITY_DESC,
59     NDDE_TRUST_SHARE_FAIL
60 }
61 
62 enum size_t
63     MAX_NDDESHARENAME = 256,
64     MAX_DOMAINNAME = 15,
65     MAX_USERNAME = 15,
66     MAX_APPNAME = 255,
67     MAX_TOPICNAME = 255,
68     MAX_ITEMNAME = 255;
69 
70 enum NDDEF_NOPASSWORDPROMPT = 1;
71 enum NDDEF_NOCACHELOOKUP    = 2;
72 enum NDDEF_STRIP_NDDE       = 4;
73 
74 enum SHARE_TYPE_OLD         = 1;
75 enum SHARE_TYPE_NEW         = 2;
76 enum SHARE_TYPE_STATIC      = 4;
77 
78 enum uint
79     NDDE_CMD_SHOW_MASK     = 0x0000FFFF,
80     NDDE_TRUST_CMD_SHOW    = 0x10000000,
81     NDDE_TRUST_SHARE_DEL   = 0x20000000,
82     NDDE_TRUST_SHARE_INIT  = 0x40000000,
83     NDDE_TRUST_SHARE_START = 0x80000000;
84 
85 struct NDdeShareInfo_tag {
86     LONG    lRevision;
87     LPTSTR  lpszShareName;
88     LONG    lShareType;
89     LPTSTR  lpszAppTopicList;
90     LONG    fSharedFlag;
91     LONG    fService;
92     LONG    fStartAppFlag;
93     LONG    nCmdShow;
94     LONG[2] qModifyId;
95     LONG    cNumItems;
96     LPTSTR  lpszItemList;
97 }
98 extern (C) {    // huh?
99     NDdeShareInfo_tag  NDDESHAREINFO;
100     NDdeShareInfo_tag* PNDDESHAREINFO;
101 }
102 
103 extern (Windows) {
104     UINT NDdeGetErrorStringA(UINT, LPSTR, DWORD);
105     UINT NDdeGetErrorStringW(UINT, LPWSTR, DWORD);
106     UINT NDdeGetShareSecurityA(LPSTR, LPSTR, SECURITY_INFORMATION,
107       PSECURITY_DESCRIPTOR, DWORD, PDWORD);
108     UINT NDdeGetShareSecurityW(LPWSTR, LPWSTR, SECURITY_INFORMATION,
109       PSECURITY_DESCRIPTOR, DWORD, PDWORD);
110     UINT NDdeGetTrustedShareA(LPSTR, LPSTR, PDWORD, PDWORD, PDWORD);
111     UINT NDdeGetTrustedShareW(LPWSTR, LPWSTR, PDWORD, PDWORD, PDWORD);
112     BOOL NDdeIsValidShareNameA(LPSTR);
113     BOOL NDdeIsValidShareNameW(LPWSTR);
114     BOOL NDdeIsValidAppTopicListA(LPSTR);
115     BOOL NDdeIsValidAppTopicListW(LPWSTR);
116     UINT NDdeSetShareSecurityA(LPSTR, LPSTR, SECURITY_INFORMATION,
117       PSECURITY_DESCRIPTOR);
118     UINT NDdeSetShareSecurityW(LPWSTR, LPWSTR, SECURITY_INFORMATION,
119       PSECURITY_DESCRIPTOR);
120     UINT NDdeSetTrustedShareA(LPSTR, LPSTR, DWORD);
121     UINT NDdeSetTrustedShareW(LPWSTR, LPWSTR, DWORD);
122     UINT NDdeShareAddA(LPSTR, UINT, PSECURITY_DESCRIPTOR, PBYTE, DWORD);
123     UINT NDdeShareAddW(LPWSTR, UINT, PSECURITY_DESCRIPTOR, PBYTE, DWORD);
124     UINT NDdeShareDelA(LPSTR, LPSTR, UINT);
125     UINT NDdeShareDelW(LPWSTR, LPWSTR, UINT);
126     UINT NDdeShareEnumA(LPSTR, UINT, PBYTE, DWORD, PDWORD, PDWORD);
127     UINT NDdeShareEnumW(LPWSTR, UINT, PBYTE, DWORD, PDWORD, PDWORD);
128     UINT NDdeShareGetInfoA(LPSTR, LPSTR, UINT, PBYTE, DWORD, PDWORD, PWORD);
129     UINT NDdeShareGetInfoW(LPWSTR, LPWSTR, UINT, PBYTE, DWORD, PDWORD, PWORD);
130     UINT NDdeShareSetInfoA(LPSTR, LPSTR, UINT, PBYTE, DWORD, WORD);
131     UINT NDdeShareSetInfoW(LPWSTR, LPWSTR, UINT, PBYTE, DWORD, WORD);
132     UINT NDdeTrustedShareEnumA(LPSTR, UINT, PBYTE, DWORD, PDWORD, PDWORD);
133     UINT NDdeTrustedShareEnumW(LPWSTR, UINT, PBYTE, DWORD, PDWORD, PDWORD);
134 }
135 
136 version (Unicode) {
137     alias NDdeShareAddW NDdeShareAdd;
138     alias NDdeShareDelW NDdeShareDel;
139     alias NDdeSetShareSecurityW NDdeSetShareSecurity;
140     alias NDdeGetShareSecurityW NDdeGetShareSecurity;
141     alias NDdeShareEnumW NDdeShareEnum;
142     alias NDdeShareGetInfoW NDdeShareGetInfo;
143     alias NDdeShareSetInfoW NDdeShareSetInfo;
144     alias NDdeGetErrorStringW NDdeGetErrorString;
145     alias NDdeIsValidShareNameW NDdeIsValidShareName;
146     alias NDdeIsValidAppTopicListW NDdeIsValidAppTopicList;
147     alias NDdeSetTrustedShareW NDdeSetTrustedShare;
148     alias NDdeGetTrustedShareW NDdeGetTrustedShare;
149     alias NDdeTrustedShareEnumW NDdeTrustedShareEnum;
150 } else {
151     alias NDdeShareAddA NDdeShareAdd;
152     alias NDdeShareDelA NDdeShareDel;
153     alias NDdeSetShareSecurityA NDdeSetShareSecurity;
154     alias NDdeGetShareSecurityA NDdeGetShareSecurity;
155     alias NDdeShareEnumA NDdeShareEnum;
156     alias NDdeShareGetInfoA NDdeShareGetInfo;
157     alias NDdeShareSetInfoA NDdeShareSetInfo;
158     alias NDdeGetErrorStringA NDdeGetErrorString;
159     alias NDdeIsValidShareNameA NDdeIsValidShareName;
160     alias NDdeIsValidAppTopicListA NDdeIsValidAppTopicList;
161     alias NDdeSetTrustedShareA NDdeSetTrustedShare;
162     alias NDdeGetTrustedShareA NDdeGetTrustedShare;
163     alias NDdeTrustedShareEnumA NDdeTrustedShareEnum;
164 }