11
22/* ********************************************************************
33* *
4- * Memory List Manager Version 1.0 *
4+ * Memory List Manager Version 1.1 *
55* (Main module) *
66* A simple tool to free standby memory and flush caches. *
77* *
88* Requirements: *
9- * -Windows XP or newer (note: Some functions require Windows 8 or *
10- * or Windows 8.1). *
9+ * -Windows XP or newer (note: Some functions require Windows 7, *
10+ * or Windows 8/Windows 8 .1). *
1111* -This program generally must be run as admin for all commands. *
1212* Specifically, most operations require the *
1313* SeProfileSingleProcessPrivilege and emptying the file cache *
3434* Project home page: https://github.com/fafalone/MemListMgr *
3535* *
3636* Changelog *
37+ * Version 1.1 (13 Jun 2024) - SetCursor calls fixed. *
3738* Version 1.0 (13 Jun 2024) - Initial release. *
3839* *
3940***********************************************************************
@@ -152,44 +153,44 @@ Module modMemListMgr
152153 nCmd = MemoryPurgeStandbyList
153154 End If
154155 Dim status As NTSTATUS
155- SetCursor IDC_WAIT
156+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
156157 status = NtSetSystemInformation(SystemMemoryListInformation, nCmd, LenB(nCmd))
157- SetCursor IDC_ARROW
158+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
158159 Return status
159160 End Function
160161
161162 Public Function FlushModified() As NTSTATUS
162163 Dim nCmd As SYSTEM_MEMORY_LIST_COMMAND = MemoryFlushModifiedList
163164 Dim status As NTSTATUS
164- SetCursor IDC_WAIT
165+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
165166 status = NtSetSystemInformation(SystemMemoryListInformation, nCmd, LenB(nCmd))
166- SetCursor IDC_ARROW
167+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
167168 Return status
168169 End Function
169170
170171 Public Function EmptyWorkingSets() As NTSTATUS
171172 Dim nCmd As SYSTEM_MEMORY_LIST_COMMAND = MemoryEmptyWorkingSets
172173 Dim status As NTSTATUS
173- SetCursor IDC_WAIT
174+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
174175 status = NtSetSystemInformation(SystemMemoryListInformation, nCmd, LenB(nCmd))
175- SetCursor IDC_ARROW
176+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
176177 Return status
177178 End Function
178179
179180 Public Function CombinePages(Optional pNumCombined As LongLong) As NTSTATUS
180181 Dim mci As MEMORY_COMBINE_INFORMATION_EX
181182 Dim status As NTSTATUS
182- SetCursor IDC_WAIT
183+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
183184 status = NtSetSystemInformation(SystemCombinePhysicalMemoryInformation, mci, LenB(Of MEMORY_COMBINE_INFORMATION_EX))
184185 pNumCombined = mci.PagesCombined
185- SetCursor IDC_ARROW
186+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
186187 Return status
187188 End Function
188189
189190 Public Function FlushRegistryCache() As NTSTATUS
190- SetCursor IDC_WAIT
191+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
191192 FlushRegistryCache = NtSetSystemInformation(SystemRegistryReconciliationInformation, ByVal 0&, 0&)
192- SetCursor IDC_ARROW
193+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
193194 End Function
194195
195196 Public Function FlushFileCache(Optional pSize As LongLong) As NTSTATUS
@@ -198,7 +199,7 @@ Module modMemListMgr
198199 Dim status As NTSTATUS
199200 Dim bRet As Byte
200201 Dim cb As Long
201- SetCursor IDC_WAIT
202+ SetCursor LoadCursor(0, ByVal IDC_WAIT)
202203 status = RtlAdjustPrivilege(SE_INCREASE_QUOTA_PRIVILEGE, 1, 0, bRet)
203204 status = NtQuerySystemInformation(SystemFileCacheInformationEx, sfi, LenB(Of SYSTEM_FILECACHE_INFORMATION), cb)
204205 If NT_SUCCESS(status) Then
@@ -207,7 +208,7 @@ Module modMemListMgr
207208 status = NtSetSystemInformation(SystemFileCacheInformationEx, sfiSet, LenB(Of SYSTEM_FILECACHE_INFORMATION))
208209 pSize = sfi.CurrentSize
209210 End If
210- SetCursor IDC_ARROW
211+ SetCursor LoadCursor(0, ByVal IDC_ARROW)
211212 Return status
212213 End Function
213214
0 commit comments