implement proper IRQL, DPCs, kernel and user APCs, alertable waits, async file I/O with cancellation, trap frames, selftests, a real driver/device model, native async FAT32, VFAT dotfile fixes, syscall ABI cleanup, async_apc and async_cancel tests, POSIX multi-volume paths, and pimp the readme.
This commit is contained in:
1 parent
f5fd7bdd75
commit
529f816166
75 files changed
+9969
-5675
No files matched your search
+2
-2
@@ -92,13 +92,13 @@ __declspec(dllexport) int StretchDIBits(
|
||||
// Only reallocate if the new size is LARGER than what we already have
|
||||
int requiredPixels = DestWidth * DestHeight;
|
||||
if (requiredPixels > currentDestCapacity) {
|
||||
SysFree(destBuffer, 0);
|
||||
SysFree(destBuffer);
|
||||
destBuffer = (uint32_t*)SysAlloc(requiredPixels * sizeof(uint32_t));
|
||||
currentDestCapacity = requiredPixels;
|
||||
}
|
||||
|
||||
if (DestWidth > currentXMapCapacity) {
|
||||
SysFree(srcX_map, 0);
|
||||
SysFree(srcX_map);
|
||||
srcX_map = (int*)SysAlloc(DestWidth * sizeof(int));
|
||||
currentXMapCapacity = DestWidth;
|
||||
}
|
||||
|
||||
+18
-15
@@ -197,7 +197,7 @@ __declspec(dllexport) BOOL HeapFree(void* heap, DWORD flags, void* ptr) {
|
||||
(void)heap; (void)flags;
|
||||
// Win32's HeapFree doesn't need the size; we pass 0 and the kernel's
|
||||
// allocator handles it (the block header carries the size).
|
||||
if (ptr) SysFree(ptr, 0);
|
||||
if (ptr) SysFree(ptr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1163,30 +1163,33 @@ __declspec(dllexport) BOOL SetCurrentDirectoryA(const char* lpPathName) {
|
||||
|
||||
__declspec(dllexport) DWORD GetCurrentDirectoryA(DWORD nBufferLength, char* lpBuffer) {
|
||||
if (!lpBuffer || nBufferLength == 0) {
|
||||
// Return required size (including NUL). Max CWD is 512 bytes + "C:\".
|
||||
// Return required size (including NUL). Max CWD is 512 bytes + "C:\\".
|
||||
return 515;
|
||||
}
|
||||
|
||||
// Retrieve the raw relative CWD from the kernel (e.g. "" or "apps\\data")
|
||||
// Kernel returns native "N:/path". Present it as a Win32 drive letter.
|
||||
char raw[512];
|
||||
uint32_t s = SysGetCwd(raw, sizeof(raw));
|
||||
if (s != 0) { gLastError = 1; return 0; }
|
||||
|
||||
// Prepend the Windows-style drive letter so callers see "C:\apps\data"
|
||||
// rather than just "apps\data".
|
||||
char full[515];
|
||||
if (raw[0] == '\0') {
|
||||
// Root
|
||||
full[0] = 'C'; full[1] = ':'; full[2] = '\\'; full[3] = '\0';
|
||||
} else {
|
||||
// "C:\<raw>"
|
||||
full[0] = 'C'; full[1] = ':'; full[2] = '\\';
|
||||
size_t rawLen = strlen(raw);
|
||||
if (rawLen + 4 > sizeof(full)) rawLen = sizeof(full) - 4;
|
||||
memcpy(full + 3, raw, rawLen);
|
||||
full[3 + rawLen] = '\0';
|
||||
char drive = 'C';
|
||||
const char* rel = raw;
|
||||
if (raw[0] >= '0' && raw[0] <= '7' && raw[1] == ':' &&
|
||||
(raw[2] == '\\' || raw[2] == '/')) {
|
||||
drive = (char)('C' + (raw[0] - '0'));
|
||||
rel = raw + 3;
|
||||
}
|
||||
|
||||
full[0] = drive;
|
||||
full[1] = ':';
|
||||
full[2] = '\\';
|
||||
size_t rawLen = strlen(rel);
|
||||
if (rawLen + 4 > sizeof(full)) rawLen = sizeof(full) - 4;
|
||||
memcpy(full + 3, rel, rawLen);
|
||||
full[3 + rawLen] = '\0';
|
||||
for (char* p = full + 3; *p; p++) if (*p == '/') *p = '\\';
|
||||
|
||||
size_t needed = strlen(full) + 1;
|
||||
if ((DWORD)needed > nBufferLength) {
|
||||
gLastError = 122; // ERROR_INSUFFICIENT_BUFFER
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ __declspec(dllexport) HRESULT CoCreateInstance(const GUID* clsid, IUnknown* oute
|
||||
// Memory
|
||||
// ---------------------------------------------------------------------------
|
||||
__declspec(dllexport) void CoTaskMemFree(void* pv) {
|
||||
if (pv) SysFree(pv, 0);
|
||||
if (pv) SysFree(pv);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user