mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTVDM]
Implement INT 21h, AH=5Ch "Lock/Unlock Region of File". svn path=/trunk/; revision=63311
This commit is contained in:
parent
a242a67b73
commit
2d601a6dfc
1 changed files with 53 additions and 0 deletions
|
@ -2622,6 +2622,59 @@ VOID WINAPI DosInt21h(LPWORD Stack)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Lock/Unlock Region of File */
|
||||
case 0x5C:
|
||||
{
|
||||
HANDLE Handle = DosGetRealHandle(getBX());
|
||||
|
||||
if (Handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
/* The handle is invalid */
|
||||
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
|
||||
setAX(ERROR_INVALID_HANDLE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (getAL() == 0x00)
|
||||
{
|
||||
/* Lock region of file */
|
||||
if (LockFile(Handle,
|
||||
MAKELONG(getCX(), getDX()), 0,
|
||||
MAKELONG(getSI(), getDI()), 0))
|
||||
{
|
||||
Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
|
||||
}
|
||||
else
|
||||
{
|
||||
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
|
||||
setAX(GetLastError());
|
||||
}
|
||||
}
|
||||
else if (getAL() == 0x01)
|
||||
{
|
||||
/* Unlock region of file */
|
||||
if (UnlockFile(Handle,
|
||||
MAKELONG(getCX(), getDX()), 0,
|
||||
MAKELONG(getSI(), getDI()), 0))
|
||||
{
|
||||
Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
|
||||
}
|
||||
else
|
||||
{
|
||||
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
|
||||
setAX(GetLastError());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Invalid subfunction */
|
||||
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
|
||||
setAX(ERROR_INVALID_FUNCTION);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Canonicalize File Name or Path */
|
||||
case 0x60:
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue