📄 nativemethods.cs
字号:
//=====================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED TO YOU FOR YOUR REFERENTIAL
// PURPOSES ONLY, AND IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE,
// AND MAY NOT BE REDISTRIBUTED IN ANY MANNER.
//
// Copyright (C) 2003 Microsoft Corporation. All rights reserved.
//
//=====================================================================
using System;
using System.Runtime.InteropServices;
namespace SqlAdmin {
/// <summary>
/// Primary Interop class. COM methods not used are primarily prefixed with Bogus.
/// For information on how to extend this class please post to the support forum. There are some
/// interfaces and classes in this file that are not used implemented throughout the application.
/// </summary>
internal sealed class NativeMethods {
private NativeMethods() {}
public class SQLDMO_PRIVILEGE_TYPE {
public const int SQLDMOPriv_Unknown = 0;
public const int SQLDMOPriv_Select = 1;
public const int SQLDMOPriv_Insert = 2;
public const int SQLDMOPriv_Update = 4;
public const int SQLDMOPriv_Delete = 8;
public const int SQLDMOPriv_Execute = 16;
public const int SQLDMOPriv_References = 32;
public const int SQLDMOPriv_AllObjectPrivs = 63;
public const int SQLDMOPriv_CreateTable = 128;
public const int SQLDMOPriv_CreateDatabase = 256;
public const int SQLDMOPriv_CreateView = 512;
public const int SQLDMOPriv_CreateProcedure = 1024;
public const int SQLDMOPriv_DumpDatabase = 2048;
public const int SQLDMOPriv_CreateDefault = 4096;
public const int SQLDMOPriv_DumpTransaction = 8192;
public const int SQLDMOPriv_CreateRule = 16384;
public const int SQLDMOPriv_DumpTable = 32768;
public const int SQLDMOPriv_CreateFunction = 0x00010000;
public const int SQLDMOPriv_AllDatabasePrivs = 0x0001ff80;
}
public class SQLDMO_NTACCESS_TYPE {
public const int SQLDMONTAccess_Unknown = 0;
public const int SQLDMONTAccess_Grant = 1;
public const int SQLDMONTAccess_Deny = 2;
public const int SQLDMONTAccess_NonNTLogin = 99;
}
public class SQLDMO_LOGIN_TYPE {
public const int SQLDMOLogin_NTUser = 0;
public const int SQLDMOLogin_NTGroup = 1;
public const int SQLDMOLogin_Standard = 2;
}
public class SQLDMO_SCRIPT_TYPE {
public const int SQLDMOScript_None = 0;
public const int SQLDMOScript_Default = 4;
public const int SQLDMOScript_Drops = 1;
public const int SQLDMOScript_ObjectPermissions = 2;
public const int SQLDMOScript_PrimaryObject = 4;
public const int SQLDMOScript_ClusteredIndexes = 8;
public const int SQLDMOScript_Triggers = 16;
public const int SQLDMOScript_DatabasePermissions = 32;
public const int SQLDMOScript_Permissions = 34;
public const int SQLDMOScript_ToFileOnly = 64;
public const int SQLDMOScript_Bindings = 128;
public const int SQLDMOScript_AppendToFile = 256;
public const int SQLDMOScript_NoDRI = 512;
public const int SQLDMOScript_UDDTsToBaseType = 1024;
public const int SQLDMOScript_IncludeIfNotExists = 4096;
public const int SQLDMOScript_NonClusteredIndexes = 8192;
public const int SQLDMOScript_Indexes = 0x00012008;
public const int SQLDMOScript_Aliases = 16384;
public const int SQLDMOScript_NoCommandTerm = 32768;
public const int SQLDMOScript_DRIIndexes = 0x00010000;
public const int SQLDMOScript_IncludeHeaders = 0x00020000;
public const int SQLDMOScript_OwnerQualify = 0x00040000;
public const int SQLDMOScript_TimestampToBinary = 0x00080000;
public const int SQLDMOScript_SortedData = 0x00100000;
public const int SQLDMOScript_SortedDataReorg = 0x00200000;
public const int SQLDMOScript_TransferDefault = 0x000670ff;
public const int SQLDMOScript_DRI_NonClustered = 0x00400000;
public const int SQLDMOScript_DRI_Clustered = 0x00800000;
public const int SQLDMOScript_DRI_Checks = 0x01000000;
public const int SQLDMOScript_DRI_Defaults = 0x02000000;
public const int SQLDMOScript_DRI_UniqueKeys = 0x04000000;
public const int SQLDMOScript_DRI_ForeignKeys = 0x08000000;
public const int SQLDMOScript_DRI_PrimaryKey = 0x10000000;
public const int SQLDMOScript_DRI_AllKeys = 0x1c000000;
public const int SQLDMOScript_DRI_AllConstraints = 0x1f000000;
public const int SQLDMOScript_DRI_All = 0x1fc00000;
public const int SQLDMOScript_DRIWithNoCheck = 0x20000000;
public const int SQLDMOScript_NoIdentity = 0x40000000;
// Too big for int, need uint, but we don't use it anyway
//public const int SQLDMOScript_UseQuotedIdentifiers = 0x80000000;
}
public class SQLDMO_DBSTATUS_TYPE {
public const int SQLDMODBStat_Normal = 0;
public const int SQLDMODBStat_Loading = 32;
public const int SQLDMODBStat_Recovering = 192;
public const int SQLDMODBStat_Suspect = 256;
public const int SQLDMODBStat_Offline = 512;
public const int SQLDMODBStat_Inaccessible = 992;
public const int SQLDMODBStat_EmergencyMode = 32768;
public const int SQLDMODBStat_Standby = 1024;
public const int SQLDMODBStat_All = 34784;
}
public class SQLDMO_GROWTH_TYPE {
public const int SQLDMOGrowth_MB = 0;
public const int SQLDMOGrowth_Percent = 1;
public const int SQLDMOGrowth_Invalid = 99;
}
public class SQLDMO_KEY_TYPE {
public const int SQLDMOKey_Unknown = 0;
public const int SQLDMOKey_Primary = 1;
public const int SQLDMOKey_Unique = 2;
public const int SQLDMOKey_Foreign = 3;
}
[ComVisible(true), ComImport(), Guid("10020200-E260-11CF-AE68-00AA004A34D5")]
public class SqlServer {
}
[ComVisible(true), ComImport(), Guid("10020206-E260-11CF-AE68-00AA004A34D5"), InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)]
public interface ISqlServer {
int Bogus_Application(); // HRESULT Application([out, retval] Application** ppApp);
int Bogus_Parent(); // HRESULT Parent([out, retval] _IVSQLDMOStdObject** ppParent);
int Bogus_UserData1(); // HRESULT UserData([out, retval] long* pRetVal);
int Bogus_UserData2(); // HRESULT UserData([in] long pRetVal);
int Bogus_TypeOf(); // HRESULT TypeOf([out, retval] SQLDMO_OBJECT_TYPE* pRetVal);
int Bogus_Properties(); // HRESULT Properties([out, retval] Properties** ppVBObjRet);
IDatabases GetDatabases(); //HRESULT Databases([out, retval] Databases** ppVBObjRet);
int Bogus_Password1(); // HRESULT Password([out, retval] BSTR* pRetVal);
int Bogus_Password2(); // HRESULT Password([in] BSTR pRetVal);
int Bogus_Name1(); // HRESULT Name([out, retval] BSTR* pRetVal);
int Bogus_Name2(); // HRESULT Name([in] BSTR pRetVal);
int Bogus_Login1(); // HRESULT Login([out, retval] BSTR* pRetVal);
int Bogus_Login2(); // HRESULT Login([in] BSTR pRetVal);
int Bogus_VersionString(); // HRESULT VersionString([out, retval] BSTR* pRetVal);
int Bogus_BackupDevices(); // HRESULT BackupDevices([out, retval] BackupDevices** ppVBObjRet);
int Bogus_VersionMajor(); // HRESULT VersionMajor([out, retval] long* pRetVal);
int Bogus_VersionMinor(); // HRESULT VersionMinor([out, retval] long* pRetVal);
int Bogus_CommandTerminator1(); // HRESULT CommandTerminator([out, retval] BSTR* pRetVal);
int Bogus_CommandTerminator2(); // HRESULT CommandTerminator([in] BSTR pRetVal);
int Bogus_TrueName(); // HRESULT TrueName([out, retval] BSTR* pRetVal);
int Bogus_ConnectionID(); // HRESULT ConnectionID([out, retval] long* pRetVal);
int Bogus_TrueLogin(); // HRESULT TrueLogin([out, retval] BSTR* pRetVal);
int Bogus_IntegratedSecurity(); // HRESULT IntegratedSecurity([out, retval] IntegratedSecurity** ppVBObjRet);
ILanguages GetLanguages(); // HRESULT Languages([out, retval] Languages** ppVBObjRet);
int Bogus_RemoteServers(); // HRESULT RemoteServers([out, retval] RemoteServers** ppVBObjRet);
ILogins GetLogins();// HRESULT Logins([out, retval] Logins** ppVBObjRet);
int Bogus_UserProfile(); // HRESULT UserProfile([out, retval] SQLDMO_SRVUSERPROFILE_TYPE* pRetVal);
int Bogus_MaxNumericPrecision(); // HRESULT MaxNumericPrecision([out, retval] long* pRetVal);
int Bogus_NextDeviceNumber(); // HRESULT NextDeviceNumber([out, retval] long* pRetVal);
int Bogus_QueryTimeout1(); // HRESULT QueryTimeout([out, retval] long* pRetVal);
int Bogus_QueryTimeout2(); // HRESULT QueryTimeout([in] long pRetVal);
int Bogus_LoginTimeout1(); // HRESULT LoginTimeout([out, retval] long* pRetVal);
int Bogus_LoginTimeout2(); // HRESULT LoginTimeout([in] long pRetVal);
int Bogus_NetPacketSize1(); // HRESULT NetPacketSize([out, retval] long* pRetVal);
int Bogus_NetPacketSize2(); // HRESULT NetPacketSize([in] long pRetVal);
int Bogus_HostName1(); // HRESULT HostName([out, retval] BSTR* pRetVal);
int Bogus_HostName2(); // HRESULT HostName([in] BSTR pRetVal);
int Bogus_ApplicationName1(); // HRESULT ApplicationName([out, retval] BSTR* pRetVal);
int Bogus_ApplicationName2(); // HRESULT ApplicationName([in] BSTR pRetVal);
int Bogus_LoginSecure1(); // HRESULT LoginSecure([out, retval] VARIANT_BOOL* pRetVal);
int Bogus_LoginSecure2(bool pRetVal); // HRESULT LoginSecure([in] VARIANT_BOOL pRetVal);
int Bogus_ProcessID(); // HRESULT ProcessID([out, retval] long* pRetVal);
int Bogus_Status(); // HRESULT Status([out, retval] SQLDMO_SVCSTATUS_TYPE* pRetVal);
int Bogus_Registry(); // HRESULT Registry([out, retval] Registry** ppVBObjRet);
int Bogus_Configuration(); // HRESULT Configuration([out, retval] Configuration** ppVBObjRet);
int Bogus_JobServer(); // HRESULT JobServer([out, retval] JobServer** ppVBObjRet);
int Bogus_ProcessOutputBuffer1(); // HRESULT ProcessInputBuffer([in] long ProcessID, [out, retval] BSTR* pRetVal);
int Bogus_ProcessOutputBuffer2(); // HRESULT ProcessOutputBuffer([in] long ProcessID, [out, retval] BSTR* pRetVal);
int Bogus_Language1(); // HRESULT Language([out, retval] BSTR* pRetVal);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -