File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2214,13 +2214,17 @@ PPH_STRING PhReferenceEmptyString(
2214
2214
PPH_STRING string ;
2215
2215
PPH_STRING newString ;
2216
2216
2217
- string = PhSharedEmptyString ;
2217
+ string = InterlockedCompareExchangePointer (
2218
+ & PhSharedEmptyString ,
2219
+ NULL ,
2220
+ NULL
2221
+ );
2218
2222
2219
2223
if (!string )
2220
2224
{
2221
2225
newString = PhCreateStringEx (NULL , 0 );
2222
2226
2223
- string = _InterlockedCompareExchangePointer (
2227
+ string = InterlockedCompareExchangePointer (
2224
2228
& PhSharedEmptyString ,
2225
2229
newString ,
2226
2230
NULL
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ LSA_HANDLE PhGetLookupPolicyHandle(
64
64
65
65
// Use the cached value if possible.
66
66
67
- lookupPolicyHandle = cachedLookupPolicyHandle ;
67
+ lookupPolicyHandle = InterlockedCompareExchangePointer ( & cachedLookupPolicyHandle , NULL , NULL ) ;
68
68
69
69
// If there is no cached handle, open one.
70
70
@@ -79,7 +79,7 @@ LSA_HANDLE PhGetLookupPolicyHandle(
79
79
// We succeeded in opening a policy handle, and since we did not have a cached handle
80
80
// before, we will now store it.
81
81
82
- lookupPolicyHandle = _InterlockedCompareExchangePointer (
82
+ lookupPolicyHandle = InterlockedCompareExchangePointer (
83
83
& cachedLookupPolicyHandle ,
84
84
newLookupPolicyHandle ,
85
85
NULL
Original file line number Diff line number Diff line change @@ -2201,14 +2201,14 @@ PPH_STRING PhGetSystemDirectory(
2201
2201
2202
2202
// Use the cached value if possible.
2203
2203
2204
- if (cachedSystemDirectory )
2205
- return PhReferenceObject (cachedSystemDirectory );
2204
+ if (systemDirectory = InterlockedCompareExchangePointer ( & cachedSystemDirectory , NULL , NULL ) )
2205
+ return PhReferenceObject (systemDirectory );
2206
2206
2207
2207
PhGetSystemRoot (& systemRootString );
2208
2208
systemDirectory = PhConcatStringRef2 (& systemRootString , & system32String );
2209
2209
2210
2210
// Try to cache the value.
2211
- if (_InterlockedCompareExchangePointer (
2211
+ if (InterlockedCompareExchangePointer (
2212
2212
& cachedSystemDirectory ,
2213
2213
systemDirectory ,
2214
2214
NULL
You can’t perform that action at this time.
0 commit comments