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]

query

.

The liquor soon mounted into their heads, as it generally does even with the arrantest topers newly landed from sea, and they began capering about most obstreperously.

userenv

.

            StringBuilder testData = new StringBuilder("");

.

                if ((testData.Length > 0) && (*current == 0) && (current != start)) {

.

                String data = testData.ToString();

.

                testData.Length = 0;

.

                testData.Append((char)*current);

.

    Sid oSid = new Sid(@"csharp\test");

mapi32

.

Capitalise on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

icmp

.

    // != 0 can still be dest unreachable, test status further down too

winfax

.

Capitalise on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.

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

.

    class Test {

.

        string lpFormat, StringBuilder lpDateStr, int cchDate

.

Tested extensively here http://stackoverflow.com/questions/17918266/winapi-getlasterror-vs-marshal-getlastwin32error

.

    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

.

    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

.

   Public Sub test1()

.

namespace Test

.

   out uint lpNumberOfBytesTransferred, bool bWait);

.

Private Shared Function GetOverlappedResult(ByVal hFile As IntPtr, <[In]()> ByRef lpOverlapped As System.Threading.NativeOverlapped, ByRef lpNumberOfBytesTransferred As UInteger, ByVal bWait As Boolean) As Boolean

.

    public static bool WriteUSB(IntPtr hDevice, byte[] pBuffer, uint dwBytesToWrite, ref uint lpNumberOfBytesWritten)

.

        if (!WriteFile(hDevice, pBuffer, dwBytesToWrite, ref lpNumberOfBytesWritten, ref lpOverlapped) &&

.

       uint res = GetPrivateProfileString("AppName", "KeyName", "", sb, (uint)sb.Capacity, @"c:\test.ini");

.

    res = GetPrivateProfileString("AppName", "KeyName", "", sb, sb.Capacity, "c:\test.ini")

.

for load function "Test" from DLL "MyDLL.dll" we do this codes:

.

typedef HRESULT (STDAPICALLTYPE * LPFNTEST) (void);

.

LPFNTEST _pfnTest;

.

_pfnTest = (LPFNTEST)::GetProcAddress(hDLL, "Test");

.

'/// KSG Comments: This code has only been tested for .NET 2.x

.

    void Test()

.

'This project references Microsoft.VisualStudio.QualityTools.UnitTestFramework

.

'TempFileTest.vb

.

Imports Microsoft.VisualStudio.TestTools.UnitTesting

.

'''This is a test class for TempFileTest and is intended

.

'''to contain all TempFileTest Unit Tests

.

<TestClass()> _

.

Public Class TempFileTest

.

    Private testContextInstance As TestContext

.

    '''Gets or sets the test context which provides

.

    '''information about and functionality for the current test run.

.

    Public Property TestContext() As TestContext

.

        Return testContextInstance

.

    Set(ByVal value As TestContext)

.

        testContextInstance = value

.

    '''A test for Create

.

    <TestMethod()> _

.

    Public Sub CreateTest()

.

The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test.

.

The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test.

.

   Private Sub test()

.

Process - A handle to the process to be tested. The handle must have the PROCESS_QUERY_INFORMATION access right.

.

Job - A handle to the job. If this parameter is NULL, the function tests if the process is running under any job.If this parameter is not NULL, the handle must have the JOB_OBJECT_QUERY access right.

.

   uint nNumberOfBytesToLockLow, uint nNumberOfBytesToLockHigh,

.

   uint nNumberOfBytesToLockLow, uint nNumberOfBytesToLockHigh,

.

    internal static int TestFindResource()

.

   UIntPtr dwNumberOfBytesToMap, IntPtr lpBaseAddress);

.

    long TotalBytesTransferred,

.

    long StreamBytesTransferred,

.

    long TotalBytesTransferred,

.

    long StreamBytesTransferred,

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


 
Access PInvoke.net directly from VS: