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.

86 lines
1.9 KiB

  1. #include "stdinc.h"
  2. #include <windows.h>
  3. #include "sxsp.h"
  4. #include "gsgenctx.h"
  5. BOOL
  6. SxsInitGuidSectionGenerationContext(
  7. OUT PGUID_SECTION_GENERATION_CONTEXT *GSGenContext,
  8. IN ULONG DataFormatVersion,
  9. IN GUID_SECTION_GENERATION_CONTEXT_CALLBACK_FUNCTION CallbackFunction,
  10. IN LPVOID Context
  11. )
  12. {
  13. return CGSGenCtx::Create(
  14. GSGenContext,
  15. DataFormatVersion,
  16. CallbackFunction,
  17. Context);
  18. }
  19. PVOID
  20. WINAPI
  21. SxsGetGuidSectionGenerationContextCallbackContext(
  22. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext
  23. )
  24. {
  25. return ((CGSGenCtx *) GSGenContext)->GetCallbackContext();
  26. }
  27. VOID
  28. WINAPI
  29. SxsDestroyGuidSectionGenerationContext(
  30. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext
  31. )
  32. {
  33. if (GSGenContext != NULL)
  34. {
  35. ((CGSGenCtx *) GSGenContext)->DeleteYourself();
  36. }
  37. }
  38. BOOL
  39. WINAPI
  40. SxsAddGuidToGuidSectionGenerationContext(
  41. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext,
  42. IN const GUID *Guid,
  43. IN PVOID DataContext,
  44. IN ULONG AssemblyRosterIndex,
  45. IN DWORD DuplicateGuidErrorCode
  46. )
  47. {
  48. return ((CGSGenCtx *) GSGenContext)->Add(*Guid, DataContext, AssemblyRosterIndex, DuplicateGuidErrorCode);
  49. }
  50. BOOL
  51. WINAPI
  52. SxsFindStringInGuidSectionGenerationContext(
  53. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext,
  54. IN const GUID *Guid,
  55. OUT PVOID *DataContext
  56. )
  57. {
  58. return ((CGSGenCtx *) GSGenContext)->Find(*Guid, DataContext);
  59. }
  60. BOOL
  61. WINAPI
  62. SxsGetGuidSectionGenerationContextSectionSize(
  63. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext,
  64. OUT PSIZE_T DataSize
  65. )
  66. {
  67. return ((CGSGenCtx *) GSGenContext)->GetSectionSize(DataSize);
  68. }
  69. BOOL
  70. WINAPI
  71. SxsGetGuidSectionGenerationContextSectionData(
  72. IN PGUID_SECTION_GENERATION_CONTEXT GSGenContext,
  73. IN SIZE_T BufferSize,
  74. IN PVOID Buffer,
  75. OUT PSIZE_T BytesWritten OPTIONAL
  76. )
  77. {
  78. return ((CGSGenCtx *) GSGenContext)->GetSectionData(BufferSize, Buffer, BytesWritten);
  79. }