Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "TEST" in [All]

ntdll

.

static void ObjectManagerTest()

.

using System.IO; // for test main (FileStream) only

.

using System.Text; // for test main (Encoding) only

.

using System.Threading; // for test main (Thread.Sleep) only

.

using System.Diagnostics; // for test main (Trace.Write[Line]) only

.

    #region test main

.

        // create a test file:

.

        string path2file = "test.fle";

.

        string contents = "contents of test.fle";

.

        // wait a little (1.5 sec) and modify test file attributes:

.

        // run the test:

.

    //path2file=test.fle

.

    #endregion test main

.

public void Test()

.

Tested on Win8.1 x64 by @gsuberland, but not thoroughly.

.

public void Test()

shell32

6: api
.

teste

.

However, tests indicates that the upon return, the contents of both iconPath and index parameters are the same after the function returns successfully.

.

    public partial class IconTest : Form

.

    public IconTest()

.
Summary
IsNetDrive - Tests whether a drive is a network drive.
.

/// Tests whether a drive is a network drive.

.

/// An integer that indicates which drive letter you want to test.

.

''' Tests whether a drive is a network drive.

.

''' An integer that indicates which drive letter you want to test.

.
Summary
IsUserAnAdmin - Tests whether the current user is a member of the Administrator's group.
.

/// Tests whether the current user is a member of the Administrator's group.

.

''' Tests whether the current user is a member of the Administrator's group.

.

fileSpec.Append("Bad*file?<test>.txt");

.

            return MyComputer;  // must test for string.Empty

.

SHCreateDirectoryEx(IntPtr.Zero, @"D:\test\", IntPtr.Zero);

.

Be careful with the string structure fields: UnmanagedType.LPTStr will be marshalled as unicode string so only the first character will be recognized by the function. Use UnmanagedType.LPStr instead. [Tested on Win7]

.

The hwnd field should be the handle of the required parent calling window (see http://msdn.microsoft.com/en-us/library/bb762169.aspx). passing in <parent window>.Handle (in C#) works in XP, but in Vista it does not. What works on Vista is passing in 0 (IntPtr.Zero). I have tested this on WP SP2 and it works there as well.

.

Public Class SHGetNameFromIDList#_TEST

.

(not 100% certain this is correct, need to test)

urlmon

.

   Public Module CopyMemoryTest

.

    //rename crystal.jpg to .gif to test functionality!

.

  result = FindMimeFromData(0, "file://c:/test/form1.frm", vbNullString, 0, vbNullString, 0, buffAddr, 0)

odbc32

.

            //Set the environment attribute SQL_ATTR_ODBC_VERSION to the latest version of ODBC driver

ole32

.

   void TestCancel();

.
Summary
.

static extern int CreateStreamOnHGlobal(IntPtr hGlobal, bool fDeleteOnRelease,

.

    Declare Function CreateStreamOnHGlobal Lib "ole32" (ByVal hGlobal As IntPtr, ByVal fDeleteOnRelease As Boolean, ByRef ppstm As UCOMIStream) As Long

.
Documentation
.

       [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")] // Create a COM stream from a pointer in unmanaged memory

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

                if (CreateStreamOnHGlobal(nativePtr, true, out comStream) == S_OK) // Create IStream from allocated memory that has buffer data

.

      [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")]

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

         if (CreateStreamOnHGlobal(ptrIStream, true, out IPtrStream) == 0)

.

    [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")]

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

         if (CreateStreamOnHGlobal(ptrIStream, true, out IPtrStream) == 0)

26: STGC
.
Summary
.

static extern int StgCreateStorageEx([MarshalAs(UnmanagedType.LPWStr)] string

.
Documentation
[StgCreateStorageEx] on MSDN
.
Summary
.

static extern int StgCreateStorageEx([MarshalAs(UnmanagedType.LPWStr)] string

.
Documentation
[StgCreateStorageEx] on MSDN
.

            WriteStorage(storageRoot, fileName, writer);

.

    private static void WriteStorage(StorageInfo storageInfo, string storageName, XmlWriter writer)

.

        writer.WriteStartElement("storage");

.

        writer.WriteAttributeString("name", storageName);

.

            WriteStorage(subStorage, subStorage.Name, writer);

.

            string hexData = ConvertStreamBytesToHex(stream);

.

            writer.WriteStartElement("stream");

.

            writer.WriteAttributeString("name", stream.Name);

.

            writer.WriteAttributeString("data", hexData);

.

    private static string ConvertStreamBytesToHex(StreamInfo streamInfo)

kernel32

.

// Tested added during 1-pass copy & paste of windows console fuctions

.
  • dwProcessId should be uint.Max (ATTACH_PARENT_PROCESS) or the process' ID that you want to attach to (untested in .NET for me anyway)
.

    /// I have NOT tested interprocess attaching in .NET so dont blame me if it doesnt work! </summary>

.
  • dwProcessId should be uint.Max (ATTACH_PARENT_PROCESS) or the process' ID that you want to attach to (untested in .NET for me anyway)
.

    /// I have NOT tested interprocess attaching in .NET so dont blame me if it doesnt work! </summary>

.

   uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, bool bAbort,

.

Private Shared Function BackupRead(hFile As IntPtr, lpBuffer As IntPtr, nNumberOfBytesToRead As UInteger, ByRef lpNumberOfBytesRead As UInteger, bAbort As Boolean,    bProcessSecurity As Boolean, _

.

   uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, bool bAbort,

.

This has not been tested and is provided for convenience as a roll-up of the individual console functions here on pinvoke.net into one location.

.

    // TODO: Test - what's an out uint[] during interop? This probably isn't quite right, but provides a starting point:

.

    long TotalBytesTransferred,

.

    long StreamBytesTransferred,

.

        ByVal TotalBytesTransferred As Long, ByVal StreamSize As Long, ByVal StreamBytesTransferred As Long, _

.

    Public Function GetBytesTransfered() As Int64

.

        GetBytesTransfered = CLng(ammountTransfered)

.

    long TotalBytesTransferred,

.

    long StreamBytesTransferred,

.

        ByVal TotalBytesTransferred As Long, ByVal StreamSize As Long, ByVal StreamBytesTransferred As Long, _

.

    Public Function GetBytesTransfered() As Int64

.

        GetBytesTransfered = CLng(ammountTransfered)

.

    /// <param name="BytesToWrite"></param>

.

    unsafe public void Write(byte[] Buffer, int BytesToWrite, Int64 AtOffset)

.

        ums.Write(Buffer, 0, BytesToWrite);

.

    /// <param name="BytesToRead"></param>

.

    unsafe public int Read(byte[] Buffer, int BytesToRead, Int64 AtOffset)

.

        byte[] ba = new byte[BytesToRead];

.

        return ums.Read(Buffer, 0, BytesToRead);

.

    private static extern IntPtr MapViewOfFile(IntPtr hFileMapping, FileMapAccess dwDesiredAccess, Int32 dwFileOffsetHigh, Int32 dwFileOffsetLow, Int32 dwNumberOfBytesToMap);

.

    internal static IntPtr MapViewOfFile(IntPtr hFileMapping, FileMapAccess dwDesiredAccess, Int64 ddFileOffset, Int32 dwNumberOfBytesToMap)

.

        return MapViewOfFile(hFileMapping, dwDesiredAccess, Hi, Lo, dwNumberOfBytesToMap);

.

       Int32 dwNumberOfBytesToFlush);

.

    /// <param name="BytesToWrite"></param>

.

    unsafe public void Write(byte[] Buffer, int BytesToWrite, Int64 AtOffset)

.

        ums.Write(Buffer, 0, BytesToWrite);

.

    /// <param name="BytesToRead"></param>

.

    unsafe public int Read(byte[] Buffer, int BytesToRead, Int64 AtOffset)

.

        byte[] ba = new byte[BytesToRead];

.

        return ums.Read(Buffer, 0, BytesToRead);

.

    private static extern IntPtr MapViewOfFile(IntPtr hFileMapping, FileMapAccess dwDesiredAccess, Int32 dwFileOffsetHigh, Int32 dwFileOffsetLow, Int32 dwNumberOfBytesToMap);

.

    internal static IntPtr MapViewOfFile(IntPtr hFileMapping, FileMapAccess dwDesiredAccess, Int64 ddFileOffset, Int32 dwNumberOfBytesToMap)

.

        return MapViewOfFile(hFileMapping, dwDesiredAccess, Hi, Lo, dwNumberOfBytesToMap);

.

       Int32 dwNumberOfBytesToFlush);

.

      CreateHardLink(@"D:\someDir\test1.txt", @"D:\someDir\test.txt",IntPtr.Zero);

.

    ///   There is a test driver class at the end of this file which can be cannibalized for sample usage code.

.

    public class NamedPipeTest

.

    /// Test / demo code:

.

        NamedPipeStream stream = NamedPipeStream.Create("testpipe", NamedPipeStream.ServerMode.Bidirectional);

.

        NamedPipeStream stream = new NamedPipeStream(@"\\.\pipe\testpipe", FileAccess.ReadWrite);

.

VolumeFunctions.DefineDosDevice(0, @"Y:", @"c:\test\folder\name\");

.

    @"C:\test\folder\name");

.

   Private Sub test(ByVal VerParam As GETVERSIONOUTPARAMS, ByVal hdrive As Integer)

.

       'Issue a Command GET VERSION and test results

.

       test(VersionParams, hdrive)

.

    void Test()

.

Class Test

.

      IntPtr hMod = LoadLibraryEx(@"D:\Test\StringResource\Debug\StringResource.exe", IntPtr.Zero, LOAD_LIBRARY_AS_DATAFILE);

.

    class Test

.

        new LocaleFunctions.EnumLocalesProcExDelegate(Test.EnumLocalesProcEx);

.

    LOCALE_SSHORTESTDAYNAME1      =0x00000060,   // Shortest day name for Monday

.

    LOCALE_SSHORTESTDAYNAME2      =0x00000061,   // Shortest day name for Tuesday

.

    LOCALE_SSHORTESTDAYNAME3      =0x00000062,   // Shortest day name for Wednesday

.

    LOCALE_SSHORTESTDAYNAME4      =0x00000063,   // Shortest day name for Thursday

.

    LOCALE_SSHORTESTDAYNAME5      =0x00000064,   // Shortest day name for Friday

.

    LOCALE_SSHORTESTDAYNAME6      =0x00000065,   // Shortest day name for Saturday

.

    LOCALE_SSHORTESTDAYNAME7      =0x00000066,   // Shortest day name for Sunday

.

class Test

.

        new LocaleFunctions.EnumLocalesProcExDelegate(Test.EnumLocalesProcEx);

.

    LOCALE_SSHORTESTDAYNAME1      =0x00000060,   // Shortest day name for Monday

.

    LOCALE_SSHORTESTDAYNAME2      =0x00000061,   // Shortest day name for Tuesday

.

    LOCALE_SSHORTESTDAYNAME3      =0x00000062,   // Shortest day name for Wednesday

.

    LOCALE_SSHORTESTDAYNAME4      =0x00000063,   // Shortest day name for Thursday

.

    LOCALE_SSHORTESTDAYNAME5      =0x00000064,   // Shortest day name for Friday

.

    LOCALE_SSHORTESTDAYNAME6      =0x00000065,   // Shortest day name for Saturday

.

    LOCALE_SSHORTESTDAYNAME7      =0x00000066,   // Shortest day name for Sunday

.

   uint dwNumberOfBytesToFlush);

.

            [ValidateScript({Test-Path $_.FullName})]

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

        // has been a while since I did this, test before use

.

        // has been a while since I did this, test before use

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

    private void cmdTest_Click(object sender, EventArgs e)

.

// Untested, added during 1-pass copy & paste of windows console fuctions

.

// Untested, added during 1-pass copy & paste of windows console fuctions

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: