예제 #1
0
        private static int AcmDriverEnumFunc(IntPtr hadid, int dwInstance, int fdwSupport)
        {
            ACMDRIVERDETAILS details = new ACMDRIVERDETAILS();

            details.cbStruct = Marshal.SizeOf(details);
            AcmNativeMethods.acmDriverDetails(hadid, ref details, 0);
            _listDetails.Add(AcmDriverInfo.FromDriverDetails(details, hadid.ToInt32()));
            return(1);
        }
예제 #2
0
        internal static AcmDriverInfo FromDriverDetails(ACMDRIVERDETAILS details, int driverId)
        {
            AcmDriverInfo info = new AcmDriverInfo();

            info.DriverId    = driverId;
            info.Flags       = details.fdwSupport;
            info.ShortName   = details.szShortName;
            info.LongName    = details.szLongName;
            info.Description = details.szFeatures;
            info._formats    = new List <AcmFormatInfo>();
            IntPtr hDrv;

            AcmNativeMethods.acmDriverOpen(out hDrv, driverId, 0);
            ACMFORMATTAGDETAILS afdt = new ACMFORMATTAGDETAILS();

            afdt.cbStruct = Marshal.SizeOf(afdt);
            IntPtr pafd = Marshal.AllocHGlobal(afdt.cbStruct);

            Marshal.StructureToPtr(afdt, pafd, false);
            AcmNativeMethods.acmFormatTagEnum(hDrv, /*ref afdt*/ pafd, info.AcmFormatTagEnumCB, (int)hDrv, 0);
            Marshal.FreeHGlobal(pafd);
            AcmNativeMethods.acmDriverClose(hDrv, 0);
            return(info);
        }
예제 #3
0
 extern static public int acmDriverDetails(IntPtr hadid, ref ACMDRIVERDETAILS details, int fdwDetails);