/[Sims3RigEditor]/trunk/ViewDDS/NativeStructs.cs
ViewVC logotype

Contents of /trunk/ViewDDS/NativeStructs.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 39 - (show annotations) (download)
Thu Aug 5 21:38:32 2010 UTC (9 years, 11 months ago) by william
File size: 12077 byte(s)
update Paint.NET DDS plugin, again...

1 /////////////////////////////////////////////////////////////////////////////////
2 // Paint.NET //
3 // Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors. //
4 // Portions Copyright (C) Microsoft Corporation. All Rights Reserved. //
5 // See src/Resources/Files/License.txt for full licensing and attribution //
6 // details. //
7 // . //
8 /////////////////////////////////////////////////////////////////////////////////
9
10 using System;
11 using System.Runtime.InteropServices;
12
13 namespace PaintDotNet.SystemLayer
14 {
15 internal static class NativeStructs
16 {
17 [StructLayout(LayoutKind.Sequential)]
18 internal struct PROCESS_INFORMATION
19 {
20 public IntPtr hProcess;
21 public IntPtr hThread;
22 public uint dwProcessId;
23 public uint dwThreadId;
24 }
25
26 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
27 internal struct STATSTG
28 {
29 public IntPtr pwcsName;
30 public NativeConstants.STGTY type;
31 public ulong cbSize;
32 public System.Runtime.InteropServices.ComTypes.FILETIME mtime;
33 public System.Runtime.InteropServices.ComTypes.FILETIME ctime;
34 public System.Runtime.InteropServices.ComTypes.FILETIME atime;
35 public uint grfMode;
36 public uint grfLocksSupported;
37 public Guid clsid;
38 public uint grfStateBits;
39 public uint reserved;
40 }
41
42 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]
43 internal struct KNOWNFOLDER_DEFINITION
44 {
45 public NativeConstants.KF_CATEGORY category;
46 [MarshalAs(UnmanagedType.LPWStr)]
47 public string pszName;
48 [MarshalAs(UnmanagedType.LPWStr)]
49 public string pszCreator;
50 [MarshalAs(UnmanagedType.LPWStr)]
51 public string pszDescription;
52 public Guid fidParent;
53 [MarshalAs(UnmanagedType.LPWStr)]
54 public string pszRelativePath;
55 [MarshalAs(UnmanagedType.LPWStr)]
56 public string pszParsingName;
57 [MarshalAs(UnmanagedType.LPWStr)]
58 public string pszToolTip;
59 [MarshalAs(UnmanagedType.LPWStr)]
60 public string pszLocalizedName;
61 [MarshalAs(UnmanagedType.LPWStr)]
62 public string pszIcon;
63 [MarshalAs(UnmanagedType.LPWStr)]
64 public string pszSecurity;
65 public uint dwAttributes;
66 public NativeConstants.KF_DEFINITION_FLAGS kfdFlags;
67 public Guid ftidType;
68 }
69
70 [StructLayout(LayoutKind.Sequential, Pack = 4)]
71 internal struct PROPERTYKEY
72 {
73 public Guid fmtid;
74 public uint pid;
75 }
76
77 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 4)]
78 internal struct COMDLG_FILTERSPEC
79 {
80 [MarshalAs(UnmanagedType.LPWStr)]
81 public string pszName;
82 [MarshalAs(UnmanagedType.LPWStr)]
83 public string pszSpec;
84 }
85
86 [StructLayout(LayoutKind.Sequential)]
87 internal struct SYSTEM_INFO
88 {
89 public ushort wProcessorArchitecture;
90 public ushort wReserved;
91 public uint dwPageSize;
92 public IntPtr lpMinimumApplicationAddress;
93 public IntPtr lpMaximumApplicationAddress;
94 public UIntPtr dwActiveProcessorMask;
95 public uint dwNumberOfProcessors;
96 public uint dwProcessorType;
97 public uint dwAllocationGranularity;
98 public ushort wProcessorLevel;
99 public ushort wProcessorRevision;
100 }
101
102 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
103 internal struct OSVERSIONINFOEX
104 {
105 public static int SizeOf
106 {
107 get
108 {
109 return Marshal.SizeOf(typeof(OSVERSIONINFOEX));
110 }
111 }
112
113 public uint dwOSVersionInfoSize;
114 public uint dwMajorVersion;
115 public uint dwMinorVersion;
116 public uint dwBuildNumber;
117 public uint dwPlatformId;
118
119 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
120 public string szCSDVersion;
121
122 public ushort wServicePackMajor;
123
124 public ushort wServicePackMinor;
125 public ushort wSuiteMask;
126 public byte wProductType;
127 public byte wReserved;
128 }
129
130 [StructLayout(LayoutKind.Sequential)]
131 internal struct COPYDATASTRUCT
132 {
133 internal UIntPtr dwData;
134 internal uint cbData;
135 internal IntPtr lpData;
136 }
137
138 [StructLayout(LayoutKind.Sequential)]
139 internal struct SHELLEXECUTEINFO
140 {
141 internal uint cbSize;
142 internal uint fMask;
143 internal IntPtr hwnd;
144 [MarshalAs(UnmanagedType.LPTStr)] internal string lpVerb;
145 [MarshalAs(UnmanagedType.LPTStr)] internal string lpFile;
146 [MarshalAs(UnmanagedType.LPTStr)] internal string lpParameters;
147 [MarshalAs(UnmanagedType.LPTStr)] internal string lpDirectory;
148 internal int nShow;
149 internal IntPtr hInstApp;
150 internal IntPtr lpIDList;
151 [MarshalAs(UnmanagedType.LPTStr)] internal string lpClass;
152 internal IntPtr hkeyClass;
153 internal uint dwHotKey;
154 internal IntPtr hIcon_or_hMonitor;
155 internal IntPtr hProcess;
156 }
157
158 [StructLayout(LayoutKind.Sequential)]
159 internal struct MEMORYSTATUSEX
160 {
161 internal uint dwLength;
162 internal uint dwMemoryLoad;
163 internal ulong ullTotalPhys;
164 internal ulong ullAvailPhys;
165 internal ulong ullTotalPageFile;
166 internal ulong ullAvailPageFile;
167 internal ulong ullTotalVirtual;
168 internal ulong ullAvailVirtual;
169 internal ulong ullAvailExtendedVirtual;
170 }
171
172 [StructLayout(LayoutKind.Sequential)]
173 internal struct OVERLAPPED
174 {
175 internal UIntPtr Internal;
176 internal UIntPtr InternalHigh;
177 internal uint Offset;
178 internal uint OffsetHigh;
179 internal IntPtr hEvent;
180 }
181
182 [StructLayout(LayoutKind.Sequential)]
183 internal struct RGBQUAD
184 {
185 internal byte rgbBlue;
186 internal byte rgbGreen;
187 internal byte rgbRed;
188 internal byte rgbReserved;
189 }
190
191 [StructLayout(LayoutKind.Sequential)]
192 internal struct BITMAPINFOHEADER
193 {
194 internal uint biSize;
195 internal int biWidth;
196 internal int biHeight;
197 internal ushort biPlanes;
198 internal ushort biBitCount;
199 internal uint biCompression;
200 internal uint biSizeImage;
201 internal int biXPelsPerMeter;
202 internal int biYPelsPerMeter;
203 internal uint biClrUsed;
204 internal uint biClrImportant;
205 }
206
207 [StructLayout(LayoutKind.Sequential)]
208 internal struct BITMAPINFO
209 {
210 internal BITMAPINFOHEADER bmiHeader;
211 internal RGBQUAD bmiColors;
212 }
213
214 [StructLayout(LayoutKind.Sequential)]
215 internal unsafe struct MEMORY_BASIC_INFORMATION
216 {
217 internal void *BaseAddress;
218 internal void *AllocationBase;
219 internal uint AllocationProtect;
220 internal UIntPtr RegionSize;
221 internal uint State;
222 internal uint Protect;
223 internal uint Type;
224 };
225
226 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
227 internal class LOGFONT
228 {
229 internal int lfHeight = 0;
230 internal int lfWidth = 0;
231 internal int lfEscapement = 0;
232 internal int lfOrientation = 0;
233 internal int lfWeight = 0;
234 internal byte lfItalic = 0;
235 internal byte lfUnderline = 0;
236 internal byte lfStrikeOut = 0;
237 internal byte lfCharSet = 0;
238 internal byte lfOutPrecision = 0;
239 internal byte lfClipPrecision = 0;
240 internal byte lfQuality = 0;
241 internal byte lfPitchAndFamily = 0;
242
243 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
244 internal string lfFaceName = string.Empty;
245 }
246
247 [StructLayout(LayoutKind.Sequential)]
248 internal struct LOGBRUSH
249 {
250 internal uint lbStyle;
251 internal uint lbColor;
252 internal int lbHatch;
253 };
254
255 [StructLayout(LayoutKind.Sequential)]
256 internal struct RGNDATAHEADER
257 {
258 internal uint dwSize;
259 internal uint iType;
260 internal uint nCount;
261 internal uint nRgnSize;
262 internal RECT rcBound;
263 };
264
265 [StructLayout(LayoutKind.Sequential)]
266 internal struct RGNDATA
267 {
268 internal RGNDATAHEADER rdh;
269
270 internal unsafe static RECT *GetRectsPointer(RGNDATA *me)
271 {
272 return (RECT *)((byte *)me + sizeof(RGNDATAHEADER));
273 }
274 }
275
276 [StructLayout(LayoutKind.Sequential)]
277 internal struct POINT
278 {
279 internal int x;
280 internal int y;
281 }
282
283 [StructLayout(LayoutKind.Sequential)]
284 internal struct RECT
285 {
286 internal int left;
287 internal int top;
288 internal int right;
289 internal int bottom;
290 }
291
292 [StructLayout(LayoutKind.Sequential)]
293 internal unsafe struct PropertyItem
294 {
295 internal int id;
296 internal uint length;
297 internal short type;
298 internal void *value;
299 }
300
301 [StructLayout(LayoutKind.Sequential)]
302 internal unsafe struct WINTRUST_DATA
303 {
304 internal uint cbStruct;
305 internal IntPtr pPolicyCallbackData;
306 internal IntPtr pSIPClientData;
307 internal uint dwUIChoice;
308 internal uint fdwRevocationChecks;
309 internal uint dwUnionChoice;
310 internal void *pInfo; // pFile, pCatalog, pBlob, pSgnr, or pCert
311 internal uint dwStateAction;
312 internal IntPtr hWVTStateData;
313 internal IntPtr pwszURLReference;
314 internal uint dwProvFlags;
315 internal uint dwUIContext;
316 }
317
318 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
319 internal unsafe struct WINTRUST_FILE_INFO
320 {
321 internal uint cbStruct;
322 internal char *pcwszFilePath;
323 internal IntPtr hFile;
324 }
325
326 [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
327 internal struct WINHTTP_CURRENT_USER_IE_PROXY_CONFIG
328 {
329 internal bool fAutoDetect;
330 internal IntPtr lpszAutoConfigUrl;
331 internal IntPtr lpszProxy;
332 internal IntPtr lpszProxyBypass;
333 };
334
335 [StructLayout(LayoutKind.Sequential)]
336 internal struct SP_DEVINFO_DATA
337 {
338 public uint cbSize;
339 public Guid ClassGuid;
340 public uint DevInst;
341 public UIntPtr Reserved;
342 }
343 }
344 }

  ViewVC Help
Powered by ViewVC 1.1.22