Source code of Windows XP (NT5)
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.

824 lines
17 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. spapip.h
  5. Abstract:
  6. Header file for routines exported from setupapi.dll that are NOT
  7. part of the setup API, and are thus intended for private/internal use.
  8. Author:
  9. Ted Miller (tedm) 31-Mar-1995
  10. Revision History:
  11. --*/
  12. #ifdef UNICODE
  13. typedef LPCWSTR PCTSTR;
  14. #else
  15. typedef LPCSTR PCTSTR;
  16. #endif
  17. //
  18. // Work around weirdness with Win32 typedef...
  19. //
  20. #ifdef NT_INCLUDED
  21. //
  22. // __int64 is only supported by 2.0 and later midl.
  23. // __midl is set by the 2.0 midl and not by 1.0 midl.
  24. //
  25. #if (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))
  26. typedef unsigned __int64 DWORDLONG;
  27. #else
  28. typedef double DWORDLONG;
  29. #endif
  30. typedef DWORDLONG *PDWORDLONG;
  31. #endif /* NT_INCLUDED */
  32. //
  33. // Memory allocation functions
  34. //
  35. BOOL
  36. MemoryInitialize(
  37. IN BOOL Attach
  38. );
  39. PVOID
  40. MyMalloc(
  41. IN DWORD Size
  42. );
  43. PVOID
  44. MyRealloc(
  45. IN PVOID Block,
  46. IN DWORD NewSize
  47. );
  48. VOID
  49. MyFree(
  50. IN CONST VOID *Block
  51. );
  52. VOID
  53. OutOfMemory(
  54. IN HWND Owner OPTIONAL
  55. );
  56. //
  57. // String table functions
  58. //
  59. PVOID
  60. StringTableInitialize(
  61. VOID
  62. );
  63. PVOID
  64. StringTableInitializeEx(
  65. IN UINT ExtraDataSize, OPTIONAL
  66. IN UINT Reserved
  67. );
  68. VOID
  69. StringTableDestroy(
  70. IN PVOID StringTable
  71. );
  72. //
  73. // Flags to be used by StringTableAddString and StringTableLookUpString
  74. //
  75. #define STRTAB_CASE_INSENSITIVE 0x00000000
  76. #define STRTAB_CASE_SENSITIVE 0x00000001
  77. #define STRTAB_BUFFER_WRITEABLE 0x00000002
  78. #define STRTAB_NEW_EXTRADATA 0x00000004
  79. LONG
  80. StringTableAddString(
  81. IN PVOID StringTable,
  82. IN OUT PTSTR String,
  83. IN DWORD Flags
  84. );
  85. LONG
  86. StringTableAddStringEx(
  87. IN PVOID StringTable,
  88. IN PTSTR String,
  89. IN DWORD Flags,
  90. IN PVOID ExtraData, OPTIONAL
  91. IN UINT ExtraDataSize OPTIONAL
  92. );
  93. LONG
  94. StringTableLookUpString(
  95. IN PVOID StringTable,
  96. IN OUT PTSTR String,
  97. IN DWORD Flags
  98. );
  99. LONG
  100. StringTableLookUpStringEx(
  101. IN PVOID StringTable,
  102. IN OUT PTSTR String,
  103. IN DWORD Flags,
  104. OUT PVOID ExtraData, OPTIONAL
  105. IN UINT ExtraDataBufferSize OPTIONAL
  106. );
  107. BOOL
  108. StringTableGetExtraData(
  109. IN PVOID StringTable,
  110. IN LONG StringId,
  111. OUT PVOID ExtraData,
  112. IN UINT ExtraDataBufferSize
  113. );
  114. BOOL
  115. StringTableSetExtraData(
  116. IN PVOID StringTable,
  117. IN LONG StringId,
  118. IN PVOID ExtraData,
  119. IN UINT ExtraDataSize
  120. );
  121. //
  122. // Type for StringTableEnum
  123. //
  124. typedef
  125. BOOL
  126. (*PSTRTAB_ENUM_ROUTINE)(
  127. IN PVOID StringTable,
  128. IN LONG StringId,
  129. IN PCTSTR String,
  130. IN PVOID ExtraData,
  131. IN UINT ExtraDataSize,
  132. IN LPARAM lParam
  133. );
  134. BOOL
  135. StringTableEnum(
  136. IN PVOID StringTable,
  137. OUT PVOID ExtraDataBuffer, OPTIONAL
  138. IN UINT ExtraDataBufferSize, OPTIONAL
  139. IN PSTRTAB_ENUM_ROUTINE Callback,
  140. IN LPARAM lParam OPTIONAL
  141. );
  142. PTSTR
  143. StringTableStringFromId(
  144. IN PVOID StringTable,
  145. IN LONG StringId
  146. );
  147. BOOL
  148. StringTableStringFromIdEx(
  149. IN PVOID StringTable,
  150. IN LONG StringId,
  151. IN OUT PTSTR pBuffer,
  152. IN OUT PULONG pBufSize
  153. );
  154. VOID
  155. StringTableTrim(
  156. IN PVOID StringTable
  157. );
  158. PVOID
  159. StringTableDuplicate(
  160. IN PVOID StringTable
  161. );
  162. //
  163. // Global flags / overrides
  164. //
  165. VOID
  166. pSetupSetGlobalFlags(
  167. IN DWORD flags
  168. );
  169. DWORD
  170. pSetupGetGlobalFlags(
  171. VOID
  172. );
  173. #define PSPGF_NO_RUNONCE 0x00000001 // set to inhibit runonce calls
  174. #define PSPGF_NO_BACKUP 0x00000002 // set to inhibit automatic backup
  175. #define PSPGF_NONINTERACTIVE 0x00000004 // set to inhibit all UI
  176. #define PSPGF_SERVER_SIDE_RUNONCE 0x00000008 // batch RunOnce entries for server-side processing
  177. #define PSPGF_NO_VERIFY_INF 0x00000010 // set to inhibit verification (digital signature) of INFs
  178. //
  179. // Server-side (non-interactive mode) RunOnce processing support
  180. //
  181. typedef struct _RUNONCE_NODE {
  182. struct _RUNONCE_NODE *Next;
  183. PCWSTR DllFullPath;
  184. PCSTR DllEntryPointName;
  185. PCWSTR DllParams;
  186. } RUNONCE_NODE, *PRUNONCE_NODE;
  187. PRUNONCE_NODE
  188. pSetupAccessRunOnceNodeList(
  189. VOID
  190. );
  191. VOID
  192. pSetupDestroyRunOnceNodeList(
  193. VOID
  194. );
  195. //
  196. // per queue overrides
  197. //
  198. BOOL
  199. pSetupSetQueueFlags(
  200. IN HSPFILEQ QueueHandle,
  201. IN DWORD flags
  202. );
  203. DWORD
  204. pSetupGetQueueFlags(
  205. IN HSPFILEQ QueueHandle
  206. );
  207. //
  208. // Queue flags.
  209. //
  210. #define FQF_TRY_SIS_COPY 0x00000001 // try SIS copy first
  211. #define FQF_BACKUP_AWARE 0x00010000 // allow callbacks
  212. #define FQF_DID_CATALOGS_OK 0x00020000 // catalog/inf verification has run
  213. #define FQF_DID_CATALOGS_FAILED 0x00040000 // catalog/inf verification has run
  214. #define FQF_DIGSIG_ERRORS_NOUI 0x00080000 // prompt user on failed signature
  215. // verification
  216. #define FQF_DEVICE_INSTALL 0x00100000 // file queue is for device install
  217. #define FQF_USE_ALT_PLATFORM 0x00200000 // use AltPlatformInfo for digital
  218. // signature verification
  219. #define FQF_QUEUE_ALREADY_COMMITTED 0x00400000 // file queue has already been committed
  220. #define FQF_QUEUE_FORCE_BLOCK_POLICY 0x01000000 // force policy to block so we never
  221. // install unsigned files
  222. #define FQF_KEEP_INF_AND_CAT_ORIGINAL_NAMES 0x02000000 // install INF/CAT from 3rd-party location
  223. // using original names (for exception INFs)
  224. //
  225. // File functions in fileutil.c
  226. //
  227. DWORD
  228. OpenAndMapFileForRead(
  229. IN PCTSTR FileName,
  230. OUT PDWORD FileSize,
  231. OUT PHANDLE FileHandle,
  232. OUT PHANDLE MappingHandle,
  233. OUT PVOID *BaseAddress
  234. );
  235. BOOL
  236. UnmapAndCloseFile(
  237. IN HANDLE FileHandle,
  238. IN HANDLE MappingHandle,
  239. IN PVOID BaseAddress
  240. );
  241. typedef struct _TEXTFILE_READ_BUFFER {
  242. PCTSTR TextBuffer;
  243. DWORD TextBufferSize;
  244. HANDLE FileHandle;
  245. HANDLE MappingHandle;
  246. PVOID ViewAddress;
  247. } TEXTFILE_READ_BUFFER, *PTEXTFILE_READ_BUFFER;
  248. DWORD
  249. ReadAsciiOrUnicodeTextFile(
  250. IN HANDLE FileHandle,
  251. OUT PTEXTFILE_READ_BUFFER Result
  252. );
  253. BOOL
  254. DestroyTextFileReadBuffer(
  255. IN PTEXTFILE_READ_BUFFER ReadBuffer
  256. );
  257. BOOL
  258. GetVersionInfoFromImage(
  259. IN PCTSTR FileName,
  260. OUT PDWORDLONG Version,
  261. OUT LANGID *Language
  262. );
  263. BOOL
  264. FileExists(
  265. IN PCTSTR FileName,
  266. OUT PWIN32_FIND_DATA FindData OPTIONAL
  267. );
  268. DWORD
  269. GetSetFileTimestamp(
  270. IN PCTSTR FileName,
  271. OUT FILETIME *CreateTime, OPTIONAL
  272. OUT FILETIME *AccessTime, OPTIONAL
  273. OUT FILETIME *WriteTime, OPTIONAL
  274. IN BOOL Set
  275. );
  276. DWORD
  277. RetreiveFileSecurity(
  278. IN PCTSTR FileName,
  279. OUT PSECURITY_DESCRIPTOR *SecurityDescriptor
  280. );
  281. DWORD
  282. StampFileSecurity(
  283. IN PCTSTR FileName,
  284. IN PSECURITY_DESCRIPTOR SecurityInfo
  285. );
  286. DWORD
  287. TakeOwnershipOfFile(
  288. IN PCTSTR Filename
  289. );
  290. DWORD
  291. SearchForInfFile(
  292. IN PCTSTR InfName,
  293. OUT LPWIN32_FIND_DATA FindData,
  294. IN DWORD SearchControl,
  295. OUT PTSTR FullInfPath,
  296. IN UINT FullInfPathSize,
  297. OUT PUINT RequiredSize OPTIONAL
  298. );
  299. DWORD
  300. MultiSzFromSearchControl(
  301. IN DWORD SearchControl,
  302. OUT PTCHAR PathList,
  303. IN DWORD PathListSize,
  304. OUT PDWORD RequiredSize OPTIONAL
  305. );
  306. //
  307. // Non-file-related security routines in security.c.
  308. //
  309. BOOL
  310. IsUserAdmin(
  311. VOID
  312. );
  313. BOOL
  314. DoesUserHavePrivilege(
  315. PCTSTR PrivilegeName
  316. );
  317. BOOL
  318. EnablePrivilege(
  319. IN PCTSTR PrivilegeName,
  320. IN BOOL Enable
  321. );
  322. //
  323. // Private INF routines
  324. //
  325. PCTSTR
  326. pSetupGetField(
  327. IN PINFCONTEXT Context,
  328. IN DWORD FieldIndex
  329. );
  330. //
  331. // Registry interface routines
  332. //
  333. DWORD
  334. QueryRegistryValue(
  335. IN HKEY KeyHandle,
  336. IN PCTSTR ValueName,
  337. OUT PTSTR *Value,
  338. OUT PDWORD DataType,
  339. OUT PDWORD DataSizeBytes
  340. );
  341. DWORD
  342. QueryMultiSzValueToArray(
  343. IN HKEY Root,
  344. IN PCTSTR Subkey,
  345. IN PCTSTR ValueName,
  346. OUT PTSTR **Array,
  347. OUT PUINT StringCount,
  348. IN BOOL FailIfDoesntExist
  349. );
  350. DWORD
  351. SetArrayToMultiSzValue(
  352. IN HKEY Root,
  353. IN PCTSTR Subkey,
  354. IN PCTSTR ValueName,
  355. IN PTSTR *Array,
  356. IN UINT StringCount
  357. );
  358. VOID
  359. FreeStringArray(
  360. IN PTSTR *Array,
  361. IN UINT StringCount
  362. );
  363. DWORD
  364. AppendStringToMultiSz(
  365. IN HKEY Key,
  366. IN PCTSTR SubKeyName, OPTIONAL
  367. IN DWORD DevInst, OPTIONAL
  368. IN PCTSTR ValueName, OPTIONAL
  369. IN PCTSTR String,
  370. IN BOOL AllowDuplicates
  371. );
  372. DWORD
  373. RegistryDelnode(
  374. IN HKEY RootKey,
  375. IN PCTSTR SubKeyName
  376. );
  377. //
  378. // Service controller helper functions
  379. //
  380. DWORD
  381. RetrieveServiceConfig(
  382. IN SC_HANDLE ServiceHandle,
  383. OUT LPQUERY_SERVICE_CONFIG *ServiceConfig
  384. );
  385. DWORD
  386. AddTagToGroupOrderListEntry(
  387. IN PCTSTR LoadOrderGroup,
  388. IN DWORD TagId,
  389. IN BOOL MoveToFront
  390. );
  391. DWORD
  392. AcquireSCMLock(
  393. IN SC_HANDLE SCMHandle,
  394. OUT SC_LOCK *pSCMLock
  395. );
  396. //
  397. // Miscellaneous utility functions
  398. //
  399. PTSTR
  400. DuplicateString(
  401. IN PCTSTR String
  402. );
  403. PSTR
  404. UnicodeToMultiByte(
  405. IN PCWSTR UnicodeString,
  406. IN UINT Codepage
  407. );
  408. PWSTR
  409. MultiByteToUnicode(
  410. IN PCSTR String,
  411. IN UINT Codepage
  412. );
  413. DWORD
  414. CaptureStringArg(
  415. IN PCTSTR String,
  416. OUT PCTSTR *CapturedString
  417. );
  418. DWORD
  419. CaptureAndConvertAnsiArg(
  420. IN PCSTR AnsiString,
  421. OUT PCWSTR *UnicodeString
  422. );
  423. DWORD
  424. DelimStringToMultiSz(
  425. IN PTSTR String,
  426. IN DWORD StringLen,
  427. IN TCHAR Delim
  428. );
  429. VOID
  430. CenterWindowRelativeToParent(
  431. HWND hwnd
  432. );
  433. BOOL
  434. pAToI(
  435. IN PCTSTR Field,
  436. OUT PINT IntegerValue
  437. );
  438. #define UnicodeToAnsi(UnicodeString) UnicodeToMultiByte((UnicodeString),CP_ACP)
  439. #define UnicodeToOem(UnicodeString) UnicodeToMultiByte((UnicodeString),CP_OEMCP)
  440. #define AnsiToUnicode(AnsiString) MultiByteToUnicode((AnsiString),CP_ACP)
  441. #define OemToUnicode(OemString) MultiByteToUnicode((OemString),CP_OEMCP)
  442. BOOL
  443. ConcatenatePaths(
  444. IN OUT PTSTR Target,
  445. IN PCTSTR Path,
  446. IN UINT TargetBufferSize,
  447. OUT PUINT RequiredSize
  448. );
  449. DWORD
  450. pSetupMakeSurePathExists(
  451. IN PCTSTR FullFilespec
  452. );
  453. PCTSTR
  454. MyGetFileTitle(
  455. IN PCTSTR FilePath
  456. );
  457. BOOL
  458. InfIsFromOemLocation(
  459. IN PCTSTR InfFileName,
  460. IN BOOL InfDirectoryOnly
  461. );
  462. DWORD
  463. pSetupGetOsLoaderDriveAndPath(
  464. IN BOOL RootOnly,
  465. OUT PTSTR CallerBuffer,
  466. IN DWORD CallerBufferSize,
  467. OUT PDWORD RequiredSize OPTIONAL
  468. );
  469. BOOL
  470. pSetupSetSystemSourcePath(
  471. IN PCTSTR NewSourcePath,
  472. IN PCTSTR NewSvcPackSourcePath
  473. );
  474. BOOL
  475. ShouldDeviceBeExcluded(
  476. IN PCTSTR DeviceId,
  477. IN HINF hInf,
  478. OUT PBOOL ArchitectureSpecificExclude OPTIONAL
  479. );
  480. BOOL
  481. pSetupDiSetDeviceInfoContext(
  482. IN HDEVINFO DeviceInfoSet,
  483. IN PSP_DEVINFO_DATA DeviceInfoData,
  484. IN DWORD Context
  485. );
  486. BOOL
  487. pSetupDiGetDeviceInfoContext(
  488. IN HDEVINFO DeviceInfoSet,
  489. IN PSP_DEVINFO_DATA DeviceInfoData,
  490. OUT PDWORD Context
  491. );
  492. #define SETUP_HAS_OPEN_DIALOG_EVENT TEXT("MS_SETUPAPI_DIALOG")
  493. //
  494. // Define flags for DoInstallActionWithParams
  495. //
  496. #define INSTALLACTION_CALL_CI 0x00000001
  497. #define INSTALLACTION_NO_DEFAULT 0x00000002
  498. DWORD
  499. DoInstallActionWithParams(
  500. IN DI_FUNCTION InstallFunction,
  501. IN HDEVINFO DeviceInfoSet,
  502. IN PSP_DEVINFO_DATA DeviceInfoData, OPTIONAL
  503. IN PSP_CLASSINSTALL_HEADER ClassInstallParams, OPTIONAL
  504. IN DWORD ClassInstallParamsSize,
  505. IN DWORD Flags
  506. );
  507. INT
  508. AddMiniIconToList(
  509. IN HBITMAP hbmImage,
  510. IN HBITMAP hbmMask
  511. );
  512. PCTSTR
  513. pSetupDirectoryIdToPath(
  514. IN PCTSTR DirectoryId, OPTIONAL
  515. IN OUT PUINT DirectoryIdInt, OPTIONAL
  516. IN PCTSTR SubDirectory, OPTIONAL
  517. IN PCTSTR InfSourcePath, OPTIONAL
  518. IN OUT PCTSTR *OsLoaderPath OPTIONAL
  519. );
  520. typedef struct _STRING_TO_DATA {
  521. PCTSTR String;
  522. UINT Data;
  523. } STRING_TO_DATA, *PSTRING_TO_DATA;
  524. BOOL
  525. LookUpStringInTable(
  526. IN PSTRING_TO_DATA Table,
  527. IN PCTSTR String,
  528. OUT PUINT Data
  529. );
  530. #define SIZECHARS(x) (sizeof((x))/sizeof(TCHAR))
  531. #define CSTRLEN(x) ((sizeof((x))/sizeof(TCHAR)) - 1)
  532. #define ARRAYSIZE(x) (sizeof((x))/sizeof((x)[0]))
  533. //
  534. // Routine to perform right-click install action on INFs (previously
  535. // implemented in syssetup.dll--moved to setupapi.dll because it's
  536. // needed on both NT and Win95). SysSetup.DLL still provides this
  537. // entry point for backward compatibility, but calls into setupapi
  538. // to do the work.
  539. //
  540. VOID
  541. WINAPI
  542. InstallHinfSectionA(
  543. IN HWND Window,
  544. IN HINSTANCE ModuleHandle,
  545. IN PCSTR CommandLine,
  546. IN INT ShowCommand
  547. );
  548. VOID
  549. WINAPI
  550. InstallHinfSectionW(
  551. IN HWND Window,
  552. IN HINSTANCE ModuleHandle,
  553. IN PCWSTR CommandLine,
  554. IN INT ShowCommand
  555. );
  556. #ifdef UNICODE
  557. #define InstallHinfSection InstallHinfSectionW
  558. #else
  559. #define InstallHinfSection InstallHinfSectionA
  560. #endif
  561. //
  562. // Routine used by optional components code in syssetup to setup runonce/grpconv.
  563. //
  564. DWORD
  565. InstallStop(
  566. IN BOOL DoRunOnce
  567. );
  568. DWORD
  569. InstallStopEx(
  570. IN BOOL DoRunOnce,
  571. IN DWORD Flags,
  572. IN PVOID Reserved
  573. );
  574. #define INSTALLSTOP_NO_UI 0x00000001 // InstallStop should do no UI
  575. #define INSTALLSTOP_NO_GRPCONV 0x00000002 // Don't do GrpConv
  576. //
  577. // Section access for INF file
  578. //
  579. BOOL
  580. SetupGetInfSections (
  581. IN HINF InfHandle,
  582. OUT PTSTR Buffer, OPTIONAL
  583. IN UINT Size, OPTIONAL
  584. OUT UINT *SizeNeeded OPTIONAL
  585. );
  586. //
  587. // GUID handling routines (avoid linking to ole32.dll!)
  588. //
  589. DWORD
  590. pSetupGuidFromString(
  591. IN PCTSTR GuidString,
  592. OUT LPGUID Guid
  593. );
  594. DWORD
  595. pSetupStringFromGuid(
  596. IN CONST GUID *Guid,
  597. OUT PTSTR GuidString,
  598. IN DWORD GuidStringSize
  599. );
  600. BOOL
  601. pSetupIsGuidNull(
  602. IN CONST GUID *Guid
  603. );
  604. //
  605. // Digital signature verification routines
  606. //
  607. typedef enum {
  608. SetupapiVerifyNoProblem,
  609. SetupapiVerifyCatalogProblem, // catalog file couldn't be verified
  610. SetupapiVerifyInfProblem, // inf file couldn't be installed/verified
  611. SetupapiVerifyFileNotSigned, // file is not signed, no verification attempted
  612. SetupapiVerifyFileProblem, // file may be signed, but couldn't be verified
  613. SetupapiVerifyClassInstProblem, // class installer is unsigned
  614. SetupapiVerifyCoInstProblem // co-installer is unsigned
  615. } SetupapiVerifyProblem;
  616. DWORD
  617. pSetupVerifyQueuedCatalogs(
  618. IN HSPFILEQ FileQueue
  619. );
  620. DWORD
  621. VerifyCatalogFile(
  622. IN LPCTSTR CatalogFullPath
  623. );
  624. DWORD
  625. VerifyFile(
  626. IN LPVOID LogContext,
  627. IN LPCTSTR Catalog, OPTIONAL
  628. IN PVOID CatalogBaseAddress, OPTIONAL
  629. IN DWORD CatalogImageSize,
  630. IN LPCTSTR Key,
  631. IN LPCTSTR FileFullPath,
  632. OUT SetupapiVerifyProblem *Problem, OPTIONAL
  633. OUT LPTSTR ProblemFile, OPTIONAL
  634. IN BOOL CatalogAlreadyVerified,
  635. IN PSP_ALTPLATFORM_INFO AltPlatformInfo, OPTIONAL
  636. OUT LPTSTR CatalogFileUsed, OPTIONAL
  637. OUT PDWORD NumCatalogsConsidered OPTIONAL
  638. );
  639. DWORD
  640. InstallCatalog(
  641. IN LPCTSTR CatalogFullPath,
  642. IN LPCTSTR NewBaseName, OPTIONAL
  643. OUT LPTSTR NewCatalogFullPath
  644. );
  645. BOOL
  646. HandleFailedVerification(
  647. IN HWND Owner,
  648. IN SetupapiVerifyProblem Problem,
  649. IN LPCTSTR ProblemFile,
  650. IN LPCTSTR DeviceDesc, OPTIONAL
  651. IN DWORD DriverSigningPolicy,
  652. IN BOOL NoUI,
  653. IN DWORD Error,
  654. IN PVOID LogContext, OPTIONAL
  655. OUT PDWORD Flags, OPTIONAL
  656. IN LPCTSTR TargetName OPTIONAL
  657. );
  658. DWORD
  659. GetCurrentDriverSigningPolicy(
  660. IN BOOL IsDeviceInstallation
  661. );
  662. //
  663. // Diagnostic/debug functions in debug.c
  664. //
  665. //
  666. // Allow assertion checking to be turned on independently
  667. // of DBG, like by specifying C_DEFINES=-DASSERTS_ON=1 in sources file.
  668. //
  669. #ifndef ASSERTS_ON
  670. #if DBG
  671. #define ASSERTS_ON 1
  672. #else
  673. #define ASSERTS_ON 0
  674. #endif
  675. #endif
  676. #if ASSERTS_ON
  677. #define MYASSERT(x) if(!(x)) { AssertFail(__FILE__,__LINE__,#x); }
  678. VOID
  679. AssertFail(
  680. IN PSTR FileName,
  681. IN UINT LineNumber,
  682. IN PSTR Condition
  683. );
  684. #else
  685. #define MYASSERT(x)
  686. #endif