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 "NativeMethods" in [All]

ntdsapi

.

    internal static partial class NativeMethods

.

         if (res == null || res.Length == 0 || res[0].status != NativeMethods.DS_NAME_ERROR.DS_NAME_NO_ERROR)

kernel32

.

internal static class UnsafeNativeMethods {

.

IntPtr fptr = UnsafeNativeMethods.GetProcAddress( hModule, "DllRegisterServer" );

.

        NativeMethods.SYSTEM_INFO

.

        NativeMethods.GetSystemInfo(out info);

.

            // Consumer of the NativeMethods class shown below

.

            NativeMethods oMemoryInfo = new NativeMethods();

.

    public class NativeMethods {

.

           public NativeMethods() {

.

            // Consumer of the NativeMethods class shown below

.

            NativeMethods oMemoryInfo = new NativeMethods();

.

    public class NativeMethods {

.

           public NativeMethods() {

.

     if (!NativeMethods.IsWow64Process(processHandle, out retVal))

.

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = NativeMethods.NCBNAMSZ)]

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NativeMethods.NCBNAMSZ)]

.

    internal static class NativeMethods

.

        if (!NativeMethods.RemoveDirectory(normalizedPath))

powrprof

.

        NativeMethods.PowerDuplicateScheme(IntPtr.Zero, ref VISA_PM_BASIC_SCHEMES.BALANCED, ref RetrPointer);

.

        uint set = NativeMethods.PowerWriteFriendlyName(IntPtr.Zero, ref powerPlanId, IntPtr.Zero, IntPtr.Zero, name, BufferSize);

dtl

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_DRIVER_CLOSE(driverId, timeOut));

.

        UnsafeNativeMethods.DTL_UNINIT(driverId);

.

        return (UnsafeNativeMethods.DTL_INIT(tableSize));

.

        UnsafeNativeMethods.DTL_ERROR_S(dtlSts, msg, buffSize);

.

        return (UnsafeNativeMethods.DTL_DRIVER_OPEN(driverId, driverName, timeOut));

.

        return (UnsafeNativeMethods.DTL_VERSION(versionText, maxCharsToReturn));

.

        return (UnsafeNativeMethods.DTL_C_DEFINE(ref nameId, defString));

.

        return (UnsafeNativeMethods.DTL_UNDEF(nameId));

.

        return (UnsafeNativeMethods.DTL_READ_W(nameId, readData, ref ioStat, timeOut));

.

        return (UnsafeNativeMethods.DTL_WRITE_W(nameId, writeData, ref ioStat, timeOut));

.

    internal static class UnsafeNativeMethods

dhcpsapi

.

    NativeMethods.DHCP_BINARY_DATA uid = new NativeMethods.DHCP_BINARY_DATA();

.

    NativeMethods.DHCP_IP_RESERVATION_V4 reservation = new NativeMethods.DHCP_IP_RESERVATION_V4();

.

    reservation.bAllowedClientTypes = NativeMethods.DHCP_CLIENT_TYPE.CLIENT_TYPE_BOTH;

.

    NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5 element = new NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5();

.

    element.ElementType = NativeMethods.DHCP_SUBNET_ELEMENT_TYPE.DhcpReservedIps;

.

        uint result = NativeMethods.DhcpAddSubnetElementV5(server.Address, subnet, ref element);

.

        if (result != NativeMethods.ERROR_SUCCESS)

.

        result = NativeMethods.DhcpEnumSubnetElementsV5(server.Address, subnet, NativeMethods.DHCP_SUBNET_ELEMENT_TYPE.DhcpReservedIps, ref resumeHandle, 1000, ref enumInfo, ref read, ref total);

.

        if (result == NativeMethods.ERROR_NO_MORE_ITEMS) break;

.

        if ((result != NativeMethods.ERROR_SUCCESS && result != NativeMethods.ERROR_MORE_DATA) || enumInfo == IntPtr.Zero)

.

        NativeMethods.DHCP_SUBNET_ELEMENT_INFO_ARRAY_V5 data;

.

        data = (NativeMethods.DHCP_SUBNET_ELEMENT_INFO_ARRAY_V5) Marshal.PtrToStructure(enumInfo, typeof(NativeMethods.DHCP_SUBNET_ELEMENT_INFO_ARRAY_V5));

.

            IntPtr p = (IntPtr) ((int) data.Elements + (i * Marshal.SizeOf(typeof(NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5))));

.

            NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5 element;

.

            element = (NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5) Marshal.PtrToStructure(p, typeof(NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5));

.

            if (element.ElementType == NativeMethods.DHCP_SUBNET_ELEMENT_TYPE.DhcpReservedIps) {

.

                NativeMethods.DHCP_IP_RESERVATION_V4 reservation;

.

                reservation = (NativeMethods.DHCP_IP_RESERVATION_V4) Marshal.PtrToStructure(element.ElementValue, typeof(NativeMethods.DHCP_IP_RESERVATION_V4));

.

    while (result == NativeMethods.ERROR_MORE_DATA);

.

    NativeMethods.DHCP_BINARY_DATA uid = new NativeMethods.DHCP_BINARY_DATA();

.

    NativeMethods.DHCP_IP_RESERVATION_V4 reservation = new NativeMethods.DHCP_IP_RESERVATION_V4();

.

    reservation.bAllowedClientTypes = NativeMethods.DHCP_CLIENT_TYPE.CLIENT_TYPE_BOTH;

.

    NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5 element = new NativeMethods.DHCP_SUBNET_ELEMENT_DATA_V5();

.

    element.ElementType = NativeMethods.DHCP_SUBNET_ELEMENT_TYPE.DhcpReservedIps;

.

        uint result = NativeMethods.DhcpRemoveSubnetElementV5(server.Address, subnet, ref element, NativeMethods.DHCP_FORCE_FLAG.DhcpFullForce);

.

        if (result != NativeMethods.ERROR_SUCCESS)

coredll

.

        IntPtr file = NativeMethods.CreateFile("ACS1:", 0, 0, IntPtr.Zero, ECreationDisposition.OpenExisting, 0, IntPtr.Zero);

.

        if (!NativeMethods.DeviceIoControl(file, controlCode, inBuffer, inSize, outBuffer, outSize, ref bytesReturned, IntPtr.Zero))

.

        NativeMethods.CloseHandle(file);

comctl32

.

    internal static partial class NativeMethods

.

      public static ImageListDrawColor None = new ImageListDrawColor(NativeMethods.CLR_NONE);

.

      public static ImageListDrawColor Default = new ImageListDrawColor(NativeMethods.CLR_DEFAULT);

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

.

         if (!NativeMethods.ImageList_DrawEx(imageList.Handle, index, hg, bounds.X, bounds.Y, bounds.Width, bounds.Height, bgColor, fgColor, style | (NativeMethods.ImageListDrawingStyle)(overlayImageIndex << 8)))

.

      if (!NativeMethods.ImageList_SetOverlayImage(imageList.Handle, imageIndex, overlayIndex))

.

        NativeMethods.ImageList_SetOverlayImage(((ImageList)sender).Handle, vals[i], i + 1);

.

    internal static partial class NativeMethods

.

      public static ImageListDrawColor None = new ImageListDrawColor(NativeMethods.CLR_NONE);

.

      public static ImageListDrawColor Default = new ImageListDrawColor(NativeMethods.CLR_DEFAULT);

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

.

         if (!NativeMethods.ImageList_DrawEx(imageList.Handle, index, hg, bounds.X, bounds.Y, bounds.Width, bounds.Height, bgColor, fgColor, style | (NativeMethods.ImageListDrawingStyle)(overlayImageIndex << 8)))

.

      if (!NativeMethods.ImageList_SetOverlayImage(imageList.Handle, imageIndex, overlayIndex))

.

        NativeMethods.ImageList_SetOverlayImage(((ImageList)sender).Handle, vals[i], i + 1);

fbwflib

.

NativeMethods.FbwfCacheThresholdNotification((uint)100, _manualResetEvent.SafeWaitHandle);

.

NativeMethods.FbwfGetVolumeList(true, pBuffer, ref size);

.

   NativeMethods.FbwfIsFilterEnabled(ref currentSession, ref nextSession);

misc

.

One question: The APIs here appear to be machanically created from some other source - from things like "System.Windows.Forms.NativeMethods"? The functions are present, but not the structures and data types used in the params. Any plans to do a mechanical dump of the structures as well? The real magic of marshalling is getting the param types set up correctly, which for structures can be quite a pain.

.

I would love to have a downloadable solution that has all of the signatures, structures, consts, etc., like Microsoft's SafeNativeMethods and UnsafeNativeMethods. -- Omer van Kloeten

user32

.

Public Class NativeMethods

.

            if(!NativeMethods.GetKeyboardState(keys)){

.

    internal static class NativeMethods {

.

    Me.Text = "Caps:" & NativeMethods.CapsLockState.ToString

.

    Me.Text &= ", Num: " & NativeMethods.NumLockState.ToString

.

    Me.Text &= ", Scroll: " & NativeMethods.ScrollLockState.ToString

.

Public Class NativeMethods

.

'NativeMethods.GetParentSafe(IntPtr)' calls into 'Marshal.GetLastWin32Error()' which has a LinkDemand. By making this call, 'Marshal.GetLastWin32Error()' is indirectly exposed to user code. Review the following protection:

.

->'NativeMethods.GetParentSafe(IntPtr)'

.

->'NativeMethods.GetParentSafe(IntPtr)'

.

        return SafeNativeMethods.CloseWindowStation(handle);

.

internal static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, [In, Out] ref NativeMethods.RECT rect, [MarshalAs(UnmanagedType.U4)] int cPoints);

.

internal static class UnsafeNativeMethods

.

   internal static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, [In, Out] ref NativeMethods.RECT rect, [MarshalAs(UnmanagedType.U4)] int cPoints);

.

     NativeMethods.RECT ir = rectangle;

.

static extern TODO NativeMethods(TODO);

.

Declare Function NativeMethods Lib "user32.dll" (TODO) As TODO

.
Documentation
[NativeMethods] on MSDN
.

        return SafeNativeMethods.CloseWindowStation(handle);

Interfaces

.

    void AddPlace ( [In, MarshalAs ( UnmanagedType.Interface )] IShellItem psi, NativeMethods.FDAP fdap );

.

    void AddPlace ( [In, MarshalAs ( UnmanagedType.Interface )] IShellItem psi, NativeMethods.FDAP fdap );

.

    void RegisterFolder ( [In] ref Guid rfid, [In] ref NativeMethods.KNOWNFOLDER_DEFINITION pKFD );

.

                  [In] NativeMethods.FFFP_MODE mode,

.

    void RegisterFolder ( [In] ref Guid rfid, [In] ref NativeMethods.KNOWNFOLDER_DEFINITION pKFD );

.

                  [In] NativeMethods.FFFP_MODE mode,

.

    void GetAt ( [In] uint iProp, out NativeMethods.PROPERTYKEY pkey );

.

    void GetValue ( [In] ref NativeMethods.PROPERTYKEY key, out object pv );

.

    void SetValue ( [In] ref NativeMethods.PROPERTYKEY key, [In] ref object pv );

.

    Sub GetAt(ByVal iProp As UInt32, ByRef pkey As NativeMethods.PROPERTYKEY)

.

    Sub GetValue(ByRef key As NativeMethods.PROPERTYKEY, ByRef pv As Object)

.

    Sub SetValue(ByRef key As NativeMethods.PROPERTYKEY, ByRef pv As Object)

.

    void GetPropertyDescriptionList ( [In] ref NativeMethods.PROPERTYKEY keyType, [In] ref Guid riid, out IntPtr ppv );

.

    void GetAttributes ( [In] NativeMethods.SIATTRIBFLAGS dwAttribFlags, [In] uint sfgaoMask, out uint psfgaoAttribs );

.

        , out UnsafeNativeMethods.WIN32_FIND_DATAA pfd, UnsafeNativeMethods.SLGP_FLAGS fFlags);

.

    void Resolve(IntPtr hwnd, UnsafeNativeMethods.SLR_FLAGS fFlags);

.

    void GetPath([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, out UnsafeNativeMethods.WIN32_FIND_DATAW pfd, UnsafeNativeMethods.SLGP_FLAGS fFlags);

.

    void Resolve(IntPtr hwnd, UnsafeNativeMethods.SLR_FLAGS fFlags);

shell32

.

int result = NativeMethods.PathCleanupSpec(folderSpec, fileSpec);

.

bool result = NativeMethods.PathYetAnotherMakeUniqueName(buffer, folderSpec, null, fileSpec);

.

    If SafeNativeMethods.SHParseDisplayName(folderPath, IntPtr.Zero, pidlFolder, 0, 0) = 0 Then

.

    If SafeNativeMethods.SHParseDisplayName(Path.Combine(_folderPath, fileName), IntPtr.Zero, pidl, 0, 0) = 0 Then

.

    SafeNativeMethods.SHOpenFolderAndSelectItems(pidlFolder, pidl.Length, pidl, 0)

.

  Friend NotInheritable Class SafeNativeMethods

advapi32

.

        var locallyUniqueIdentifier = new NativeMethods.LUID();

.

        if (NativeMethods.LookupPrivilegeValue(null, securityEntityValue, ref locallyUniqueIdentifier))

.

           var TOKEN_PRIVILEGES = new NativeMethods.TOKEN_PRIVILEGES();

.

           TOKEN_PRIVILEGES.Attributes = NativeMethods.SE_PRIVILEGE_ENABLED;

.

          var currentProcess = NativeMethods.GetCurrentProcess();

.

          if (NativeMethods.OpenProcessToken(currentProcess, NativeMethods.TOKEN_ADJUST_PRIVILEGES | NativeMethods.TOKEN_QUERY, out tokenHandle))

.

             if (NativeMethods.AdjustTokenPrivileges(tokenHandle, false,

.

            if (lastError == NativeMethods.ERROR_NOT_ALL_ASSIGNED)

.

             NativeMethods.CloseHandle(tokenHandle);

.

   internal static class NativeMethods

.

        hEventLog = NativeMethods.OpenEventLog(IntPtr.Zero, logName);

.

        Boolean success = NativeMethods.ClearEventLog(hEventLog, savePath);

.

            NativeMethods.CloseEventLog(hEventLog);

.

        uint length = UnsafeNativeMethods.GetLengthSid(pSid);

.

        UnsafeNativeMethods.CopySid(length, bytes, pSid);

.

      NativeMethods.CreateWellKnownSid(wellKnownSidType, domainSid, pSid, ref cbSid);

.

      if (NativeMethods.CreateWellKnownSid(wellKnownSidType, domainSid, pSid, ref cbSid))

.

      NativeMethods.ConvertSidToStringSid(pSid, out sidString);

.

        NativeMethods.CERT_CREDENTIAL_INFO certInfo =

.

            new NativeMethods.CERT_CREDENTIAL_INFO();

.

        certInfo.cbSize = (uint)Marshal.SizeOf(typeof(NativeMethods.CERT_CREDENTIAL_INFO));

.

            NativeMethods.CredMarshalCredential(NativeMethods.CertCredential,

.

            NativeMethods.CredFree(marshaledCredential);

.

    backlightHandle = NativeMethods.SetPowerRequirement("BKL1:", DevicePowerState.D0, 1, null, 0);

.

    NativeMethods.ReleasePowerRequirement(backlightHandle);

ntdll

.

    NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION

.

        result = (UInt32)NativeMethods.NtQuerySystemInformation(NativeMethods.SYSTEM_INFORMATION_CLASS.SystemMemoryListInformation, buff, result, out returnSize);

.

            throw new System.ComponentModel.Win32Exception(((NativeMethods.NtStatus)result).ToString());

.

        if (NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION_SIZE == 0)

.

            NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION_SIZE = returnSize;

.

        MemoryList = (NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION)Marshal.PtrToStructure(buff, typeof(NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION));

.

    NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION

.

        result = (UInt32)NativeMethods.NtQuerySystemInformation(NativeMethods.SYSTEM_INFORMATION_CLASS.SystemMemoryListInformation, buff, result, out returnSize);

.

            throw new System.ComponentModel.Win32Exception(((NativeMethods.NtStatus)result).ToString());

.

        MemoryList = (NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION)Marshal.PtrToStructure(buff, typeof(NativeMethods.SYSTEM_MEMORY_LIST_INFORMATION));

shlwapi

.

$nativeMethods = Add-Type -PassThru -Name "Win32Api" -MemberDefinition @"

.

$nativeMethods::StrFormatByteSize( 1024, $sb, $sb.Capacity ) | Out-Null

.

    NativeMethods.StrFromTimeInterval(sb, (uint) sb.Capacity, (uint) timeSpan.TotalMilliseconds, digits);

netapi32

.

     DWORD rc = NativeMethods.DsGetDcNext(

.

         NativeMethods.NetApiBufferFree(pDnsHostName);

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


 
Access PInvoke.net directly from VS: