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.

91 lines
1.8 KiB

  1. #include "precomp.h"
  2. #pragma hdrstop
  3. /*++
  4. Copyright (c) 1991 Microsoft Corporation
  5. Module Name:
  6. infload.c
  7. Abstract:
  8. Top-level routines to load and process an INF file.
  9. Author:
  10. Ted Miller (tedm) 10-Spetember-1991
  11. --*/
  12. GRC
  13. LoadINFFile(
  14. LPSTR FileName,
  15. PUCHAR *PreparsedFile,
  16. UINT *PreparsedSize,
  17. PINFLINE *LineArray,
  18. UINT *LineArrayCount
  19. )
  20. {
  21. LPBYTE PreprocessedFile;
  22. UINT PreprocessedSize;
  23. GRC rc;
  24. rc = PreprocessINFFile(FileName,&PreprocessedFile,&PreprocessedSize);
  25. if(rc == grcOkay) {
  26. rc = PreparseINFFile(PreprocessedFile,
  27. PreprocessedSize,
  28. PreparsedFile,
  29. PreparsedSize,
  30. LineArray,
  31. LineArrayCount
  32. );
  33. SFree(PreprocessedFile);
  34. }
  35. return(rc);
  36. }
  37. GRC
  38. APIENTRY
  39. GrcOpenInf(
  40. SZ FileName,
  41. PVOID pInfTempInfo
  42. )
  43. {
  44. PPARSED_INF pParsedInf = ((PINFTEMPINFO)pInfTempInfo)->pParsedInf;
  45. pParsedInf->MasterFile = NULL;
  46. pParsedInf->MasterFileSize = 0;
  47. pParsedInf->MasterLineArray = NULL;
  48. pParsedInf->MasterLineCount = 0;
  49. return(LoadINFFile(FileName,
  50. &(pParsedInf->MasterFile),
  51. &(pParsedInf->MasterFileSize),
  52. &(pParsedInf->MasterLineArray),
  53. &(pParsedInf->MasterLineCount)
  54. )
  55. );
  56. }
  57. BOOL
  58. InfIsOpen(
  59. VOID
  60. )
  61. {
  62. return(! ( !pLocalInfTempInfo()->pParsedInf->MasterLineArray
  63. && !pLocalInfTempInfo()->pParsedInf->MasterLineCount
  64. && !pLocalInfTempInfo()->pParsedInf->MasterFile
  65. && !pLocalInfTempInfo()->pParsedInf->MasterFileSize
  66. )
  67. );
  68. }