// Cardreader. h: Main header file for the cardreader DLL
//
# If! Defined (afx_cardreader_h1_929a1de0_0de7_4a6a_8f23_b3e1d93e2cad1_encoded _)
# Define afx_cardreader_h0000929a1de0_0de7_4a6a_8f23_b3e1d93e2cad1_encoded _
# If _ msc_ver> 1000
# Pragma once
# Endif // _ msc_ver> 1000
# Ifndef _ afxwin_h __
# Error include 'stdafx. H' before including this file for PCH
# Endif
# Include "resource. H" // Main Symbols
//////////////////////////////////////// /////////////////////////////////////
// Ccardreaderapp
// See cardreader. cpp for the implementation of this class
//
Class ccardreaderapp: Public cwinapp
{
Public:
Ccardreaderapp ();
// Overrides
// Classwizard generated virtual function overrides
// {Afx_virtual (ccardreaderapp)
//} Afx_virtual
// {Afx_msg (ccardreaderapp)
// Note-The classwizard will add and remove member functions here.
// Do not edit what you see in these blocks of generated code!
//} Afx_msg
Declare_message_map ()
};
//////////////////////////////////////// /////////////////////////////////////
// {Afx_insert_location }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.
# Endif //! Defined (afx_cardreader_h1_929a1de0_0de7_4a6a_8f23_b3e1d93e2cad1_encoded _)
Cardreadertest. h
// Cardreadertest. h: interface for the ccardreadertest class.
//
//////////////////////////////////////// //////////////////////////////
# If! Defined (afx_cardreadertest_h1_159d5d0a_0724_4887_8e7f_d29e285865ae1_encoded _)
# Define afx_cardreadertest_h0000159d5d0a_0724_4887_8e7f_d29e285865ae00000000ded _
# If _ msc_ver> 1000
# Pragma once
# Endif // _ msc_ver> 1000
# Include "testbase. H"
# Define modulename "cardreader"
# Define logpath ". \ log \ cardreader. log"
# Define source_file ". \ TMP \ cardreader. SRC"
# Define des_file "TEMP $ test"
Typedef DWORD (* foxmarklib_removenode) (lptstr parentpath, lptstr childpath, lptstr filepath );
Typedef DWORD (* foxmarklib_createfile_root) (lptstr rootname, lptstr filepath );
Typedef DWORD (* foxmarklib_addnode) (lptstr parentpath, lptstr newnodename, lptstr filepath );
Typedef DWORD (* foxmarklib_addnodeandvalue) (lptstr parentpath, lptstr newnode, lptstr nodevalue, lptstr filepath );
Typedef DWORD (* foxmarklib_changevalue) (lptstr nodepath, lptstr newvalue, lptstr filepath );
Typedef DWORD (* foxmarklib_removenode) (lptstr parentpath, lptstr childpath, lptstr filepath );
Typedef DWORD (* foxmarklib_readnodevalue) (lptstr nodepath, lptstr filepath, lptstr pbbuffer );
Typedef DWORD (* foxmarklib_getportval) (word wportaddr, pdword pdwportval, byte bsize );
Typedef DWORD (* foxmarklib_setportval) (word wportaddr, DWORD dwportval, byte bsize );
Typedef DWORD (* foxmarklib_getphysmemval) (DWORD dwphysaddr, lptstr pbbuffer, int nlength );
Typedef DWORD (* foxmarklib_setnodeattribute) (lptstr nodepath, lptstr attributename, lptstr attributevalue, lptstr filepath );
Typedef DWORD (* foxmarklib_findchildnum) (lptstr nodepath, lptstr filepath, long * pchildnum );
Typedef DWORD (* foxmarklib_removeallnode) (lptstr avlpath, lptstr filepath );
Typedef DWORD (* foxmarklib_removeavl) (lptstr lunitname, int navlindex, lptstr filepath );
Typedef DWORD (* foxmarklib_loadxml) (lptstr filepath );
Typedef handle (* foxmarklib_getdiskhandle) (INT num );
Typedef Enum
{
// Test Unit
Filerwc = 0x1,
} Testitem;
Typedef Enum
{
Testpass = 0,
Testfail = 1,
Teststop = 2,
} Returnvalue;
Typedef Enum
{
Error_create_xml_parameter = 0x00160001,
Error_read_xml_file = 0x00160002,
Error_create_source_file = 0x00160003,
Error_make_srcfile_md5 = 0x00160004,
Error_check_srcfile_md5 = 0x00160005,
Error_card_write_protect = 0x00160006,
Error_test_card_bad = 0x00160007,
Error_test_card_num = 0x00160008,
Error_card_read_test = 0x00160009,
Error_card_read_compare = 0x00160010,
Error _ partition_num_mismatch = 0x00160011,
} Errorcode;
Class ccardreadertest: Public ctestbase
{
Public:
Tchar gmodulepath [256];
Public:
Ccardreadertest ();
Virtual ~ Ccardreadertest ();
Virtual DWORD test (INT itestmask, clistctrl * List, DWORD dwindex, int icyclemode, int icyclenum, int ihalt, int ipara );
Virtual DWORD getmoduleinfo (pmoduleinfo pmoudleinfo );
Virtual DWORD displaywindow (int x, int y, int width, int high, cwnd * pparent );
Virtual DWORD outputparameters (INT itestmask, clistctrl * List, DWORD dwindex, DWORD * dwtestreturn );
Int getremovablepartitionnum (void );
DWORD getunit1param ();
Bool fileexist (const char * pszfilename );
DWORD initteststatus ();
DWORD filerwctest ();
DWORD createrandomfile (INT size );
Public:
Tchar xmlpath [max_path];
Bool blibready;
Hinstance hfoxlibdll;
Tchar rootpath [maxlen];
Tchar getlibpath [maxlen];
Tchar faildescription [256];
Unsigned char md5_str [40];
};
# Endif //! Defined (afx_cardreadertest_h1_159d5d0a_0724_4887_8e7f_d29e285865ae1_encoded _)
/////////// Fileversion. h
// Fileversion. h: interface for the cfileversion class.
// By Lichengyi2002@msn.com
//////////////////////////////////////// //////////////////////////////
# Ifndef _ fileversion_h _
# DEFINE _ fileversion_h _
# If _ msc_ver> = 1000
# Pragma once
# Endif // _ msc_ver >=1000
Class cfileversion
{
// Construction
Public:
Cfileversion ();
// Operations
Public:
Bool open (lpctstr lpszmodulename );
Void close ();
Cstring queryvalue (lpctstr lpszvaluename, DWORD dwlangcharset = 0 );
Cstring getfiledescription () {return queryvalue (_ T ("filedescription "));};
Cstring getfileversion () {return queryvalue (_ T ("fileversion "));};
Cstring getinternalname () {return queryvalue (_ T ("internalname "));};
Cstring getcompanyname () {return queryvalue (_ T ("companyName "));};
Cstring getlegalcopyright () {return queryvalue (_ T ("legalcopyright "));};
Cstring getoriginalfilename () {return queryvalue (_ T ("originalfilename "));};
Cstring getproductname () {return queryvalue (_ T ("productname "));};
Cstring getproductversion () {return queryvalue (_ T ("productversion "));};
Bool getfixedinfo (vs_fixedfileinfo & vsffi );
Cstring getfixedfileversion ();
Cstring getfixedproductversion ();
// Attributes
Protected:
Lpbyte m_lpversiondata;
DWORD m_dwlangcharset;
// Implementation
Public:
~ Cfileversion ();
};
# Endif/_ fileversion_h _
Globedef. h
/*
File Name: globaldef. h
Description: declare global define in foxburnin
Author: Dragon
Data: 2005-9-22
*/
# Define wm_error wm_app + 100
# Define maxlen 256
# Define maxitem 64
# Define appversion "foxmark 1.0.0.1"
Typedef Enum
{
Pretest = 0,
Runin = 1,
None =-1,
} Testtype;
Typedef Enum
{
Countmode = 0,
Timemode = 1,
} Runmode;
Typedef Enum
{
Factorymode = 0,
Labmode = 1,
} Envmode;
Typedef Enum
{
Testing = 0,
Pass = 1,
Fail = 2,
Skip = 3,
Waiting = 4,
Stop = 5,
} Testresult;
Typedef Enum
{
Succauto = 0x00000000,
Error_unknow = 0x00000001,
Error_open_file = 0x00000002,
Error_close_file = 0x00000003,
Error_display_window = 0x00000004,
Error_load_library = 0x00000005,
Error_stop_test = 0 xffffffff,
} Comm_errorcode;
Typedef Enum
{
Starttest = 0,
Endtest = 1,
} Teststatus;
Typedef struct _ subitem
{
// Cstring szsubitemname;
Tchar szsubitemname [maxitem];
Int itesttype;
} Subitem, * psubitem;
Typedef struct _ moduleinfo
{
Tchar szmodulename [maxitem];
Int itestitemcount;
Subitem ssubitem [maxitem];
Tchar sziconpath [maxitem];
} Moduleinfo, * pmoduleinfo;
Typedef struct _ subitemresult
{
Tchar szsubitemname [maxitem];
Int itestresult;
Int icurrenttime; // current test times
Int ifailtime; // have already fail times
DWORD dwerrorcode;
Tchar szstarttime [maxitem];
Tchar szendtime [maxitem];
Tchar szdescription [maxitem];
} Subitemresult, * psubitemresult;
Typedef struct _ testresult
{
Tchar szmodulename [maxitem];
Int itestitemcount;
Subitemresult subitem [maxitem];
} Testresult, * ptestresult;
//// // Md5.h
/*
File: md5.h
Describe: the header file of md5.cpp
Modify: liugang (Gary)
Date: 07/02/2004
*/
# Ifndef _ md5_algorithm _
# DEFINE _ md5_algorithm _
# Define file_error_sharing_violation "00000000000000000000000000000000"
# Define file_error_lock_violation "11111111111111111111111111111111"
Typedef struct _ md5_ctx
{
Ulong State [4];
Ulong count [2];
Uchar buffer [64];
} Md5_ctx, * pm5_ctx;
# Define S11 7
# Define S12 12
# Define S13 17
# Define S14 22
# Define S21 5
# Define s22 9
# Define S23 14
# Define S24 20
# Define s31 4
# Define s32 11
# Define s33 16
# Define s34 23
# Define s41 6
# Define S42 10
# Define s43 15
# Define s44 21
// F, G, H and I are basic MD5 functions.
# Define T (x, y, z) (x) & (y) | ((~ X) & (z )))
# Define g (x, y, z) (x) & (z) | (y )&(~ Z )))
# Define h (x, y, z) (x) ^ (y) ^ (z ))
# Define I (x, y, z) (y) ^ (x) | (~ Z )))
// Rotates x left N bits
# Define rotate_left (x, n) (x) <(N) | (x)> (32-(N ))))
// Ff, GG, HH, and II transformations for Rounds 1, 2, 3, and 4.
// Rotation is separate from addition to prevent recomputation.
# Define ff (a, B, c, d, X, S, AC ){\
(A) + = T (B), (c), (d) + (x) + (ulong) (AC );\
(A) = rotate_left (a), (s ));\
(A) + = (B );\
}
# Define Gg (a, B, c, d, X, S, AC ){\
(A) + = g (B), (c), (d) + (x) + (ulong) (AC );\
(A) = rotate_left (a), (s ));\
(A) + = (B );\
}
# Define HH (a, B, c, d, X, S, AC ){\
(A) + = H (B), (c), (d) + (x) + (ulong) (AC );\
(A) = rotate_left (a), (s ));\
(A) + = (B );\
}
# Define II (a, B, c, d, X, S, AC ){\
(A) + = I (B), (c), (d) + (x) + (ulong) (AC );\
(A) = rotate_left (a), (s ));\
(A) + = (B );\
}
Void md5init (pm5_ctx pm5ctx );
Void md5update (maid, puchar message, ulong ulbytes );
Uchar * md5final (uchar * digest, pm5_ctx pm5ctx );
Uchar * md5makestring (uchar * message, uchar * Digest );
Uchar * md5makedata (lpvoid message, ulong ulbytes, uchar * Digest );
Uchar * md5makefile (lpctstr lpszfilename, uchar * Digest );
Bool md5checkfile (lpctstr lpszfilename, uchar * Digest );
Bool md5makefolder (maid, maid = NULL );
Bool md5checkfolder (lpctstr lpszlogfile = NULL );
# Endif
//// // Resource. h
// {No_dependencies }}
// Microsoft developer studio generated include file.
// Used by cardreader. RC
//
# Define idd_dialog1 2000
# Define idc_static_status 2001
# Define idc_static_action 2002
# Define idc_static_src 2003
# Define idc_static_srcpath 2004
# Define idc_static_dec 2005
# Define idc_static_despath 2006
# Define idc_progress_filerwc 2007
// Next default values for new objects
//
# Ifdef apstudio_invoked
# Ifndef apstudio_readonly_symbols
# DEFINE _ aps_next_resource_value 2001
# DEFINE _ aps_next_command_value 32771
# DEFINE _ aps_next_control_value 2009
# DEFINE _ aps_next_symed_value 2000
# Endif
# Endif
/// // Testbase. h
# If! Defined (afx_testbase_hda-43741379_4538_4612_95dd_8516143c64a41_included _)
# Define afx_testbase_h1_43741379_4538_4612_95dd_8516143c64a41_included _
# If _ msc_ver> 1000
# Pragma once
# Endif // _ msc_ver> 1000
# Include "globaldef. H"
# Define line "======================================== ========================================================== ========================================================== =======\ N"
# Define iconpath ". \ icon \\"
Class ctestbase: Public cdialog
{
Public:
Ctestbase ();
Virtual ~ Ctestbase ();
Virtual DWORD displaywindow (int x, int y, int width, int high, cwnd * pparent );
Virtual DWORD outputparameters (INT itestmask, clistctrl * List, DWORD dwindex, DWORD * dwtestreturn );
Virtual DWORD test (INT itestmask, clistctrl * List, DWORD dwindex, int icyclemode, int icyclenum, int ihalt, int ipara );
Virtual DWORD getmoduleinfo (pmoduleinfo pmoudleinfo );
Virtual DWORD modifyavlforunit (INT itestmask, int iavlindex, int imodifymode );
Virtual void stoptest ();
Void inittestresult (lpcstr lpmodulename, int itestmask );
Bool updatetestresult (INT isubmoduleindex, testresult, lpcstr lperrormessage, teststatus status, int icurrenttime, int ifailtime, DWORD dwerrorcode = 0x00000000 );
Testresult gettestresult ();
Void displaytestresult (clistctrl * List, DWORD dwindex );
Bool senderrormessage ();
Bool writelogfile (lpcstr lpfilename, DWORD dwtestindex );
Bool writelogheader (maid );
Bool m_bisrunning;
Bool m_bstop;
Protected:
Virtual bool pretranslatemessage (MSG * PMSG );
Testresult m_testresult;
Char m_szsubtestitem [maxlen] [maxitem];
Int m_isubtestitemcount;
Int m_itotalcount;
Int m_isubitemfailcount [maxitem];
Testtype m_itesttype [maxitem]; // define sub item is fit to prtest or runnin
};
# Endif //! Defined (afx_testbase_hda-43741379_4538_4612_95dd_8516143c64a41_included _)
//// Stdafx. h
// Stdafx. h: Include File for standard system include files,
// Or project specific include files that are used frequently,
// Are changed infrequently
//
# If! Defined (afx_stdafx_h00007d7e813a_cb55_4580_9fc8_695b91f3357100000000ded _)
# Define afx_stdafx_h00007d7e813a_cb55_4580_9fc8_695b91f3357100000000ded _
# If _ msc_ver> 1000
# Pragma once
# Endif // _ msc_ver> 1000
# Define vc_extralean // exclude rarely-used stuff from Windows Headers
# Include <afxwin. h> // MFC core and standard components
# Include <afxext. h> // MFC extensions
# Ifndef _ afx_no_ole_support
# Include <afxole. h> // MFC Ole classes
# Include <afxodlgs. h> // mfc ole Dialog classes
# Include <afxdisp. h> // MFC automation classes
# Endif // _ afx_no_ole_support
# Ifndef _ afx_no_db_support
# Include <afxdb. h> // mfc odbc database classes
# Endif // _ afx_no_db_support
# Ifndef _ afx_no_dao_support
# Include <afxdao. h> // mfc dao database classes
# Endif // _ afx_no_dao_support
# Include <afxdtctl. h> // MFC support for Internet Explorer 4 common controls
# Ifndef _ afx_no_afxcmn_support
# Include <afxcmn. h> // MFC support for Windows Common controls
# Endif // _ afx_no_afxcmn_support
// {Afx_insert_location }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.
# Endif //! Defined (afx_stdafx_h00007d7e813a_cb55_4580_9fc8_695b91f3357100000000ded _)