- NTSTATUS status;
- IO_STATUS_BLOCK io_status;
- u8 buf[128] _aligned_attribute(8);
- const FILE_NAME_INFORMATION *info;
-
- status = NtQueryInformationFile(hFile, &io_status, buf, sizeof(buf),
- FileAlternateNameInformation);
- info = (const FILE_NAME_INFORMATION*)buf;
- if (status == STATUS_SUCCESS && info->FileNameLength != 0) {
- dentry->short_name = MALLOC(info->FileNameLength + 2);
- if (!dentry->short_name)
- return WIMLIB_ERR_NOMEM;
- memcpy(dentry->short_name, info->FileName,
- info->FileNameLength);
- dentry->short_name[info->FileNameLength / 2] = L'\0';
- dentry->short_name_nbytes = info->FileNameLength;
+ if (func_NtQueryInformationFile) {
+ NTSTATUS status;
+ IO_STATUS_BLOCK io_status;
+ u8 buf[128] _aligned_attribute(8);
+ const FILE_NAME_INFORMATION *info;
+
+ status = (*func_NtQueryInformationFile)(hFile, &io_status, buf, sizeof(buf),
+ FileAlternateNameInformation);
+ info = (const FILE_NAME_INFORMATION*)buf;
+ if (status == STATUS_SUCCESS && info->FileNameLength != 0) {
+ dentry->short_name = MALLOC(info->FileNameLength + 2);
+ if (!dentry->short_name)
+ return WIMLIB_ERR_NOMEM;
+ memcpy(dentry->short_name, info->FileName,
+ info->FileNameLength);
+ dentry->short_name[info->FileNameLength / 2] = L'\0';
+ dentry->short_name_nbytes = info->FileNameLength;
+ }
+ return 0;