Index: trunk/include/iprt/file.h
===================================================================
--- trunk/include/iprt/file.h	(revision 37535)
+++ trunk/include/iprt/file.h	(revision 37559)
@@ -30,7 +30,5 @@
 #include <iprt/types.h>
 #include <iprt/stdarg.h>
-#ifdef IN_RING3
-# include <iprt/fs.h>
-#endif
+#include <iprt/fs.h>
 
 RT_C_DECLS_BEGIN
@@ -70,6 +68,4 @@
 #endif
 
-
-#ifdef IN_RING3
 
 /**
@@ -236,4 +232,5 @@
 
 
+#ifdef IN_RING3
 /**
  * Force the use of open flags for all files opened after the setting is
@@ -246,4 +243,5 @@
  */
 RTR3DECL(int)  RTFileSetForceFlags(unsigned fOpenForAccess, unsigned fSet, unsigned fMask);
+#endif /* IN_RING3 */
 
 /**
@@ -256,5 +254,5 @@
  *                          The ACCESS, ACTION and DENY flags are mandatory!
  */
-RTR3DECL(int)  RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen);
+RTDECL(int)  RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen);
 
 /**
@@ -269,5 +267,5 @@
  * @param   ...             Arguments to the format string.
  */
-RTR3DECL(int)  RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...);
+RTDECL(int)  RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...);
 
 /**
@@ -282,5 +280,5 @@
  * @param   va              Arguments to the format string.
  */
-RTR3DECL(int)  RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va);
+RTDECL(int)  RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va);
 
 /**
@@ -291,5 +289,5 @@
  * @param   fAccess         The desired access only, i.e. read, write or both.
  */
-RTR3DECL(int)  RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess);
+RTDECL(int)  RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess);
 
 /**
@@ -299,5 +297,5 @@
  * @param   File            The file handle to close.
  */
-RTR3DECL(int)  RTFileClose(RTFILE File);
+RTDECL(int)  RTFileClose(RTFILE File);
 
 /**
@@ -308,5 +306,5 @@
  * @param   uNative         The native handle.
  */
-RTR3DECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative);
+RTDECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative);
 
 /**
@@ -316,5 +314,5 @@
  * @param   File            The IPRT file handle.
  */
-RTR3DECL(RTHCINTPTR) RTFileToNative(RTFILE File);
+RTDECL(RTHCINTPTR) RTFileToNative(RTFILE File);
 
 /**
@@ -325,5 +323,5 @@
  * @todo    This is a RTPath api!
  */
-RTR3DECL(int)  RTFileDelete(const char *pszFilename);
+RTDECL(int)  RTFileDelete(const char *pszFilename);
 
 /** @name Seek flags.
@@ -352,5 +350,5 @@
  *                      NULL is allowed.
  */
-RTR3DECL(int)  RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
+RTDECL(int)  RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
 
 /**
@@ -364,5 +362,5 @@
  *                      If NULL an error will be returned for a partial read.
  */
-RTR3DECL(int)  RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead);
+RTDECL(int)  RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead);
 
 /**
@@ -378,5 +376,5 @@
  *                      If NULL an error will be returned for a partial read.
  */
-RTR3DECL(int)  RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead);
+RTDECL(int)  RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead);
 
 /**
@@ -390,5 +388,5 @@
  *                      If NULL an error will be returned for a partial write.
  */
-RTR3DECL(int)  RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
+RTDECL(int)  RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
 
 /**
@@ -404,5 +402,5 @@
  *                      If NULL an error will be returned for a partial write.
  */
-RTR3DECL(int)  RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
+RTDECL(int)  RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
 
 /**
@@ -412,5 +410,5 @@
  * @param   File        Handle to the file.
  */
-RTR3DECL(int)  RTFileFlush(RTFILE File);
+RTDECL(int)  RTFileFlush(RTFILE File);
 
 /**
@@ -421,5 +419,5 @@
  * @param   cbSize      The new file size.
  */
-RTR3DECL(int)  RTFileSetSize(RTFILE File, uint64_t cbSize);
+RTDECL(int)  RTFileSetSize(RTFILE File, uint64_t cbSize);
 
 /**
@@ -430,5 +428,5 @@
  * @param   pcbSize     Where to store the filesize.
  */
-RTR3DECL(int)  RTFileGetSize(RTFILE File, uint64_t *pcbSize);
+RTDECL(int)  RTFileGetSize(RTFILE File, uint64_t *pcbSize);
 
 /**
@@ -440,5 +438,5 @@
  * @see     RTFileGetMaxSizeEx.
  */
-RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
+RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
 
 /**
@@ -450,5 +448,5 @@
  * @see     RTFileGetMaxSize.
  */
-RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax);
+RTDECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax);
 
 /**
@@ -459,5 +457,5 @@
  * @param   File        Handle to the file.
  */
-RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
+RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
 
 /**
@@ -477,5 +475,5 @@
  * @param   File        The file handle
  */
-RTR3DECL(bool) RTFileIsValid(RTFILE File);
+RTDECL(bool) RTFileIsValid(RTFILE File);
 
 /**
@@ -641,5 +639,5 @@
  * @param   cbLock      Length of region to lock, may overlap the end of file.
  */
-RTR3DECL(int)  RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
+RTDECL(int)  RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
 
 /**
@@ -666,5 +664,5 @@
  * @param   cbLock      Length of region to lock, may overlap the end of file.
  */
-RTR3DECL(int)  RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
+RTDECL(int)  RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
 
 /**
@@ -678,5 +676,5 @@
  * @param   cbLock      Length of region to unlock, may overlap the end of file.
  */
-RTR3DECL(int)  RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock);
+RTDECL(int)  RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock);
 
 
@@ -691,5 +689,5 @@
  *                                  Use RTFSOBJATTRADD_NOTHING if this doesn't matter.
  */
-RTR3DECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
+RTDECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
 
 /**
@@ -717,6 +715,6 @@
  * @remark  POSIX can only set Access & Modification and will always set both.
  */
-RTR3DECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
-                             PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
+RTDECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
+                           PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
 
 /**
@@ -732,6 +730,6 @@
  * @remark  This is wrapper around RTFileQueryInfo() and exists to complement RTFileSetTimes().
  */
-RTR3DECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime,
-                             PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime);
+RTDECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime,
+                           PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime);
 
 /**
@@ -745,5 +743,5 @@
  * @param   fMode       The new file mode, see @ref grp_rt_fs for details.
  */
-RTR3DECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode);
+RTDECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode);
 
 /**
@@ -757,5 +755,5 @@
  *          and exists to complement RTFileSetMode().
  */
-RTR3DECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode);
+RTDECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode);
 
 /**
@@ -769,5 +767,5 @@
  *                      unchanged.
  */
-RTR3DECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid);
+RTDECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid);
 
 /**
@@ -781,5 +779,5 @@
  * @remark  This is wrapper around RTFileQueryInfo() and exists to complement RTFileGetOwner().
  */
-RTR3DECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid);
+RTDECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid);
 
 /**
@@ -800,5 +798,5 @@
  * @param   piRet       Return value of the IOCTL request.
  */
-RTR3DECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet);
+RTDECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet);
 
 /**
@@ -817,6 +815,6 @@
  * @sa      RTFsQuerySizes
  */
-RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree,
-                                 uint32_t *pcbBlock, uint32_t *pcbSector);
+RTDECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree,
+                               uint32_t *pcbBlock, uint32_t *pcbSector);
 
 /**
@@ -913,4 +911,6 @@
 
 
+#ifdef IN_RING3
+
 /** @page pg_rt_asyncio RT File async I/O API
  *
