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.

105 lines
3.0 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // GlobalFuncs.cpp
  7. //
  8. // Description:
  9. // Contains the definitions of a few unrelated global functions
  10. //
  11. // Maintained By:
  12. // David Potter (DavidP) 14-JUN-2001
  13. // Vij Vasu (Vvasu) 08-MAR-2000
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16. //////////////////////////////////////////////////////////////////////////////
  17. // Include Files
  18. //////////////////////////////////////////////////////////////////////////////
  19. // The precompiled header.
  20. #include "Pch.h"
  21. // Needed by Dll.h
  22. #include "CFactory.h"
  23. // For g_hInstance
  24. #include "Dll.h"
  25. //////////////////////////////////////////////////////////////////////////////
  26. //++
  27. //
  28. // UINT
  29. // g_GenericSetupQueueCallback
  30. //
  31. // Description:
  32. // A generic callback used by SetupAPI file operations.
  33. //
  34. // Arguments:
  35. // pvContextIn
  36. // Context used by this function. Ignored.
  37. //
  38. // uiNotificationIn
  39. // The type of notification being sent.
  40. //
  41. // uiParam1In
  42. // uiParam2In
  43. // Additional notification information.
  44. //
  45. //
  46. // Return Value:
  47. // During the SPFILENOTIFY_DELETEERROR notification, FILEOP_SKIP is returned
  48. // if the file does not exist. Otherwise, FILEOP_ABORT is returned.
  49. //
  50. // FILEOP_DOIT is returned in all other cases.
  51. //
  52. // Exceptions Thrown:
  53. // None
  54. //
  55. //--
  56. //////////////////////////////////////////////////////////////////////////////
  57. UINT
  58. CALLBACK
  59. g_GenericSetupQueueCallback(
  60. PVOID // pvContextIn // context used by the callback routine
  61. , UINT uiNotificationIn // queue notification
  62. , UINT_PTR uiParam1In // additional notification information
  63. , UINT_PTR // uiParam2In // additional notification information
  64. )
  65. {
  66. TraceFunc( "" );
  67. UINT uiRetVal = FILEOP_DOIT;
  68. switch( uiNotificationIn )
  69. {
  70. case SPFILENOTIFY_DELETEERROR:
  71. {
  72. // For this notification uiParam1In is a pointer to a FILEPATHS structure.
  73. FILEPATHS * pfFilePaths = reinterpret_cast< FILEPATHS * >( uiParam1In );
  74. if ( pfFilePaths->Win32Error == ERROR_FILE_NOT_FOUND )
  75. {
  76. // If the file to be deleted was not found, just skip it.
  77. uiRetVal = FILEOP_SKIP;
  78. } // if: the file to be deleted does not exist.
  79. else
  80. {
  81. LogMsg(
  82. "[BC] g_GenericSetupQueueCallback() => Error %#08x has occurred while deleting the '%s' file. Aborting."
  83. , pfFilePaths->Win32Error
  84. , pfFilePaths->Target
  85. );
  86. uiRetVal = FILEOP_ABORT;
  87. } // else: some other error occurred.
  88. }
  89. break;
  90. }
  91. RETURN( uiRetVal );
  92. } //*** g_GenericSetupQueueCallback