www.pudn.com > liuqudong.zip > TickSrv.h


//====================================================================== 
// Header file 
// 
// Written for the book Programming Windows CE 
// Copyright (C) 2003 Douglas Boling 
//====================================================================== 
#define dim(a)  (sizeof (a)/sizeof(a[0])) 
// 
// Declare the external entry points here. Use declspec so we don't  
// need a .def file. Bracketed with extern C to avoid mangling in C++. 
// 
#ifdef __cplusplus 
extern "C" { 
#endif //__cplusplus 
__declspec(dllexport) DWORD TCK_Init (DWORD dwContext); 
__declspec(dllexport) BOOL  TCK_Deinit (DWORD dwContext); 
__declspec(dllexport) DWORD TCK_IOControl (DWORD dwOpen, DWORD dwCode,  
                                           PBYTE pIn, DWORD dwIn, 
                                           PBYTE pOut, DWORD dwOut,  
                                           DWORD *pdwBytesWritten); 
__declspec(dllexport) void TCK_PowerDown (DWORD dwContext); 
__declspec(dllexport) void TCK_PowerUp (DWORD dwContext); 
#ifdef __cplusplus 
} // extern "C" 
#endif //__cplusplus 
 
// Suppress warnings by declaring the undeclared. 
#ifndef GetCurrentPermissions 
DWORD GetCurrentPermissions(void); 
DWORD SetProcPermissions (DWORD); 
DWORD GetCallerProcess(void); 
PVOID MapPtrToProcess (PVOID, DWORD); 
#endif //GetCurrentPermissions 
 
int RegisterService (void); 
int DeregisterService (void); 
DWORD WINAPI AcceptThread (PVOID pArg); 
 
// 
// Service state structure   
// 
typedef struct { 
    DWORD dwSize;               // Size of structure 
    CRITICAL_SECTION csData;    // Crit Section protecting this struct 
    int servState;              // Service state 
} SRVCONTEXT, *PSRVCONTEXT;