Example #1
0
        public static Int32 XT_Init(CallerInfo nVersion, XTInitFlags nFlags, IntPtr hMainWnd
                                    , IntPtr lpReserved)
        {
            /*
             * //you can check for flag presence in nFlags
             * if ((nFlags & XTInitFlags.XT_INIT_XWF) > 0)
             * {
             *  //called by X-Ways Forensics
             * }
             *
             * if ((nFlags & XTInitFlags.XT_INIT_BETA) > 0)
             * {
             *  //called by a Beta version of the application
             * }
             *
             * if ((nFlags & XTInitFlags.XT_INIT_QUICKCHECK) > 0)
             * {
             *  //called just to check whether the API accepts the calling application
             * }
             */

            /*
             * Importing functions:
             *  if importing functions has failed we return -1
             *  and prevent further use of the DLL
             */
            if (!ImportedMethods.Import())
            {
                return(-1);
            }

            ImportedMethods.XWFOutputMessage(String.Format("C# Dll: XT_Init called,"
                                                           + "nVersion[Version: {0}, ServiceRelease: {1}, Language: {2}], "
                                                           + "nFlags = {3}, hMainWnd = {4}"
                                                           , nVersion.version
                                                           , nVersion.ServiceRelease
                                                           , nVersion.lang
                                                           , nFlags
                                                           , hMainWnd));

            //from the docs:
            //to prevent further use of the DLL return value should be -1
            //otherwise return value should be 1
            return(1);
        }
        public static Int32 XT_Init(CallerInfo nVersion, XTInitFlags nFlags, IntPtr hMainWnd
            , IntPtr lpReserved)
        {           
            /*
            //you can check for flag presence in nFlags
            if ((nFlags & XTInitFlags.XT_INIT_XWF) > 0)
            {
                //called by X-Ways Forensics
            }

            if ((nFlags & XTInitFlags.XT_INIT_BETA) > 0)
            {
                //called by a Beta version of the application
            }

            if ((nFlags & XTInitFlags.XT_INIT_QUICKCHECK) > 0)
            {
                //called just to check whether the API accepts the calling application
            }
            */

            /*
            Importing functions:
                if importing functions has failed we return -1 
                and prevent further use of the DLL
            */
            if (!ImportedMethods.Import()) return -1;

            ImportedMethods.XWFOutputMessage(String.Format("C# Dll: XT_Init called,"
               + "nVersion[Version: {0}, ServiceRelease: {1}, Language: {2}], "
               + "nFlags = {3}, hMainWnd = {4}"
               , nVersion.version
               , nVersion.ServiceRelease
               , nVersion.lang
               , nFlags
               , hMainWnd));

            //from the docs:
            //to prevent further use of the DLL return value should be -1
            //otherwise return value should be 1
            return 1;
        }