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.

52 lines
1.2 KiB

  1. //
  2. // Copyright (c) Microsoft Corporation
  3. //
  4. #include "basepch.h"
  5. #include "sxsapi.h"
  6. #include "dload.h"
  7. DEFINE_PROCNAME_ENTRIES(sxs)
  8. {
  9. DLPENTRY(SxsBeginAssemblyInstall)
  10. DLPENTRY(SxsEndAssemblyInstall)
  11. };
  12. DEFINE_PROCNAME_MAP(sxs)
  13. static BOOL g_fSxsBeginAssemblyInstallFailed = FALSE;
  14. static BOOL g_fSxsInstallAssemblyFailed = FALSE;
  15. BOOL
  16. WINAPI
  17. SxsBeginAssemblyInstall(
  18. IN DWORD Flags,
  19. IN PSXS_INSTALLATION_FILE_COPY_CALLBACK InstallationCallback OPTIONAL,
  20. IN PVOID InstallationContext OPTIONAL,
  21. IN PSXS_IMPERSONATION_CALLBACK ImpersonationCallback OPTIONAL,
  22. IN PVOID ImpersonationContext OPTIONAL,
  23. OUT PVOID *InstallCookie
  24. )
  25. {
  26. g_fSxsBeginAssemblyInstallFailed = TRUE;
  27. if (InstallCookie != NULL) {
  28. *InstallCookie = NULL;
  29. }
  30. DelayLoad_SetLastNtStatusAndWin32Error();
  31. return FALSE;
  32. }
  33. BOOL
  34. WINAPI
  35. SxsEndAssemblyInstall(
  36. IN PVOID InstallCookie,
  37. IN DWORD Flags,
  38. IN OUT PVOID Reserved OPTIONAL
  39. )
  40. {
  41. if (g_fSxsBeginAssemblyInstallFailed || g_fSxsInstallAssemblyFailed) {
  42. MYASSERT(Flags & SXS_END_ASSEMBLY_INSTALL_ABORT);
  43. return TRUE;
  44. }
  45. DelayLoad_SetLastNtStatusAndWin32Error();
  46. return FALSE;
  47. }