public delegate void DIFXAPILOGCALLBACK(DIFXAPI_LOG EventType, Int32 ErrorCode, [MarshalAs(UnmanagedType.LPTStr)] string EventDescription, IntPtr CallbackContext);
Public Delegate Sub DIFXAPILOGCALLBACK(ByVal EventType As DIFXAPI_LOG, ByVal ErrorCode As Int32, <MarshalAs(UnmanagedType.LPTStr)> ByVal EventDescription As String, ByVal CallbackContext As IntPtr)
Do you know one? Please contribute it!
None.
To use this function you just need difxapi.dll of appropriate architecture from Windows Server 2008/Vista WDK. The DriverStore will be created automatically for you.
C#:
public static void DIFxAPILogCallbackFunc(DIFXAPI_LOG EventType, Int32 ErrorCode, string EventDescription, IntPtr CallbackContext)
{
switch (EventType)
{
case DIFXAPI_LOG.DIFXAPI_SUCCESS:
Console.WriteLine("SUCCESS: {0}. Error code: {1}", EventDescription, ErrorCode);
break;
case DIFXAPI_LOG.DIFXAPI_INFO:
Console.WriteLine("INFO: {0}. Error code: {1}", EventDescription, ErrorCode);
break;
case DIFXAPI_LOG.DIFXAPI_WARNING:
Console.WriteLine("WARNING: {0}. Error code: {1}", EventDescription, ErrorCode);
break;
case DIFXAPI_LOG.DIFXAPI_ERROR:
Console.WriteLine("ERROR: {0}. Error code: {1}", EventDescription, ErrorCode);
break;
}
}
VB:
Public Sub DIFxAPILogCallbackFunc(ByVal EventType As DIFXAPI_LOG, ByVal ErrorCode As Int32, ByVal EventDescription As String, ByVal CallbackContext As IntPtr)
Select Case EventType
Case DIFXAPI_LOG.DIFXAPI_SUCCESS
Console.WriteLine("SUCCESS: {0}. Error code: {1}", EventDescription, ErrorCode)
Exit Sub
Case DIFXAPI_LOG.DIFXAPI_INFO
Console.WriteLine("INFO: {0}. Error code: {1}", EventDescription, ErrorCode)
Exit Sub
Case DIFXAPI_LOG.DIFXAPI_WARNING
Console.WriteLine("WARNING: {0}. Error code: {1}", EventDescription, ErrorCode)
Exit Sub
Case DIFXAPI_LOG.DIFXAPI_ERROR
Console.WriteLine("ERROR: {0}. Error code: {1}", EventDescription, ErrorCode)
Exit Sub
End Select
End Sub