forked from andrewkirillov/AForge.NET
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathWin32.cs
102 lines (97 loc) · 4.25 KB
/
Win32.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// AForge Video for Windows Library
// AForge.NET framework
// http://www.aforgenet.com/framework/
//
// Copyright © AForge.NET, 2007-2011
// contacts@aforgenet.com
//
namespace AForge.Video.DirectShow.Internals
{
using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
/// <summary>
/// Some Win32 API used internally.
/// </summary>
///
internal static class Win32
{
/// <summary>
/// Supplies a pointer to an implementation of <b>IBindCtx</b> (a bind context object).
/// This object stores information about a particular moniker-binding operation.
/// </summary>
///
/// <param name="reserved">Reserved for future use; must be zero.</param>
/// <param name="ppbc">Address of <b>IBindCtx*</b> pointer variable that receives the
/// interface pointer to the new bind context object.</param>
///
/// <returns>Returns <b>S_OK</b> on success.</returns>
///
[DllImport( "ole32.dll" )]
public static extern
int CreateBindCtx( int reserved, out IBindCtx ppbc );
/// <summary>
/// Converts a string into a moniker that identifies the object named by the string.
/// </summary>
///
/// <param name="pbc">Pointer to the IBindCtx interface on the bind context object to be used in this binding operation.</param>
/// <param name="szUserName">Pointer to a zero-terminated wide character string containing the display name to be parsed. </param>
/// <param name="pchEaten">Pointer to the number of characters of szUserName that were consumed.</param>
/// <param name="ppmk">Address of <b>IMoniker*</b> pointer variable that receives the interface pointer
/// to the moniker that was built from <b>szUserName</b>.</param>
///
/// <returns>Returns <b>S_OK</b> on success.</returns>
///
[DllImport( "ole32.dll", CharSet = CharSet.Unicode )]
public static extern
int MkParseDisplayName( IBindCtx pbc, string szUserName,
ref int pchEaten, out IMoniker ppmk );
/// <summary>
/// Copy a block of memory.
/// </summary>
///
/// <param name="dst">Destination pointer.</param>
/// <param name="src">Source pointer.</param>
/// <param name="count">Memory block's length to copy.</param>
///
/// <returns>Return's the value of <b>dst</b> - pointer to destination.</returns>
///
[DllImport( "ntdll.dll", CallingConvention = CallingConvention.Cdecl )]
public static unsafe extern int memcpy(
byte* dst,
byte* src,
int count );
/// <summary>
/// Invokes a new property frame, that is, a property sheet dialog box.
/// </summary>
///
/// <param name="hwndOwner">Parent window of property sheet dialog box.</param>
/// <param name="x">Horizontal position for dialog box.</param>
/// <param name="y">Vertical position for dialog box.</param>
/// <param name="caption">Dialog box caption.</param>
/// <param name="cObjects">Number of object pointers in <b>ppUnk</b>.</param>
/// <param name="ppUnk">Pointer to the objects for property sheet.</param>
/// <param name="cPages">Number of property pages in <b>lpPageClsID</b>.</param>
/// <param name="lpPageClsID">Array of CLSIDs for each property page.</param>
/// <param name="lcid">Locale identifier for property sheet locale.</param>
/// <param name="dwReserved">Reserved.</param>
/// <param name="lpvReserved">Reserved.</param>
///
/// <returns>Returns <b>S_OK</b> on success.</returns>
///
[DllImport( "oleaut32.dll" )]
public static extern int OleCreatePropertyFrame(
IntPtr hwndOwner,
int x,
int y,
[MarshalAs( UnmanagedType.LPWStr )] string caption,
int cObjects,
[MarshalAs( UnmanagedType.Interface, ArraySubType = UnmanagedType.IUnknown )]
ref object ppUnk,
int cPages,
IntPtr lpPageClsID,
int lcid,
int dwReserved,
IntPtr lpvReserved );
}
}