forked from microsoft/WindowsAppSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtyperesolution.cpp
More file actions
623 lines (549 loc) · 23.1 KB
/
typeresolution.cpp
File metadata and controls
623 lines (549 loc) · 23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
// Copyright (c) Microsoft Corporation and Contributors.
// Licensed under the MIT License.
#include <pch.h>
#include "TypeResolution.h"
#include "catalog.h"
#include <wrl.h>
#define METADATA_FILE_EXTENSION L"winmd"
#define METADATA_FILE_PATH_FORMAT L"%s%s." METADATA_FILE_EXTENSION
#define METADATA_FILE_SEARCH_FORMAT L"%s%s*." METADATA_FILE_EXTENSION
namespace UndockedRegFreeWinRT
{
static const UINT32 g_uiMaxTypeName = 512;
static wil::unique_process_heap_string g_cachedProcessExeDir;
BOOL CALLBACK GetProcessExeDirInitOnceCallback(
_Inout_ PINIT_ONCE,
_Inout_opt_ PVOID,
_Out_opt_ PVOID*)
{
wil::unique_process_heap_string localExePath;
HRESULT hr = wil::GetModuleFileNameW(nullptr, localExePath);
if (FAILED_LOG(hr))
{
SetLastError(hr);
return FALSE;
}
// Modify the retrieved string to truncate the actual exe name and leave the containing directory path. This API
// expects a buffer size including the terminating null, so add 1 to the string length.
hr = PathCchRemoveFileSpec(localExePath.get(), wcslen(localExePath.get()) + 1);
if (FAILED_LOG(hr))
{
SetLastError(hr);
return FALSE;
}
g_cachedProcessExeDir = std::move(localExePath);
return TRUE;
}
// Returned string is cached globally, and should not be freed by the caller.
HRESULT GetProcessExeDir(PCWSTR* path)
{
*path = nullptr;
static INIT_ONCE ProcessExeDirInitOnce = INIT_ONCE_STATIC_INIT;
RETURN_IF_WIN32_BOOL_FALSE(InitOnceExecuteOnce(&ProcessExeDirInitOnce, GetProcessExeDirInitOnceCallback, nullptr, nullptr));
// The cache has been successfully populated by the InitOnce, so we can just use it directly.
*path = g_cachedProcessExeDir.get();
return S_OK;
}
HRESULT FindTypeInMetaDataFile(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszFullName,
_In_ PCWSTR pszCandidateFilePath,
_In_ TYPE_RESOLUTION_OPTIONS resolutionOptions,
_COM_Outptr_opt_result_maybenull_ IMetaDataImport2** ppMetaDataImport,
_Out_opt_ mdTypeDef* pmdTypeDef)
{
HRESULT hr = S_OK;
Microsoft::WRL::ComPtr<IMetaDataImport2> spMetaDataImport;
MetaDataImportersLRUCache* pMetaDataImporterCache = MetaDataImportersLRUCache::GetMetaDataImportersLRUCacheInstance();
if (pMetaDataImporterCache != nullptr)
{
hr = pMetaDataImporterCache->GetMetaDataImporter(
pMetaDataDispenser,
pszCandidateFilePath,
&spMetaDataImport);
}
else
{
hr = E_OUTOFMEMORY;
}
if (SUCCEEDED(hr))
{
const size_t cFullName = wcslen(pszFullName);
wchar_t pszRetrievedName[g_uiMaxTypeName];
HCORENUM hEnum = nullptr;
mdTypeDef rgTypeDefs[32];
ULONG cTypeDefs;
DWORD dwTypeDefProps;
hr = RO_E_METADATA_NAME_NOT_FOUND;
if (TRO_RESOLVE_TYPE & resolutionOptions)
{
hr = spMetaDataImport->FindTypeDefByName(pszFullName, mdTokenNil, &rgTypeDefs[0]);
if (SUCCEEDED(hr))
{
// Check to confirm that the type we just found is a
// winrt type. If it is, we're good, otherwise we
// want to fail with RO_E_INVALID_METADATA_FILE.
hr = spMetaDataImport->GetTypeDefProps(rgTypeDefs[0], nullptr, 0, nullptr, &dwTypeDefProps, nullptr);
if (SUCCEEDED(hr))
{
// If we found the type but it's not a winrt type,
// it's an error.
//
// If the type is public, than the metadata file
// is corrupt (all public types in a winrt file
// must be tdWindowsRuntime). If the type is
// private, then we just want to report that the
// type wasn't found.
if (!IsTdWindowsRuntime(dwTypeDefProps))
{
if (IsTdPublic(dwTypeDefProps))
{
hr = RO_E_INVALID_METADATA_FILE;
}
else
{
hr = RO_E_METADATA_NAME_NOT_FOUND;
}
}
}
else
{
hr = RO_E_INVALID_METADATA_FILE;
}
if (SUCCEEDED(hr))
{
if (pmdTypeDef != nullptr)
{
*pmdTypeDef = rgTypeDefs[0];
}
if (ppMetaDataImport != nullptr)
{
*ppMetaDataImport = spMetaDataImport.Detach();
}
}
}
else if (hr == CLDB_E_RECORD_NOTFOUND)
{
hr = RO_E_METADATA_NAME_NOT_FOUND;
}
}
if ((hr == RO_E_METADATA_NAME_NOT_FOUND) &&
(TRO_RESOLVE_NAMESPACE & resolutionOptions))
{
// Check whether the name is a namespace rather than a type.
do
{
hr = spMetaDataImport->EnumTypeDefs(
&hEnum,
rgTypeDefs,
ARRAYSIZE(rgTypeDefs),
&cTypeDefs);
if (hr == S_OK)
{
for (UINT32 iTokenIndex = 0; iTokenIndex < cTypeDefs; ++iTokenIndex)
{
hr = spMetaDataImport->GetTypeDefProps(
rgTypeDefs[iTokenIndex],
pszRetrievedName,
ARRAYSIZE(pszRetrievedName),
nullptr,
&dwTypeDefProps,
nullptr);
if (FAILED(hr))
{
break;
}
hr = RO_E_METADATA_NAME_NOT_FOUND;
// Only consider windows runtime types when
// trying to determine if the name is a
// namespace.
if (IsTdWindowsRuntime(dwTypeDefProps) && (wcslen(pszRetrievedName) > cFullName))
{
if ((wcsncmp(pszRetrievedName, pszFullName, cFullName) == 0) &&
(pszRetrievedName[cFullName] == L'.'))
{
hr = RO_E_METADATA_NAME_IS_NAMESPACE;
break;
}
}
}
}
} while (hr == RO_E_METADATA_NAME_NOT_FOUND);
// There were no more tokens to enumerate, but the type was still not found.
if (hr == S_FALSE)
{
hr = RO_E_METADATA_NAME_NOT_FOUND;
}
if (hEnum != nullptr)
{
spMetaDataImport->CloseEnum(hEnum);
hEnum = nullptr;
}
}
}
return hr;
}
HRESULT FindTypeInDirectory(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszFullName,
_In_ PCWSTR pszDirectoryPath,
_Out_opt_ HSTRING* phstrMetaDataFilePath,
_COM_Outptr_opt_result_maybenull_ IMetaDataImport2** ppMetaDataImport,
_Out_opt_ mdTypeDef* pmdTypeDef)
{
wchar_t szCandidateFileName[MAX_PATH + 1]{};
HRESULT hr{ StringCchCopy(szCandidateFileName, ARRAYSIZE(szCandidateFileName), pszFullName) };
if (SUCCEEDED(hr))
{
// To resolve type SomeNamespace.B.C, first check if SomeNamespace.B.C is a type or
// a namespace in the metadata files in the directory in this order:
// 1. SomeNamespace.B.C.WinMD
// 2. SomeNamespace.B.WinMD
// 3. SomeNamespace.WinMD
wchar_t szCandidateFilePath[MAX_PATH + 1]{};
PWSTR pszLastDot{};
do
{
pszLastDot = nullptr;
hr = StringCchPrintfExW(szCandidateFilePath, ARRAYSIZE(szCandidateFilePath),
nullptr, nullptr, 0, METADATA_FILE_PATH_FORMAT,
pszDirectoryPath, szCandidateFileName);
if (SUCCEEDED(hr))
{
hr = FindTypeInMetaDataFile(pMetaDataDispenser, pszFullName, szCandidateFilePath,
TRO_RESOLVE_TYPE_AND_NAMESPACE, ppMetaDataImport, pmdTypeDef);
if (SUCCEEDED(hr))
{
if (phstrMetaDataFilePath != nullptr)
{
hr = WindowsCreateString(szCandidateFilePath,
static_cast<UINT32>(wcslen(szCandidateFilePath)),
phstrMetaDataFilePath);
}
break;
}
}
hr = RO_E_METADATA_NAME_NOT_FOUND;
pszLastDot = wcsrchr(szCandidateFileName, '.');
if (pszLastDot != nullptr)
{
*pszLastDot = '\0';
}
} while (pszLastDot != nullptr);
// If name was not found when searching in the "upward direction", then
// the name might be a namespace name in a down-level file.
if (hr == RO_E_METADATA_NAME_NOT_FOUND)
{
wchar_t szFilePathSearchTemplate[MAX_PATH + 1]{};
hr = StringCchPrintfExW(szFilePathSearchTemplate, ARRAYSIZE(szFilePathSearchTemplate), nullptr,
nullptr, 0, METADATA_FILE_SEARCH_FORMAT, pszDirectoryPath, pszFullName);
if (SUCCEEDED(hr))
{
// Search in all files in the directory whose name begin with the input string.
WIN32_FIND_DATA fd{};
HANDLE hFindFile{ FindFirstFile(szFilePathSearchTemplate, &fd) };
if (hFindFile != INVALID_HANDLE_VALUE)
{
do
{
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
continue;
}
PWSTR pszFilePathPart{ szCandidateFilePath };
size_t cchRemaining{ ARRAYSIZE(szCandidateFilePath) };
hr = StringCchCopyExW(pszFilePathPart, cchRemaining, pszDirectoryPath,
&pszFilePathPart, &cchRemaining, 0);
if (SUCCEEDED(hr))
{
hr = StringCchCopyExW(pszFilePathPart, cchRemaining, fd.cFileName,
&pszFilePathPart, &cchRemaining, 0);
if (SUCCEEDED(hr))
{
hr = FindTypeInMetaDataFile(pMetaDataDispenser, pszFullName, szCandidateFilePath,
TRO_RESOLVE_NAMESPACE, ppMetaDataImport, pmdTypeDef);
if (hr == S_OK)
{
hr = E_UNEXPECTED;
break;
}
else if (hr == RO_E_METADATA_NAME_IS_NAMESPACE)
{
break;
}
}
}
} while (FindNextFile(hFindFile, &fd));
FindClose(hFindFile);
}
else
{
hr = RO_E_METADATA_NAME_NOT_FOUND;
}
}
}
}
if (hr == STRSAFE_E_INSUFFICIENT_BUFFER)
{
return RO_E_METADATA_NAME_NOT_FOUND;
}
RETURN_HR(hr);
}
HRESULT FindTypeInDirectoryWithNormalization(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszFullName,
_In_ PCWSTR pszDirectoryPath,
_Out_opt_ HSTRING* phstrMetaDataFilePath,
_COM_Outptr_opt_result_maybenull_ IMetaDataImport2** ppMetaDataImport,
_Out_opt_ mdTypeDef* pmdTypeDef)
{
wchar_t pszPackagePath[MAX_PATH + 1]{};
PWSTR pszPackagePathWritePtr{ pszPackagePath };
size_t cchPackagePathRemaining{ ARRAYSIZE(pszPackagePath) };
RETURN_IF_FAILED(StringCchCopyExW(pszPackagePath, ARRAYSIZE(pszPackagePath),
pszDirectoryPath, &pszPackagePathWritePtr, &cchPackagePathRemaining, 0));
// If the path is not terminated by a backslash, then append one.
if (pszPackagePath[ARRAYSIZE(pszPackagePath) - cchPackagePathRemaining - 1] != L'\\')
{
RETURN_IF_FAILED(StringCchCopyExW(pszPackagePathWritePtr, cchPackagePathRemaining,
L"\\", &pszPackagePathWritePtr, &cchPackagePathRemaining, 0));
}
RETURN_IF_FAILED(FindTypeInDirectory(pMetaDataDispenser, pszFullName,
pszPackagePath, phstrMetaDataFilePath, ppMetaDataImport, pmdTypeDef));
return S_OK;
}
HRESULT ResolveThirdPartyType(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszFullName,
_Out_opt_ HSTRING* phstrMetaDataFilePath,
_COM_Outptr_opt_result_maybenull_ IMetaDataImport2** ppMetaDataImport,
_Out_opt_ mdTypeDef* pmdTypeDef)
{
// Walk the package graph looking for the requested metadata
const uint32_t filter{ PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT | PACKAGE_FILTER_IS_IN_RELATED_SET | PACKAGE_FILTER_DYNAMIC | PACKAGE_FILTER_STATIC };
uint32_t bufferLength{};
uint32_t packagesCount{};
bool processHasStaticPackageGraph{};
const HRESULT hr{ HRESULT_FROM_WIN32(GetCurrentPackageInfo(filter, &bufferLength, nullptr, &packagesCount)) };
if (hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER))
{
// The process has a package graph. Walk it looking for the requested metadata
auto buffer{ wil::make_unique_nothrow<BYTE[]>(bufferLength) };
RETURN_IF_NULL_ALLOC(buffer);
RETURN_IF_WIN32_ERROR(GetCurrentPackageInfo(filter, &bufferLength, buffer.get(), &packagesCount));
const auto packageInfos{ reinterpret_cast<PACKAGE_INFO*>(buffer.get()) };
for (uint32_t index=0; index < packagesCount; ++index)
{
const auto& packageInfo{ packageInfos[index] };
HRESULT hrFindType{ FindTypeInDirectoryWithNormalization(pMetaDataDispenser, pszFullName,
packageInfo.path, phstrMetaDataFilePath, ppMetaDataImport, pmdTypeDef) };
if (SUCCEEDED(hrFindType))
{
return hrFindType;
}
// Keep track if we find any Static entries in the package graph
if (WI_IsFlagSet(packageInfo.flags, PACKAGE_PROPERTY_STATIC))
{
processHasStaticPackageGraph = true;
}
}
}
// Not found in the package graph.
// Unpackaged apps may have metadata next to their executable.
//
// Packaged apps have metadata in their root directory which is
// in the package graph and thus already checked.
//
// NOTE: Only packaged apps have Static entries in their package graph.
// Unpackaged apps have no Static entries in their package graph.
if (!processHasStaticPackageGraph)
{
PCWSTR exeDir{}; // Never freed; owned by process global.
RETURN_IF_FAILED(GetProcessExeDir(&exeDir));
const HRESULT hrFindType{ FindTypeInDirectoryWithNormalization(
pMetaDataDispenser, pszFullName, exeDir,
phstrMetaDataFilePath, ppMetaDataImport, pmdTypeDef) };
if (hrFindType == RO_E_METADATA_NAME_NOT_FOUND)
{
// For compatibility purposes, if we fail to find the type in the unpackaged location, we should return
// HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE) instead of a "not found" error. This preserves the
// behavior that existed before unpackaged type resolution was implemented.
return HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE);
}
RETURN_HR(hrFindType);
}
// Not found
return RO_E_METADATA_NAME_NOT_FOUND;
}
//
// MetaDataImportersLRUCache implementation
//
INIT_ONCE MetaDataImportersLRUCache::s_initOnce = INIT_ONCE_STATIC_INIT;
MetaDataImportersLRUCache* MetaDataImportersLRUCache::s_pMetaDataImportersLRUCacheInstance = nullptr;
MetaDataImportersLRUCache* MetaDataImportersLRUCache::GetMetaDataImportersLRUCacheInstance()
{
BOOL fInitializationSucceeded = InitOnceExecuteOnce(
&s_initOnce,
ConstructLRUCacheIfNecessary,
nullptr,
nullptr);
UNREFERENCED_PARAMETER(fInitializationSucceeded);
return s_pMetaDataImportersLRUCacheInstance;
}
// Called via InitOnceExecuteOnce.
BOOL CALLBACK MetaDataImportersLRUCache::ConstructLRUCacheIfNecessary(
PINIT_ONCE /*initOnce*/,
PVOID /*parameter*/,
PVOID* /*context*/)
{
HRESULT hr = S_OK;
if (s_pMetaDataImportersLRUCacheInstance == nullptr)
{
s_pMetaDataImportersLRUCacheInstance = new MetaDataImportersLRUCache();
if (s_pMetaDataImportersLRUCacheInstance == nullptr)
{
hr = E_OUTOFMEMORY;
}
}
return SUCCEEDED(hr);
}
HRESULT MetaDataImportersLRUCache::GetMetaDataImporter(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszCandidateFilePath,
_Outptr_opt_ IMetaDataImport2** ppMetaDataImporter)
{
if (ppMetaDataImporter == nullptr)
{
return ERROR_BAD_ARGUMENTS;
}
HRESULT hr = S_OK;
*ppMetaDataImporter = nullptr;
EnterCriticalSection(&_csCacheLock);
if (IsFilePathCached(pszCandidateFilePath))
{
// Get metadata importer from cache.
*ppMetaDataImporter = _metadataImportersMap[pszCandidateFilePath];
IMetaDataImport2* value = *ppMetaDataImporter;
if (value != nullptr)
{
value->AddRef();
}
}
else
{
// Importer was not found in cache.
hr = GetNewMetaDataImporter(
pMetaDataDispenser,
pszCandidateFilePath,
ppMetaDataImporter);
}
LeaveCriticalSection(&_csCacheLock);
return hr;
}
HRESULT MetaDataImportersLRUCache::GetNewMetaDataImporter(
_In_ IMetaDataDispenserEx* pMetaDataDispenser,
_In_ PCWSTR pszCandidateFilePath,
_Outptr_opt_ IMetaDataImport2** ppMetaDataImporter)
{
if (ppMetaDataImporter == nullptr)
{
return ERROR_BAD_ARGUMENTS;
}
HRESULT hr;
hr = pMetaDataDispenser->OpenScope(
pszCandidateFilePath,
ofReadOnly,
IID_IMetaDataImport2,
reinterpret_cast<IUnknown**>(ppMetaDataImporter));
if (SUCCEEDED(hr))
{
_metadataImportersMap.emplace(
pszCandidateFilePath,
*ppMetaDataImporter);
IMetaDataImport2* value = *ppMetaDataImporter;
if (value != nullptr)
{
value->AddRef();
}
}
if (SUCCEEDED(hr))
{
hr = AddNewFilePathToList(pszCandidateFilePath);
}
return hr;
}
HRESULT MetaDataImportersLRUCache::AddNewFilePathToList(PCWSTR pszFilePath)
{
HRESULT hr = RemoveLeastRecentlyUsedItemIfListIsFull();
if (SUCCEEDED(hr))
{
// Make room for new element.
for (int i = g_dwMetaDataImportersLRUCacheSize - 2; i >= 0; i--)
{
_arFilePaths[i + 1] = _arFilePaths[i];
}
_arFilePaths[0] = AllocateAndCopyString(pszFilePath);
if (_arFilePaths[0] == nullptr)
{
hr = E_OUTOFMEMORY;
}
}
return hr;
}
bool MetaDataImportersLRUCache::IsFilePathCached(PCWSTR pszFilePath)
{
int filePathIndex = GetFilePathIndex(pszFilePath);
if (filePathIndex != -1)
{
MoveElementToFrontOfList(filePathIndex);
return true;
}
else
{
return false;
}
}
int MetaDataImportersLRUCache::GetFilePathIndex(PCWSTR pszFilePath)
{
int filePathIndex = -1;
for (int i = 0; (i < g_dwMetaDataImportersLRUCacheSize) && (_arFilePaths[i] != nullptr); i++)
{
if (wcscmp(pszFilePath, _arFilePaths[i]) == 0)
{
filePathIndex = i;
break;
}
}
return filePathIndex;
}
void MetaDataImportersLRUCache::MoveElementToFrontOfList(int elementIndex)
{
PWSTR pszFoundFilePath = _arFilePaths[elementIndex];
for (int i = elementIndex - 1; i >= 0; i--)
{
_arFilePaths[i + 1] = _arFilePaths[i];
}
_arFilePaths[0] = pszFoundFilePath;
}
HRESULT MetaDataImportersLRUCache::RemoveLeastRecentlyUsedItemIfListIsFull()
{
HRESULT hr = S_OK;
PWSTR pszLastFilePathInList = _arFilePaths[g_dwMetaDataImportersLRUCacheSize - 1];
if (pszLastFilePathInList != nullptr)
{
IMetaDataImport2* value = _metadataImportersMap[pszLastFilePathInList];
if (value != nullptr)
{
value->Release();
value = nullptr;
}
if (!_metadataImportersMap.erase(pszLastFilePathInList))
{
hr = E_UNEXPECTED;
}
delete[] pszLastFilePathInList;
_arFilePaths[g_dwMetaDataImportersLRUCacheSize - 1] = nullptr;
}
return hr;
}
}