Announcement

Collapse
No announcement yet.

Convert C Macro to Declare Equates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert C Macro to Declare Equates

    I am trying to figure out how to port from a C Header File to a PB inc file, and have hit a snag.

    Code in C
    Code:
    #define IOCTL_INTERNAL_USB_CYCLE_PORT \
      CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS)
    which as it turns out is a macro to declare what value is used for IOCTL_INTERNAL_USB_CYCLE_PORT

    I did not know you could dynamicly declare an equates, but wondered if anyone knows what the equivalent is in PB?

    Or how I can determine the value so that I could just declare as
    Code:
    %IOCTL_INTERNAL_USB_CYCLE_PORT = <insert value>
    Thanx for any help, this one has really got me stumped.
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    If I were you I will determine the value and assign it to a constant. Otherwise, you will have to use a macro.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      From: winioctl.h
      Code:
      #ifndef _DEVIOCTL_
      #define _DEVIOCTL_
      
      // begin_ntddk begin_wdm begin_nthal begin_ntifs
      //
      // Define the various device type values.  Note that values used by Microsoft
      // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
      // by customers.
      //
      
      #define DEVICE_TYPE DWORD
      
      #define FILE_DEVICE_BEEP                0x00000001
      #define FILE_DEVICE_CD_ROM              0x00000002
      #define FILE_DEVICE_CD_ROM_FILE_SYSTEM  0x00000003
      #define FILE_DEVICE_CONTROLLER          0x00000004
      #define FILE_DEVICE_DATALINK            0x00000005
      #define FILE_DEVICE_DFS                 0x00000006
      #define FILE_DEVICE_DISK                0x00000007
      #define FILE_DEVICE_DISK_FILE_SYSTEM    0x00000008
      #define FILE_DEVICE_FILE_SYSTEM         0x00000009
      #define FILE_DEVICE_INPORT_PORT         0x0000000a
      #define FILE_DEVICE_KEYBOARD            0x0000000b
      #define FILE_DEVICE_MAILSLOT            0x0000000c
      #define FILE_DEVICE_MIDI_IN             0x0000000d
      #define FILE_DEVICE_MIDI_OUT            0x0000000e
      #define FILE_DEVICE_MOUSE               0x0000000f
      #define FILE_DEVICE_MULTI_UNC_PROVIDER  0x00000010
      #define FILE_DEVICE_NAMED_PIPE          0x00000011
      #define FILE_DEVICE_NETWORK             0x00000012
      #define FILE_DEVICE_NETWORK_BROWSER     0x00000013
      #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
      #define FILE_DEVICE_NULL                0x00000015
      #define FILE_DEVICE_PARALLEL_PORT       0x00000016
      #define FILE_DEVICE_PHYSICAL_NETCARD    0x00000017
      #define FILE_DEVICE_PRINTER             0x00000018
      #define FILE_DEVICE_SCANNER             0x00000019
      #define FILE_DEVICE_SERIAL_MOUSE_PORT   0x0000001a
      #define FILE_DEVICE_SERIAL_PORT         0x0000001b
      #define FILE_DEVICE_SCREEN              0x0000001c
      #define FILE_DEVICE_SOUND               0x0000001d
      #define FILE_DEVICE_STREAMS             0x0000001e
      #define FILE_DEVICE_TAPE                0x0000001f
      #define FILE_DEVICE_TAPE_FILE_SYSTEM    0x00000020
      #define FILE_DEVICE_TRANSPORT           0x00000021
      #define FILE_DEVICE_UNKNOWN             0x00000022
      #define FILE_DEVICE_VIDEO               0x00000023
      #define FILE_DEVICE_VIRTUAL_DISK        0x00000024
      #define FILE_DEVICE_WAVE_IN             0x00000025
      #define FILE_DEVICE_WAVE_OUT            0x00000026
      #define FILE_DEVICE_8042_PORT           0x00000027
      #define FILE_DEVICE_NETWORK_REDIRECTOR  0x00000028
      #define FILE_DEVICE_BATTERY             0x00000029
      #define FILE_DEVICE_BUS_EXTENDER        0x0000002a
      #define FILE_DEVICE_MODEM               0x0000002b
      #define FILE_DEVICE_VDM                 0x0000002c
      #define FILE_DEVICE_MASS_STORAGE        0x0000002d
      #define FILE_DEVICE_SMB                 0x0000002e
      #define FILE_DEVICE_KS                  0x0000002f
      #define FILE_DEVICE_CHANGER             0x00000030
      #define FILE_DEVICE_SMARTCARD           0x00000031
      #define FILE_DEVICE_ACPI                0x00000032
      #define FILE_DEVICE_DVD                 0x00000033
      #define FILE_DEVICE_FULLSCREEN_VIDEO    0x00000034
      #define FILE_DEVICE_DFS_FILE_SYSTEM     0x00000035
      #define FILE_DEVICE_DFS_VOLUME          0x00000036
      #define FILE_DEVICE_SERENUM             0x00000037
      #define FILE_DEVICE_TERMSRV             0x00000038
      #define FILE_DEVICE_KSEC                0x00000039
      
      
      
      
      //
      // Macro definition for defining IOCTL and FSCTL function control codes.  Note
      // that function codes 0-2047 are reserved for Microsoft Corporation, and
      // 2048-4095 are reserved for customers.
      //
      [b]
      #define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
          ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
      )
      [/b]
      //
      // Macro to extract device type out of the device io control code
      //
      #define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode)     (((DWORD)(ctrlCode & 0xffff0000)) >> 16)
      
      //
      // Define the method codes for how buffers are passed for I/O and FS controls
      //
      
      #define METHOD_BUFFERED                 0
      #define METHOD_IN_DIRECT                1
      #define METHOD_OUT_DIRECT               2
      #define METHOD_NEITHER                  3
      
      //
      // Define the access check value for any access
      //
      //
      // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
      // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
      // constants *MUST* always be in sync.
      //
      //
      // FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS.
      // The file systems, however, may add additional access checks for I/O and FS controls
      // that use this value.
      //
      
      
      #define FILE_ANY_ACCESS                 0
      #define FILE_SPECIAL_ACCESS    (FILE_ANY_ACCESS)
      #define FILE_READ_ACCESS          ( 0x0001 )    // file & pipe
      #define FILE_WRITE_ACCESS         ( 0x0002 )    // file & pipe
      
      // end_ntddk end_wdm end_nthal end_ntifs
      
      #endif // _DEVIOCTL_
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Hey Cliff,
        long time no see...

        Try this...

        Code:
        #COMPILE EXE '#Win 8.04#
        #DIM ALL
        #INCLUDE "Win32Api.inc" '#2005-01-27#
        '______________________________________________________________________________
         
        'IOCTL_INTERNAL_USB_CYCLE_PORT \
        '  CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS)
        '______________________________________________________________________________
         
        %IOCTL_INTERNAL_USB_CYCLE_PORT = &h22001F
         
        %FILE_DEVICE_UNKNOWN           = 34 
        %FILE_DEVICE_USB               = %FILE_DEVICE_UNKNOWN  
        %USB_CYCLE_PORT                = 7
        %METHOD_NEITHER                = 3
        %FILE_ANY_ACCESS               = 0
        '______________________________________________________________________________
         
        FUNCTION CTL_CODE(BYVAL dwDeviceType AS DWORD, BYVAL dwFunction AS DWORD, _
                          BYVAL dwMethod AS DWORD, BYVAL dwAccess AS DWORD) AS DWORD
         'Thank to Erwin van de Wiel
         
         SHIFT LEFT dwDeviceType, 16
         SHIFT LEFT dwAccess, 14
         SHIFT LEFT dwFunction, 2
         FUNCTION = dwDeviceType OR dwAccess OR dwFunction OR dwMethod
         
        END FUNCTION
        '______________________________________________________________________________
         
        FUNCTION PBMAIN() AS LONG
         LOCAL IOCTL_INTERNAL_USB_CYCLE_PORT AS DWORD
         
         IOCTL_INTERNAL_USB_CYCLE_PORT = CTL_CODE(%FILE_DEVICE_USB, _
                                                  %USB_CYCLE_PORT, _
                                                  %METHOD_NEITHER, _
                                                  %FILE_ANY_ACCESS)
         
         MessageBox %HWND_DESKTOP, BYCOPY "IOCTL_INTERNAL_USB_CYCLE_PORT = " & _
                                   HEX$(IOCTL_INTERNAL_USB_CYCLE_PORT), _
                                   BYCOPY "CTL_CODE", 64
         
        END FUNCTION
        '______________________________________________________________________________
        '
        Last edited by Pierre Bellisle; 14 Mar 2008, 12:13 PM.

        Comment


        • #5
          Code:
          #define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
              ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
          )
          Which - if I was careful here - can be made into FUNCTION with...

          Code:
          FUNCTION CTL_CODE (iDeviceType AS DWORD, iFunction AS DWORD, iMethod AS DWORD, iAccessAS DWORD) AS DWORD
          
           LOCAL    W AS DWORD, Z AS DWORD
          
           Z = %NULL
          
           W = iDeviceType
           SHIFT LEFT W 16
           Z = (Z OR W)
          
           w = iFunction
           SHIFT LEFT ACcess, 14 
           Z = (Z OR W) 
          
           w = iMethod
           SHIFT LEFT W, 2
           Z = (Z OR W)
          
           Z = (Z OR iMethod)
          
           FUNCTION = Z
          
          END FUNCTION

          Then again, I *do* need that vacation....

          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Thanx guys,

            You guys are life-savers. I was locating the missing header files that I did not have access to. (Apparently hidden in the DDK, and all I have is DDK documentation, but no sample to work from).

            I'll give the code a shot, and see if I can use it to move over my hurdle with USB.

            MCM...Have fun on Vacation
            Pierre...Thanx again for all your help on my "What used to be LITTLE Project"
            Engineer's Motto: If it aint broke take it apart and fix it

            "If at 1st you don't succeed... call it version 1.0"

            "Half of Programming is coding"....."The other 90% is DEBUGGING"

            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

            Comment


            • #7
              I was locating the missing header files that I did not have access to.
              I got a complete set at the Borland web site. They made some older version of their "C" compiler available free for the asking (I think you had to leave your name), and it included a directory with all "*.h" files.

              The C compiler itself I could not care less about, but having the entire set of Windows header files has been invaluable. Add Bob Scott's disk utility (here somewhere) [or anything which will search a filespec for a token] and you can find all the stuff ever mentioned in the WinAPI SDK documentation.

              No, I don't know if that offer is still available from Borland, but when you check (as I know you will), you can let everyone know.

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                And if you do get a bunch of "*.h" files and want to quickly convert to PB syntax, here's a Golden Oldie....

                Win 32: Use REGEXPR to convert ".h" and .".rc" files into PB ".bi" files with equates March 05, 2000

                .. and a "newer" version...

                File Convertor: resource.H to resource.EQU February 3 2001
                Last edited by Michael Mattias; 14 Mar 2008, 03:01 PM.
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Thanks again MCM

                  When 1st porting C header files, I had found Kev Peel's converter in the Downloads section. I was just about to add the macro code (which was where his code could not translate correctly) when I noticed, it is only the *.exe and not source code to be adapted

                  So hopefully Kev Peel is watching? Or MCM's code will lead me to a equiv solution.

                  Anyways, with a bit of tweaking, I believe I will soon have an *.inc file ready for posting.
                  Engineer's Motto: If it aint broke take it apart and fix it

                  "If at 1st you don't succeed... call it version 1.0"

                  "Half of Programming is coding"....."The other 90% is DEBUGGING"

                  "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                  Comment


                  • #10
                    A few questions

                    Piecing together both Pierre's and MCM's help, and maybe my running through docs one too many times

                    I have a few questions, since my "Grey-Matter" is starting to liquefy into a pile of "Jell-o"

                    Rather than ask separate questions, I commented the code below to all my confusions and hopefully you can point out my questions answers?

                    Code:
                    #COMPILE EXE '#Win 8.04#
                    #DIM ALL
                    #INCLUDE "Win32Api.inc" '#2005-01-27#
                    '______________________________________________________________________________
                    
                    'IOCTL_INTERNAL_USB_CYCLE_PORT CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS)     ' C Declaration in NTDDK.h
                    '______________________________________________________________________________
                    
                    %IOCTL_INTERNAL_USB_CYCLE_PORT = &h22001F                                                                     ' Value actually returned from CTL_CODE Macro
                    %FILE_DEVICE_UNKNOWN           = 34                                                                           ' Value from winioctl.h       '<--- MCM version shows 22 Hex = 34 Dec
                    %FILE_DEVICE_USB               = %FILE_DEVICE_UNKNOWN                                                         '<--- Where is this declared?
                    %USB_CYCLE_PORT                = 7                                                                            '<--- Where is this declared?
                    %METHOD_NEITHER                = 3                                                                            ' Value from winioctl.h       '<--- 3 Hex = 3 Dec
                    %FILE_ANY_ACCESS               = 0                                                                            ' Value from winioctl.h       '<--- 0 Hex = 0 Dec
                    '______________________________________________________________________________
                    
                    '*** Absolutely NO IDEA where this information is found in the docs but THANK YOU!!!!!
                    '*** EDITED THOUGHT: From MCM's comment
                    '***                     #define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
                    '***                          ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
                    '***                          )
                    '*** Deciphering the WDK docs, I now think the below comments are correct??????
                    FUNCTION CTL_CODE(BYVAL dwDeviceType AS DWORD, BYVAL dwFunction AS DWORD, BYVAL dwMethod AS DWORD, BYVAL dwAccess AS DWORD) AS DWORD
                     'Thank to Erwin van de Wiel
                     SHIFT LEFT dwDeviceType, 16                                                                                  '<--- From Sample DeviceType goes in bit 30 through 16
                     SHIFT LEFT dwAccess, 14                                                                                      '<--- From Sample Access goes in bit 15 through 14
                     SHIFT LEFT dwFunction, 2                                                                                     '<--- From Sample Access goes in bit 13 through 2
                     FUNCTION = dwDeviceType OR dwAccess OR dwFunction OR dwMethod                                                '<--- Or the values together to get number used?
                    END FUNCTION
                    '***
                    '______________________________________________________________________________
                    
                    FUNCTION PBMAIN() AS LONG
                     LOCAL IOCTL_INTERNAL_USB_CYCLE_PORT AS DWORD
                    
                     IOCTL_INTERNAL_USB_CYCLE_PORT = CTL_CODE(%FILE_DEVICE_USB, _                                                 ' DeviceType
                                                              %USB_CYCLE_PORT, _                                                  ' FUNCTION
                                                              %METHOD_NEITHER, _                                                  ' Method
                                                              %FILE_ANY_ACCESS)                                                   ' ACCESS
                    
                     MessageBox %HWND_DESKTOP, _                                                                      ' Desktop
                                   BYCOPY "IOCTL_INTERNAL_USB_CYCLE_PORT = " & _                                      ' Msg
                                   HEX$(IOCTL_INTERNAL_USB_CYCLE_PORT), _                                             ' Value Returned from CTL_CODE
                                   BYCOPY "CTL_CODE", _                                                               ' Title
                                   64                                                                                 ' Style of Msg
                    END FUNCTION
                    '______________________________________________________________________________
                    Engineer's Motto: If it aint broke take it apart and fix it

                    "If at 1st you don't succeed... call it version 1.0"

                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                    Comment


                    • #11
                      Hi Cliff,
                      Quote: - Where is this declared ?

                      Becose we are dealing with C code files,
                      some important keyword could be used to search
                      on the net. C use ".h" files and "#define" syntax declaration.
                      Using the right keywords is the harder part, then Google will do the rest.

                      So, to find "FILE_DEVICE_USB",
                      Googling <<.h #define FILE_DEVICE_USB>>
                      give often good results.

                      From there you will find
                      "#define FILE_DEVICE_USB FILE_DEVICE_UNKNOWN"
                      Now you have to find FILE_DEVICE_UNKNOWN using the same process.

                      - About CTL_CODE() function, as you already found,
                      it's in fact only a way to put many info's in a single DWORD
                      called a "system I/O control code".
                      Bit 0 to 1 for the method transfer type
                      Bit 2 to 13 for the function (Bit 13 is Custom)
                      Bit 14 to 15 for access
                      Bit 16 to 31 for the device type (Bit 31 is Common)
                      See http://msdn2.microsoft.com/en-us/library/ms795909.aspx

                      A good way to Google it is <<CTL_CODE MSDN>>,
                      It will search MSDN much better than MSDN itself.
                      You should find that it is declared in windev.h,
                      from there one must convert from C to BASIC
                      or use, already done, Erwin van de Wiel function in POFFS.

                      Bottom line, choosing rights keywords is crucial and often difficult.

                      Comment


                      • #12
                        Bottom line, choosing rights keywords is crucial and often difficult.
                        So true, so TRUE....Often I try to start as generic as I can because of programming language differences....so I am a bit guilty of not google-ing a phrase without #define before whatever it is that I am trying to look up.

                        Once I have a sample, then its a matter of hoping that the sample being worked from correctly declared. (In some cases may be DWORD, when its really a LONG, or Vice-Versa)

                        I know I have a lot to learn yet, and docs can be REALLY confusing sometimes. But at least I keep trying

                        (Ain't I a glutton for punishment? )
                        Engineer's Motto: If it aint broke take it apart and fix it

                        "If at 1st you don't succeed... call it version 1.0"

                        "Half of Programming is coding"....."The other 90% is DEBUGGING"

                        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                        Comment


                        • #13
                          Help please to translate this header on PB code?

                          Code:
                          // Copyright (C) 2004 Canopus Co., Ltd. All rights reserved. 
                          #ifndef _M4CCTRL_H_
                          #define _M4CCTRL_H_
                          
                          // --- return code
                          #define M4C_SUCCESS					0
                          #define M4C_FAILURE					1	// Unspecified error
                          #define M4C_FAIL_OPEN_FILE			2	// file open failure
                          #define M4C_FAIL_READ_FILE			3	// file read failure
                          #define M4C_FAIL_WRITE_FILE			4	// file write failure
                          #define M4C_FAIL_ALLOC_FAILURE		5	// alloc failure
                          #define M4C_FAIL_BADPARAM			6	// Invalid parameter
                          #define M4C_FAIL_UNSUPPORTED		7	// unsupported 
                          #define M4C_FAIL_DEMUXERROR			8	// incorrect stream format
                          #define M4C_END_OF_STREAM			-1	// The end of stream has been reached
                          
                          // --- convert mode
                          #define M4C_CM_FILE					0
                          #define M4C_CM_MEMORY				1
                          
                          // --- status code
                          #define M4C_SC_NOTREADY				0	// not initialized
                          #define M4C_SC_READY				1
                          #define M4C_SC_RUNNING				2
                          #define M4C_SC_STOPPING				3
                          #define M4C_SC_COMPLETE				4
                          #define M4C_SC_ERROR_STOP			5
                          
                          // --- stream type
                          #define M4C_ST_UNKNOWN				0
                          #define M4C_ST_PROGRAMSTREAM		1
                          #define M4C_ST_TRANSPORTSTREAM		2	// not supported
                          
                          // --- video type
                          #define M4C_VT_UNKNOWN				0
                          #define M4C_VT_MPEG1				1	// not supported
                          #define M4C_VT_MPEG2				2	// not supported
                          #define M4C_VT_MPEG4				4
                          
                          // --- audio type
                          #define M4C_AT_UNKNOWN				0
                          #define M4C_AT_MPEG1_LAYER1			1
                          #define M4C_AT_MPEG1_LAYER2			2
                          #define M4C_AT_MPEG1_LAYER3			3	// not supported
                          #define M4C_AT_AC3					4	// not supported
                          #define M4C_AT_LPCM					5	// not supported
                          
                          // convert status
                          typedef struct {
                          	int nStatusCode;
                          //#define M4C_SC_NOTREADY			0
                          //#define M4C_SC_READY				1
                          //#define M4C_SC_RUNNING			2
                          //#define M4C_SC_STOPPING			3
                          //#define M4C_SC_COMPLETE			4
                          //#define M4C_SC_ERROR_STOP			5
                          	LONGLONG llPosition;
                          	LONGLONG llTotalSize;
                          } M4C_STATUS, *PM4C_STATUS;
                          
                          // source media file information.
                          typedef struct {
                          	int StreamType;
                          //#define M4C_ST_UNKNOWN			0
                          //#define M4C_ST_PROGRAMSTREAM		1
                          //#define M4C_ST_TRANSPORTSTREAM	2
                          	LONGLONG llStreamLen;
                          	LONGLONG llFileLen;
                          	int VideoType;
                          //#define M4C_VT_UNKNOWN			0
                          //#define M4C_VT_MPEG1				1
                          //#define M4C_VT_MPEG2				2
                          //#define M4C_VT_MPEG4				4
                          	DWORD dwVideoWidth;
                          	DWORD dwVideoHeigh;
                          	DWORD dwVideoBitrate;
                          	float fVideoFrameRate;
                          	int AudioType;
                          //#define M4C_AT_UNKNOWN			0
                          //#define M4C_AT_MPEG1_LAYER1		1
                          //#define M4C_AT_MPEG1_LAYER2		2
                          //#define M4C_AT_MPEG1_LAYER3		3
                          //#define M4C_AT_AC3				4
                          //#define M4C_AT_LPCM				5
                          	DWORD dwAudioBitrate;
                          	DWORD dwAudioSamplingRate;
                          	DWORD dwAudioChannelNumber;
                          } MEDIA_INFO, *PMEDIA_INFO;
                          
                          typedef int (CALLBACK* M4C_CONVERT_CALLBACK)(HANDLE hHandle, LONGLONG llOffset, LPBYTE pbBuff, DWORD cbBuff, LPDWORD pcbReadBytes, DWORD dwParam);
                          typedef VOID (CALLBACK* M4C_STATUS_CALLBACK)(HANDLE hHandle, DWORD dwStatus, DWORD dwParam);
                          
                          typedef struct {
                          	int nRetCode;
                          	LPCTSTR pszMP4FileName;
                          	int nConvertMode;
                          //#define M4C_CM_FILE				0
                          //#define M4C_CM_MEMORY				1
                          	union {
                          		struct _convert_memory {
                          			DWORD dwParam;
                          			M4C_CONVERT_CALLBACK ConvertCallback;
                          			LONGLONG llSetupBytes;
                          		} ConvertMemoryInfo;
                          
                          		struct _convert_file {
                          			LPCTSTR pszConvertFileName;
                          		} ConvertFileInfo;
                          	};
                          } M4C_OPEN_PARAM;
                          
                          ///////////////////////////////////////////////////////////////////////
                          //
                          #define M4CAPI(ret) __declspec(dllexport) ret _stdcall
                          
                          #if defined(__cplusplus)
                          extern "C" {
                          #endif
                          
                          M4CAPI(HANDLE) M4C_Open(M4C_OPEN_PARAM* pOpenParam);
                          M4CAPI(int) M4C_Close(HANDLE hHandle);
                          
                          M4CAPI(int) M4C_StartConvert(HANDLE hHandle);
                          M4CAPI(int) M4C_StopConvert(HANDLE hHandle);
                          
                          M4CAPI(int) M4C_GetMediaInfo(HANDLE hHandle, PMEDIA_INFO* ppMediaInfo);
                          M4CAPI(int) M4C_GetStatus(HANDLE hHandle, PM4C_STATUS* ppStatus);
                          
                          M4CAPI(int) M4C_SetStatusCallback(HANDLE hHandle, M4C_STATUS_CALLBACK pCallback, DWORD dwParam);
                          
                          #if defined(__cplusplus)
                          }
                          #endif
                          
                          #endif	//#ifndef _M4CCTRL_H_

                          Comment

                          Working...
                          X