Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Retrieving data from internet Pin
greba16-Feb-05 6:47
greba16-Feb-05 6:47 
GeneralRe: Retrieving data from internet Pin
Ravi Bhavnani16-Feb-05 8:10
professionalRavi Bhavnani16-Feb-05 8:10 
GeneralRe: Retrieving data from internet Pin
ThatsAlok16-Feb-05 18:07
ThatsAlok16-Feb-05 18:07 
GeneralRe: Retrieving data from internet Pin
Luke9116-Feb-05 19:00
Luke9116-Feb-05 19:00 
Generalopening a vrml file Pin
Micealgleeson16-Feb-05 2:20
Micealgleeson16-Feb-05 2:20 
GeneralReadFile problems Pin
rocky_pulley16-Feb-05 2:17
rocky_pulley16-Feb-05 2:17 
GeneralRe: ReadFile problems Pin
David Crow16-Feb-05 2:30
David Crow16-Feb-05 2:30 
GeneralRe: ReadFile problems Pin
rocky_pulley16-Feb-05 2:46
rocky_pulley16-Feb-05 2:46 
Ok, I made it into a simpler test, and now it returns code 87 on the bad one:

void readFile(int size)
{
DWORD dwBytes = 0;
HANDLE h = CreateFile("\\\\.\\C:", GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
0, OPEN_EXISTING, 0, NULL);

if (h == INVALID_HANDLE_VALUE)
{
cout << "FAILED TO OPEN" << endl;
return;
}

char *buff = new char[size];

if (!ReadFile(h, buff, size, &dwBytes,NULL))
{
cout << "Failed to read file: " << GetLastError() << endl;
}
else
{
cout << "Success" << endl;
}

delete []buff;

CloseHandle(h);
}

int main()
{
readFile(48);
readFile(1024);

return 0;
}

the first call returns "failed to read file: 87".
the second call returns "success".

Does this have something to do with the inode size? Does ReadFile require this or maybe the fact that I'm accessing the NTFS directly.

-- Rocky Dean Pulley
GeneralRe: ReadFile problems Pin
David Crow16-Feb-05 2:57
David Crow16-Feb-05 2:57 
GeneralRe: ReadFile problems Pin
rocky_pulley16-Feb-05 3:03
rocky_pulley16-Feb-05 3:03 
GeneralRe: ReadFile problems Pin
cj_rahul16-Feb-05 3:36
cj_rahul16-Feb-05 3:36 
Generalreading file names from a directory Pin
sachin.kumar16-Feb-05 2:00
sachin.kumar16-Feb-05 2:00 
GeneralRe: reading file names from a directory Pin
rocky_pulley16-Feb-05 2:19
rocky_pulley16-Feb-05 2:19 
GeneralRe: reading file names from a directory Pin
sachin.kumar16-Feb-05 21:21
sachin.kumar16-Feb-05 21:21 
GeneralRe: reading file names from a directory Pin
Ravi Bhavnani16-Feb-05 2:20
professionalRavi Bhavnani16-Feb-05 2:20 
GeneralRe: reading file names from a directory Pin
David Crow16-Feb-05 2:27
David Crow16-Feb-05 2:27 
Generaltext in metafiles Pin
Steve Kearon16-Feb-05 0:38
Steve Kearon16-Feb-05 0:38 
GeneralRe: text in metafiles Pin
Roger Allen16-Feb-05 1:51
Roger Allen16-Feb-05 1:51 
GeneralRe: text in metafiles Pin
Steve Kearon16-Feb-05 2:31
Steve Kearon16-Feb-05 2:31 
Generaldialog from resource Pin
Zizilamoroso16-Feb-05 0:27
Zizilamoroso16-Feb-05 0:27 
GeneralRe: dialog from resource Pin
Blake Miller17-Feb-05 8:06
Blake Miller17-Feb-05 8:06 
GeneralModifying Dialog Template Pin
Omar Alvi16-Feb-05 0:12
Omar Alvi16-Feb-05 0:12 
GeneralRe: Modifying Dialog Template Pin
Bob Ciora16-Feb-05 1:39
Bob Ciora16-Feb-05 1:39 
GeneralRe: Modifying Dialog Template Pin
Omar Alvi16-Feb-05 23:54
Omar Alvi16-Feb-05 23:54 
GeneralShowWindow flicker... Pin
Cpt Rick16-Feb-05 0:01
Cpt Rick16-Feb-05 0:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.