+#define NOMINMAX
+#include <limits>
#include <msp/core/systemerror.h>
#include "handle.h"
#include "handle_private.h"
+using namespace std;
+
namespace Msp {
namespace IO {
{
}
-unsigned sys_read(Handle &handle, char *buf, unsigned size)
+void sys_set_inherit(Handle &, bool)
+{
+}
+
+size_t sys_read(Handle &handle, char *buf, size_t size)
{
+ if(size>numeric_limits<DWORD>::max())
+ throw invalid_argument("read");
+
DWORD ret;
if(ReadFile(*handle, buf, size, &ret, 0)==0)
throw system_error("ReadFile");
return ret;
}
-unsigned sys_write(Handle &handle, const char *buf, unsigned size)
+size_t sys_write(Handle &handle, const char *buf, size_t size)
{
+ if(size>numeric_limits<DWORD>::max())
+ throw invalid_argument("write");
+
DWORD ret;
if(WriteFile(*handle, buf, size, &ret, 0)==0)
throw system_error("WriteFile");