winrt_storage_util.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_WIN_WINRT_STORAGE_UTIL_H_
  5. #define BASE_WIN_WINRT_STORAGE_UTIL_H_
  6. #include <stdint.h>
  7. #include <windows.storage.streams.h>
  8. #include <wrl/client.h>
  9. #include "base/base_export.h"
  10. namespace base {
  11. namespace win {
  12. // Gets an array of bytes in the |buffer|, |out| represents a array of
  13. // bytes used by byte stream read and write.
  14. BASE_EXPORT HRESULT
  15. GetPointerToBufferData(ABI::Windows::Storage::Streams::IBuffer* buffer,
  16. uint8_t** out,
  17. UINT32* length);
  18. // Creates stream |buffer| from |data| that represents a array of bytes
  19. // and the |length| of bytes.
  20. BASE_EXPORT HRESULT CreateIBufferFromData(
  21. const uint8_t* data,
  22. UINT32 length,
  23. Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IBuffer>* buffer);
  24. } // namespace win
  25. } // namespace base
  26. #endif // BASE_WIN_WINRT_STORAGE_UTIL_H_