В 12-ке нашел. Может подойдет?
X++:
#winapi
public client static boolean fileLocked(Filename filename)
{
int handle;
if (! WinAPI::fileExists(filename))
return false;
handle = WinAPI::createFile(filename, #OPEN_EXISTING, #GENERIC_WRITE);
if (handle == #INVALID_HANDLE_VALUE)
return true;
WinAPI::closeHandle(handle);
return false;
}