Desktop Functions: Smart Device Functions:
|
Search Results for "AI" in [All]wintrust
WholeChain = 0x00000001
NoIe4ChainFlag = 0x00000002,
RevocationCheckChain = 0x00000040,
RevocationCheckChainExcludeRoot = 0x00000080,
CacheOnlyUrlRetrieval = 0x00001000, // affects CRL retrieval and AIA retrieval
DisableMD2andMD4 = 0x00002000 // Win7 SP1+: Disallows use of MD2 or MD4 in the chain except for the root
WinTrustDataProvFlags ProvFlags = WinTrustDataProvFlags.RevocationCheckChainExcludeRoot;
SubjectNotTrusted = 0x800b0004, // Subject failed the specified verification action
UntrustedRoot = 0x800B0109 // CERT_E_UNTRUSTEDROOT - A certification chain processed correctly but terminated in a root certificate that is not trusted by the trust provider. difxapidtl3: DTL_C_DEFINE
/// Contains unsafe dtl dll calls
/// Contains unsafe dtl dll calls
/// Contains unsafe dtl dll calls
foreach (KeyValuePair<string, int> id in _driverLookupList) 6: DTL_ERROR_S
/// Contains unsafe dtl dll calls 7: DTL_INIT
/// Contains unsafe dtl dll calls
foreach (KeyValuePair<string, int> id in _driverLookupList) 8: DTL_READ_W
/// Contains unsafe dtl dll calls 9: DTL_UNDEF
/// Contains unsafe dtl dll calls 10: DTL_UNINIT
/// Contains unsafe dtl dll calls 11: DTL_WRITE_W
/// Contains unsafe dtl dll calls urlmon
The return value from CoInternetSetFeatureEnabled should be passed to the static ThrowExceptionForHR method on the Marshal class as well, in case a fail code is returned (or better yet, a wrapper can be created to this method). 13: CopyMemory
// static void Main()
public static unsafe void Main()
Public Sub Main(ParamArray args As String())
Main(args) 14: FindMimeFromData
''' <summary>Internet Explorer 6 for Windows XP SP2 and later. Perform MIME-type detection if "text/plain" is proposed, even if data sniffing is otherwise disabled. Plain text may be converted to text/html if HTML tags are detected. </summary>
IgnoreMIMETextPlain = &H4
''' <summary>Internet Explorer 8. Use the authoritative MIME type specified in pwzMimeProposed. Unless <see cref="MIMEFlags.IgnoreMIMETextPlain "/> is specified, no data sniffing is performed.</summary>
''' <summary>Internet Explorer 9. Do not perform detection if "text/plain" is specified in pwzMimeProposed.</summary>
RespectTextPlain = &H10
Trace.Write("MimeType is " + MimeTypeFrom(Encoding.ASCII.GetBytes("%PDF-"), "text/plain")); 15: SnFLas Tz7z1A <a href="http://beaiqqlwgezg.com/">beaiqqlwgezg</a>, [url=http://vvbkyavavtqc.com/]vvbkyavavtqc[/url], [link=http://mgeuboixasnf.com/]mgeuboixasnf[/link], http://gxtzlypvyfhs.com/
/// The URLMON library contains this function, URLDownloadToFile, which is a way This can be used in place of IWebBrowser2.ExecWB( Save-As, Dont-Prompt ) which will always prompt the user anyway. The function does not return until the transfer finishes or fails.
/// The URLMON library contains this function, URLDownloadToFile, which is a way This function does not prompt user for file location, as does ExecWB (even when you specify DONTPROMPT), and it does not return until file transfer finishes or fails.
If (My.Computer.Network.IsAvailable) Then secur3218: EncryptMessage Check InitializeSecurityContext for details 19: GetUserNameEx
/// The domain-only version includes trailing backslashes (\\).
/// The domain-only version includes a trailing forward slash (/).
/// is replaced with a new line character (\n), even in a domain-only case
/// The DNS domain name followed by a backward-slash and the SAM user name.
NameDnsDomain = 12 This may be required because System.Environment.UserDomainName is broken. If the local machine has a user account that is the same name as a logged in domain user (machineName\bob & domainName\bob) UserDomainName returns the machine name, not the domain name.
NameDnsDomain = 12
public String GetUserDomain()
NameDnsDomain = 12 [System.Environment.UserDomainName]
public uint cbSecurityTrailer;
throw new Exception("InitializeSecurityContext() failed!!!");
throw new Exception("AcceptSecurityContext() failed!!!");
throw new Exception("QueryContextAttribute() failed!!!");
ThisSecHelper[1] = new MultipleSecBufferHelper(new byte[ContextSizes.cbSecurityTrailer],SecBufferType.SECBUFFER_TOKEN);
throw new Exception("EncryptMessage() failed!!!");
int SecurityTrailerLength = encryptedBuffer.Length - messageLength;
byte[] SecurityTrailer = new byte[SecurityTrailerLength];
Array.Copy(encryptedBuffer,messageLength,SecurityTrailer,0,SecurityTrailerLength);
ThisSecHelper[1] = new MultipleSecBufferHelper(SecurityTrailer,SecBufferType.SECBUFFER_TOKEN);
throw new Exception("DecryptMessage() failed!!!");
throw new Exception("QueryContextAttribute() failed!!!");
throw new Exception("MakeSignature() failed!!!");
throw new Exception("VerifySignature() failed!!!");
static void Main(string[] args) Whidbey makes it trivial to Kerberize your application using NegotiateStream. Check the Beta documentation for details...
/// <param name="LsaHandle">[in] Handle obtained from a previous call to LsaRegisterLogonProcess or LsaConnectUntrusted.</param>
/// <param name="AuthenticationPackage">[in] Supplies the identifier of the authentication package. This value is obtained by calling LsaLookupAuthenticationPackage.</param>
/// <returns>If the function succeeds, the return value is STATUS_SUCCESS. Check the ProtocolStatus parameter to obtain the status returned by the authentication package.
/// If the function fails, the return value is an NTSTATUS code. The following are possible error codes.
public LSA_UNICODE_STRING LoginDomain;
public LSA_UNICODE_STRING DnsDomainName;
string domain = Marshal.PtrToStringUni(data.LoginDomain.buffer).Trim(); //domain for this account
listBox1.Items.Add("User: " + username + " *** Domain: " + domain + " *** Login Type: (" + data.LogonType + ") " + secType.ToString() +" *** Login Time: "+time.ToLocalTime().ToString()); 23: LsaLogonUser
/// This sample uses S4U security, which requires Windows Server 2003 and a W2003 domain controller
string Domain,
using (OSCalls.KerbS4ULogon authPackage = new OSCalls.KerbS4ULogon(UserName,Domain))
/// Requires Windows Server 2003 domain account running in Win2003 native domain mode
/// Raises an exception with error information if the user cannot log in
new Win32.HandleSecurityToken(credential.UserName,credential.Domain,(Win32.OSCalls.WinLogonType)logonType)) System.Security.Principal.WindowsIdentity has a constructor that you can use if you know the user's principal name (UPN). It does not work however for domain\username. 25: TranslateName This may be required to obtain the UPN (or other format) of a user's credentials. Minimum supported OS is Windows 2000. Full documentation of the native API is available from http://msdn.microsoft.com/en-us/library/ms725484(VS.85).aspx.
NameDnsDomain = 12
public string GetTranslatedName(string domain, string user)
string samCompatibleName = domain.ToUpper() + "\\" + username; winhttp
/// <param name="lpcwszUrl">A pointer to a null-terminated Unicode string that contains the URL of the HTTP request that the application is preparing to send.</param>
/// <returns>If the function succeeds, the function returns <c>true</c>. If the function fails, it returns <c>false</c>. For extended error data, call <see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error"/>.</returns> ERROR_WINHTTP_LOGIN_FAILURE - The login attempt failed. When this error is encountered, close the request handle with WinHttpCloseHandle. A new request handle must be created before retrying the function that originally produced this error. ERROR_NOT_ENOUGH_MEMORY - Not enough memory was available to complete the requested operation. (Windows error code) WinHttpGetProxyForUrl must be called on a per-URL basis, because the PAC file can return a different proxy server for different URLs. This is useful because the PAC file enables an IT department to implement proxy server load balancing by mapping (hashing) the target URL (specified by the lpcwszUrl parameter) to a certain proxy in a proxy server array.
static extern bool WinHttpQueryDataAvailable(
ref UInt32 lpdwNumberOfBytesAvailable
Declare Function WinHttpQueryDataAvailable Lib "winhttp.dll" (ByVal hRequest As IntPtr, ByRef lpdwNumberOfBytesAvailable As Integer) As Boolean iphlpapi29: FIXED_INFO
public string DomainName; Some, but not, all the information provided by the P/Invoke are available from the managed System.Net.NetworkInformation.NetworkInterface (http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.aspx) class.
IF_TYPE_MEDIAMAILOVERIP = 139, // Multimedia Mail over IP
public uint Dhcpv6Iaid; 31: GetAdaptersInfo
// Lease Obtained (convert from "time_t" to C# DateTime)
DateTime pdatDate = new DateTime(1970, 1, 1).AddSeconds( entry.LeaseObtained ).ToLocalTime();
Console.WriteLine( "Lease Obtained: {0}", pdatDate.ToString() );
throw new InvalidOperationException( "GetAdaptersInfo failed: " + ret ); 32: GetBestInterface
static void Main(string[] args)
MIB_TCP_STATE_FIN_WAIT1,
MIB_TCP_STATE_FIN_WAIT2,
MIB_TCP_STATE_CLOSE_WAIT,
MIB_TCP_STATE_TIME_WAIT,
$StateList=@("UNKNOWN","CLOSED","LISTEN","SYN-SENT","SYN-RECEIVED","ESTABLISHED","FIN-WAIT-1","FIN-WAIT-2","CLOSE-WAIT","CLOSING","LAST-ACK","TIME-WAIT","DELETE-TCB") 34: GetIpNetTable
static void Main(string[] args)
// Make the call again. If it did not succeed, then
// raise an error.
' Make the call again. If it did not succeed, then
' raise an error. 35: GetNetworkParams
//try again w/ bigger buffer:
Private Const MAX_DOMAIN_NAME_LEN As Integer = 128
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAX_DOMAIN_NAME_LEN + 4)>
Public DomainName As String
'Try again w/ bigger buffer 36: MIB_IPNETROW
static void Main(string[] args)
string[] hostDetail = targetHost.Split(new string[] { "," }, StringSplitOptions.None);
if (hostDetail != null && hostDetail.Length == 3)
uint iDstAddr = lIpFromString(hostDetail[0]);
uint iDstMask = lIpFromString(hostDetail[1]);
filter.wDstPort = UInt16.Parse(hostDetail[2]);
filter.wDstPortHighRange = UInt16.Parse(hostDetail[2]);
static void Main(string[] args)
string[] hostDetail = targetHost.Split(new string[] { "," }, StringSplitOptions.None);
if (hostDetail != null && hostDetail.Length == 3)
uint iDstAddr = lIpFromString(hostDetail[0]);
uint iDstMask = lIpFromString(hostDetail[1]);
filter.wDstPort = UInt16.Parse(hostDetail[2]);
filter.wDstPortHighRange = UInt16.Parse(hostDetail[2]);
/// The bMustBeUnique parameter can turn a shared interface into a unique one. However, using bMustBeUnique in this way can cause the function to fail.</param>
static void Main(string[] args)
string[] hostDetail = targetHost.Split(new string[] { "," }, StringSplitOptions.None);
if (hostDetail != null && hostDetail.Length == 3)
uint iDstAddr = lIpFromString(hostDetail[0]);
uint iDstMask = lIpFromString(hostDetail[1]);
filter.wDstPort = UInt16.Parse(hostDetail[2]);
filter.wDstPortHighRange = UInt16.Parse(hostDetail[2]);
/// <param name="pInterface">[in] Specifies an interface handle obtained from a previous call to PfCreateInterface.</param> 41: SendARP
throw new Win32Exception(retValue, "SendARP failed."); winspool43: AddMonitor
MessageBox.Show(String.Format("Adding the monitor failed.\n\nError: {0}", errorMessage), sErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(String.Format("Adding the monitor failed:\n\nException: {0}", e.ToString()), sErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); 44: DeleteMonitor
MessageBox.Show(String.Format("Deleting the monitor failed.\n\nError: {0}", errorMessage), sErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(String.Format("Deleting the monitor failed.\n\nException: {0}", ex.ToString()), sErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); Obtain a pointer to the DEVMODE struct (either printerHandle or printerName can be NULL | IntPtr.ZERO): On a Win8 x64 system, I encountered the issue when I was trying to target x86 compiling. The call to DocumentProperties would fail and return -1 for sizeNeeded. If I target x64 or AnyCPU, everything is working fine. However, because of other constraints, I had to target x86 and couldn't make it work without using the IntPtr.Zero fix. Now it works in every configuration. 46: DRIVER_INFO_6
/// structure contains printer driver information
/// Pointer to a null-terminated string that specifies a file name or a full path and file name for the file that contains the device driver (for example, C:\DRIVERS\Pscript.dll).
/// Pointer to a null-terminated string that specifies a file name or a full path and file name for the file that contains driver data (for example, C:\DRIVERS\Qms810.ppd).
/// A pointer to a MultiSZ buffer that contains a sequence of null-terminated strings. Each null-terminated string in the buffer contains the name of a file the driver depends on. The sequence of strings is terminated by an empty, zero-length string. If pDependentFiles is not NULL and does not contain any file names, it will point to a buffer that contains two empty strings. 47: DRIVER_INFO_8 48: EnumJobs
'this call will always fail (return non-0) 49: EnumMonitors
throw new Exception("EnumMonitors should fail!"); 50: EnumPorts
'to zero. The call will fails specifying
throw new Exception("EnumPrinters should fail!");
// length contains the path length
// str contains the path 53: OpenPrinter As always, only do SetLastError=true if you actually intend to call GetLastError (This includes throwing a Win32Exception if the call fails) 54: SetJob
Public Const JOB_CONTROL_RETAIN = &H8 55: WritePrinter
// Returns true on success, false on failure.
bool bSuccess = false; // Assume failure unless you specifically succeed. 56: XcvData
// hXvc contains an Xcv data handle to a local TCPMON port faultrep
static void Main(string[] args) setupapi58: CM_Get_Child property, A CM_DRP_-prefixed constant value that identifies the device property to be obtained from the registry. These constants are defined in Cfgmgr32.h. Also Microsoft.Win32.RegistryValueKind only contains enumerations for the basic kinds.
// from SetupDiEnumDeviceInterfaces and SetupDiGetDeviceInterfaceDetail so please see those examples Cut off search results after 60. Please refine your search. |