Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
7.2 KiB

  1. /******************************************************************************
  2. stillvue.h
  3. Copyright (C) Microsoft Corporation, 1997 - 1998
  4. All rights reserved
  5. Notes:
  6. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  7. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  8. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  9. PURPOSE.
  10. ******************************************************************************/
  11. #pragma warning (disable:4001) // ignore '//' comments
  12. #define _X86_ 1
  13. #define WIN32_LEAN_AND_MEAN 1
  14. #include <windows.h>
  15. #include <sti.h> // Still Image services
  16. #include "ntlog.h" // ntlogging APIs
  17. #include "resource.h" // resource defines
  18. #include <stdio.h>
  19. #include <stdlib.h> // rand()
  20. #include <string.h> // strcat
  21. #include <time.h> // srand(time())
  22. #include "winx.h"
  23. /*****************************************************************************
  24. global defines
  25. *****************************************************************************/
  26. #define LONGSTRING 256
  27. #define MEDSTRING 128
  28. #define SHORTSTRING 32
  29. /*****************************************************************************
  30. HWEnable states
  31. *****************************************************************************/
  32. #define OFF 0
  33. #define ON 1
  34. #define PEEK 2
  35. /*****************************************************************************
  36. events
  37. *****************************************************************************/
  38. #define STIEVENTARG "StiEvent"
  39. #define STIDEVARG "StiDevice"
  40. /*****************************************************************************
  41. StiSelect contexts
  42. *****************************************************************************/
  43. #define AUTO 1
  44. #define EVENT 4
  45. #define MANUAL 8
  46. /*****************************************************************************
  47. ErrorLog structure
  48. *****************************************************************************/
  49. typedef struct _ERRECORD
  50. {
  51. // index into current test suite
  52. int nIndex;
  53. // unique test ID
  54. int nTest;
  55. // total number of times this test failed
  56. int nCount;
  57. // TRUE = compliance test failure; FALSE = acceptable error
  58. BOOL bFatal;
  59. // the actual error returned
  60. DWORD dwError;
  61. // any associated error string
  62. WCHAR szErrorString[MEDSTRING];
  63. // previous / next record
  64. _ERRECORD *pPrev;
  65. _ERRECORD *pNext;
  66. } ERRECORD, *PERRECORD;
  67. typedef struct _DEVLOG
  68. {
  69. // internal device name
  70. WCHAR szInternalName[STI_MAX_INTERNAL_NAME_LENGTH];
  71. // friendly device name
  72. WCHAR szLocalName[STI_MAX_INTERNAL_NAME_LENGTH];
  73. // pointer to error record structure
  74. PERRECORD pRecord;
  75. // error total
  76. int nError;
  77. // previous / next record
  78. _DEVLOG *pPrev;
  79. _DEVLOG *pNext;
  80. } DEVLOG, *PDEVLOG;
  81. /*****************************************************************************
  82. stillvue.cpp prototypes
  83. *****************************************************************************/
  84. BOOL StartAutoTimer(HWND);
  85. BOOL ComplianceDialog(HWND);
  86. void LogOutput(int,LPSTR,...);
  87. VOID DisplayOutput(LPSTR,...);
  88. int EndTest(HWND,int);
  89. void FatalError(char *);
  90. BOOL FirstInstance(HANDLE);
  91. void Help();
  92. HWND MakeWindow(HANDLE);
  93. BOOL ParseCmdLine(LPSTR);
  94. BOOL CommandParse(HWND,UINT,WPARAM,LPARAM);
  95. BOOL Creation(HWND,UINT,WPARAM,LPARAM);
  96. BOOL Destruction(HWND,UINT,WPARAM,LPARAM);
  97. BOOL HScroll(HWND,UINT,WPARAM,LPARAM);
  98. BOOL VScroll(HWND,UINT,WPARAM,LPARAM);
  99. BOOL NTLogInit();
  100. BOOL NTLogEnd();
  101. BOOL FAR PASCAL Compliance(HWND,UINT,WPARAM,LPARAM);
  102. BOOL FAR PASCAL Settings(HWND,UINT,WPARAM,LPARAM);
  103. long FAR PASCAL WiskProc(HWND,UINT,WPARAM,LPARAM);
  104. /*****************************************************************************
  105. wsti.cpp prototypes
  106. *****************************************************************************/
  107. int ClosePrivateList(PDEVLOG *);
  108. void DisplayLogPassFail(BOOL);
  109. int InitPrivateList(PDEVLOG *,int *);
  110. int NextStiDevice();
  111. void StiDisplayError(HRESULT,char *,BOOL);
  112. HRESULT StiEnumPrivate(PVOID *,DWORD *);
  113. int StiSelect(HWND,int,BOOL *);
  114. void IStillDeviceMenu(DWORD);
  115. void IStillImageMenu(DWORD);
  116. void IStillNameMenu(DWORD);
  117. void IStillScanMenu(DWORD);
  118. HRESULT StiClose(BOOL *);
  119. HRESULT StiCreateInstance(BOOL *);
  120. HRESULT StiDeviceRelease(BOOL *);
  121. HRESULT StiDiagnostic(BOOL *);
  122. HRESULT StiEnableHwNotification(LPWSTR,int *,BOOL *);
  123. HRESULT StiEnum(BOOL *);
  124. HRESULT StiEscape(DWORD,char *,BOOL *);
  125. HRESULT StiEvent(HWND);
  126. HRESULT StiGetCaps(BOOL *);
  127. HRESULT StiGetDeviceValue(LPWSTR,LPWSTR,LPBYTE,DWORD *,DWORD,BOOL *);
  128. HRESULT StiGetDeviceInfo(LPWSTR,BOOL *);
  129. HRESULT StiGetLastErrorInfo(BOOL *);
  130. HRESULT StiGetStatus(int,BOOL *);
  131. HRESULT StiImageRelease(BOOL *);
  132. HRESULT StiRawReadData(char *,LPDWORD,BOOL *);
  133. HRESULT StiRawWriteData(char *,DWORD,BOOL *);
  134. HRESULT StiRawReadCommand(char *,LPDWORD,BOOL *);
  135. HRESULT StiRawWriteCommand(char *,DWORD,BOOL *);
  136. HRESULT StiRefresh(LPWSTR,BOOL *);
  137. HRESULT StiRegister(HWND,HINSTANCE,int,BOOL *);
  138. HRESULT StiReset(BOOL *);
  139. HRESULT StiSetDeviceValue(LPWSTR,LPWSTR,LPBYTE,DWORD,DWORD,BOOL *);
  140. HRESULT StiSubscribe(BOOL *);
  141. HRESULT StiWriteErrLog(DWORD,LPCWSTR,BOOL *);
  142. BOOL FAR PASCAL SelectDevice(HWND,UINT,WPARAM,LPARAM);
  143. /*****************************************************************************
  144. acquire.cpp prototypes
  145. *****************************************************************************/
  146. int IsScanDevice(PSTI_DEVICE_INFORMATION);
  147. void StiLamp(int);
  148. INT StiScan(HWND);
  149. INT CreateScanDIB(HWND);
  150. INT DeleteScanDIB();
  151. INT DisplayScanDIB(HWND);
  152. HRESULT WINAPI SendDeviceCommandString(PSTIDEVICE,LPSTR,...);
  153. HRESULT WINAPI TransactDevice(PSTIDEVICE,LPSTR,UINT,LPSTR,...);
  154. /*****************************************************************************
  155. winx.cpp prototypes
  156. *****************************************************************************/
  157. BOOL GetFinalWindow (HANDLE hInst,LPRECT lprRect,LPSTR lpzINI,LPSTR lpzSection);
  158. BOOL SaveFinalWindow (HANDLE hInst,HWND hWnd,LPSTR lpzINI,LPSTR lpzSection);
  159. BOOL LastError(BOOL bNewOnly);
  160. BOOL ErrorMsg(HWND hWnd, LPSTR lpzMsg, LPSTR lpzCaption, BOOL bFatal);
  161. int NextToken(char *pDest,char *pSrc);