Merge pull request #4063 from ntherning/fix-culture-info-problem-in-RepeatInfoTest
[mono.git] / mcs / class / corlib / ReferenceSources / win32native.cs
1 using System;
2 using System.IO;
3 using System.Runtime.InteropServices;
4
5 namespace Microsoft.Win32
6 {
7         static class Win32Native
8         {
9                 internal const string ADVAPI32 = "advapi32.dll";
10
11                 // Error codes from WinError.h
12                 internal const int ERROR_SUCCESS = 0x0;
13                 internal const int ERROR_INVALID_FUNCTION = 0x1;
14                 internal const int ERROR_FILE_NOT_FOUND = 0x2;
15                 internal const int ERROR_PATH_NOT_FOUND = 0x3;
16                 internal const int ERROR_ACCESS_DENIED  = 0x5;
17                 internal const int ERROR_INVALID_HANDLE = 0x6;
18                 internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8;
19                 internal const int ERROR_INVALID_DATA = 0xd;
20                 internal const int ERROR_INVALID_DRIVE = 0xf;
21                 internal const int ERROR_NO_MORE_FILES = 0x12;
22                 internal const int ERROR_NOT_READY = 0x15;
23                 internal const int ERROR_BAD_LENGTH = 0x18;
24                 internal const int ERROR_SHARING_VIOLATION = 0x20;
25                 internal const int ERROR_NOT_SUPPORTED = 0x32;
26                 internal const int ERROR_FILE_EXISTS = 0x50;
27                 internal const int ERROR_INVALID_PARAMETER = 0x57;
28                 internal const int ERROR_BROKEN_PIPE = 0x6D;
29                 internal const int ERROR_CALL_NOT_IMPLEMENTED = 0x78;
30                 internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A;
31                 internal const int ERROR_INVALID_NAME = 0x7B;
32                 internal const int ERROR_BAD_PATHNAME = 0xA1;
33                 internal const int ERROR_ALREADY_EXISTS = 0xB7;
34                 internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB;
35                 internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE;  // filename too long.
36                 internal const int ERROR_NO_DATA = 0xE8;
37                 internal const int ERROR_PIPE_NOT_CONNECTED = 0xE9;
38                 internal const int ERROR_MORE_DATA = 0xEA;
39                 internal const int ERROR_DIRECTORY = 0x10B;
40                 internal const int ERROR_OPERATION_ABORTED = 0x3E3;  // 995; For IO Cancellation
41                 internal const int ERROR_NOT_FOUND = 0x490;          // 1168; For IO Cancellation
42                 internal const int ERROR_NO_TOKEN = 0x3f0;
43                 internal const int ERROR_DLL_INIT_FAILED = 0x45A;
44                 internal const int ERROR_NON_ACCOUNT_SID = 0x4E9;
45                 internal const int ERROR_NOT_ALL_ASSIGNED = 0x514;
46                 internal const int ERROR_UNKNOWN_REVISION = 0x519;
47                 internal const int ERROR_INVALID_OWNER = 0x51B;
48                 internal const int ERROR_INVALID_PRIMARY_GROUP = 0x51C;
49                 internal const int ERROR_NO_SUCH_PRIVILEGE = 0x521;
50                 internal const int ERROR_PRIVILEGE_NOT_HELD = 0x522;
51                 internal const int ERROR_NONE_MAPPED = 0x534;
52                 internal const int ERROR_INVALID_ACL = 0x538;
53                 internal const int ERROR_INVALID_SID = 0x539;
54                 internal const int ERROR_INVALID_SECURITY_DESCR = 0x53A;
55                 internal const int ERROR_BAD_IMPERSONATION_LEVEL = 0x542;
56                 internal const int ERROR_CANT_OPEN_ANONYMOUS = 0x543;
57                 internal const int ERROR_NO_SECURITY_ON_OBJECT = 0x546;
58                 internal const int ERROR_TRUSTED_RELATIONSHIP_FAILURE = 0x6FD;
59
60                 internal const FileAttributes FILE_ATTRIBUTE_DIRECTORY = FileAttributes.Directory;
61
62                 public static string GetMessage (int hr)
63                 {
64                         return "Error " + hr;
65                 }
66
67                 public static int MakeHRFromErrorCode (int errorCode)
68                 {
69                         return unchecked(((int)0x80070000) | errorCode);
70                 }
71
72                 public class SECURITY_ATTRIBUTES
73                 {
74
75                 }
76
77                 internal class WIN32_FIND_DATA
78                 {
79                         internal int dwFileAttributes = 0;
80                         internal String cFileName = null;
81                 }
82         }
83 }