T
testerman
Greetings!
I suppose you could help me with these errors I get or at least direct
me to a more appropriate newsgroup.
So, the problem is as follows:
hFile = CreateFile((LPCWSTR)"somefile.ext", GENERIC_READ|GENERIC_WRITE,
NULL, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
// As far as I see, works as supposed
hMapping = CreateFileMapping(hFile, NULL, PAGE_READWRITE, NULL, NULL,
(LPCWSTR)"somename");
// Always NULL and GetLastError() returns 87 or 1006
I also noticed this: upon changing OPEN_EXISTING to OPEN_ALWAYS in
CreateFile(), a unnamed file is still created, even if "somefile.ext"
exists in the project folder! The first call (with OPEN_EXISTING) causes
error 87 and the second (with OPEN_ALWAYS) causes error 1006 to be
generated. Any suggestions? I thank you in advance.
I suppose you could help me with these errors I get or at least direct
me to a more appropriate newsgroup.
So, the problem is as follows:
hFile = CreateFile((LPCWSTR)"somefile.ext", GENERIC_READ|GENERIC_WRITE,
NULL, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
// As far as I see, works as supposed
hMapping = CreateFileMapping(hFile, NULL, PAGE_READWRITE, NULL, NULL,
(LPCWSTR)"somename");
// Always NULL and GetLastError() returns 87 or 1006
I also noticed this: upon changing OPEN_EXISTING to OPEN_ALWAYS in
CreateFile(), a unnamed file is still created, even if "somefile.ext"
exists in the project folder! The first call (with OPEN_EXISTING) causes
error 87 and the second (with OPEN_ALWAYS) causes error 1006 to be
generated. Any suggestions? I thank you in advance.