file.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * WinPR: Windows Portable Runtime
  3. * File Functions
  4. *
  5. * Copyright 2015 Armin Novak <armin.novak@thincast.com>
  6. * Copyright 2015 Thincast Technologies GmbH
  7. * Copyright 2016 David PHAM-VAN <d.phamvan@inuvika.com>
  8. *
  9. * Licensed under the Apache License, Version 2.0 (the "License");
  10. * you may not use this file except in compliance with the License.
  11. * You may obtain a copy of the License at
  12. *
  13. * http://www.apache.org/licenses/LICENSE-2.0
  14. *
  15. * Unless required by applicable law or agreed to in writing, software
  16. * distributed under the License is distributed on an "AS IS" BASIS,
  17. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. * See the License for the specific language governing permissions and
  19. * limitations under the License.
  20. */
  21. #ifndef WINPR_FILE_PRIV_H
  22. #define WINPR_FILE_PRIV_H
  23. #include <winpr/winpr.h>
  24. #include <winpr/wtypes.h>
  25. #include <winpr/nt.h>
  26. #include <winpr/io.h>
  27. #include <winpr/error.h>
  28. #ifndef _WIN32
  29. #include <stdio.h>
  30. #include "../handle/handle.h"
  31. struct winpr_file
  32. {
  33. WINPR_HANDLE_DEF();
  34. FILE* fp;
  35. char* lpFileName;
  36. DWORD dwOpenMode;
  37. DWORD dwShareMode;
  38. DWORD dwFlagsAndAttributes;
  39. LPSECURITY_ATTRIBUTES lpSecurityAttributes;
  40. DWORD dwCreationDisposition;
  41. HANDLE hTemplateFile;
  42. BOOL bLocked;
  43. };
  44. typedef struct winpr_file WINPR_FILE;
  45. HANDLE_CREATOR* GetFileHandleCreator(void);
  46. UINT32 map_posix_err(int fs_errno);
  47. #endif /* _WIN32 */
  48. #endif /* WINPR_FILE_PRIV_H */