PC Review


Reply
Thread Tools Rate Thread

1450 Insufficient system resources ... when calling WriteFile w/large chunk.

 
 
Test Name
Guest
Posts: n/a
 
      1st Sep 2003
The code pasted below generates the following error

1450 Insufficient system resources exist to complete the requested
service. ERROR_NO_SYSTEM_RESOURCES


when it writes an approximately 64MB block of data to a file share. The
source and destination systems in the test were Windows 2000. The source
system running the program below is running SP3, and the destination system
with file share is SP4. I don't think the SP's matter as I tried other tests
with others sytems.

My **guess** is that the source system's Workstation and/or file sharing
drivers cannot handle the 64MB request from sent from the WriteFile API.
This is a guess so any hints are welcome. A workaround is to send smaller
chunks, and that's fine, but I thought it was worth seeing if anyone had
thoughts on this. Since error 1450 is used in so many scenarios, it seems
that the answer lies in Microsoft's source code or with someone who's
familiar with this problem and/or internals causing this.

Thanks,
Thomas

----

#include "stdafx.h"
#include <windows.h>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>


int main(int argc, char* argv[])
{
// fails on 67076033 but succeeds on 67076032 on write from Win2K to Win2K
//unsigned long ulSizeToTest = 64*1024*1024; // fails.
unsigned long ulSizeToTest = 67076033; // fails.
//unsigned long ulSizeToTest = 67076032; // succeeds.
printf("Testing %lu bytes\n", ulSizeToTest);

int fdWrite = _wopen(L"\\\\somemachine\\myshare\\big.dat", O_WRONLY |
O_CREAT | O_APPEND | O_BINARY | O_NOINHERIT, 0666);

/*
The open style doesn't matter. This fails too. FYI.
HANDLE h = CreateFile(
"\\\\talaptop\\myshare\\big.dat",
GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
*/

if (fdWrite != -1) {
HANDLE h = (HANDLE) _get_osfhandle(fdWrite);
char *pLarge = new char[ulSizeToTest];
if (pLarge) {
memset(pLarge, 32, ulSizeToTest);
DWORD dwWritten = 0;
if (WriteFile(h, pLarge, ulSizeToTest, &dwWritten, NULL)) {
printf("Write succeeded %ld bytes.\n", dwWritten);
}
else {
printf("Write failed: %d.\n", GetLastError());
}
}
else
printf("Can't create large bug. %d\n", GetLastError());


_close(fdWrite);
}
else {
printf("Fail open for write. %d\n", GetLastError());
}

return 0;
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 1450 Insufficient system resources exist to complete the req =?Utf-8?B?QmFycnk=?= Windows XP Help 3 30th Oct 2006 08:26 PM
Insufficient system resources... XP SP2? David Ellis Windows XP Help 2 31st Oct 2005 04:33 AM
Hibernation - System Error : Insufficient system resources exist to complete the API slawrence Windows XP Help 0 4th Oct 2005 08:23 AM
Error Insufficient System Resources ... (Large File Import) Jim Microsoft Frontpage 2 18th Jul 2005 07:17 PM
Insufficient System Resources Don Gilbert Microsoft Windows 2000 Terminal Server Clients 2 28th Jul 2004 03:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:48 AM.