-
Notifications
You must be signed in to change notification settings - Fork 2
/
memory-mapped-files.ps1
24 lines (18 loc) · 1.1 KB
/
memory-mapped-files.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This is just a playground for working memory mapped files.
$output = 'output2'
$text = "blah blah blah"
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.MemoryMappedFiles")
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.MemoryMappedFiles.MemoryMappedFile")
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.MemoryMappedFiles.MemoryMappedViewStream")
<#[System.IO.MemoryMappedFiles.MemoryMappedFile]::CreateNew(
[string]$output,
[long] 50000)
#>
#secedit.exe /export /cfg $results >null
#$mmf = [System.IO.MemoryMappedFiles.MemoryMappedFile].GetMethod("CreateOrOpen")
[System.IO.MemoryMappedFiles.MemoryMappedFile]$mmf = [System.IO.MemoryMappedFiles.MemoryMappedFile].GetMethod('CreateNew()')
#$mmfva = [System.IO.MemoryMappedFiles.MemoryMappedViewAccessor]
[System.IO.MemoryMappedFiles.MemoryMappedViewAccessor]$mmfva = [System.IO.MemoryMappedFiles.MemoryMappedViewAccessor]::
$mmfwriter = [System.IO.MemoryMappedFiles.MemoryMappedViewStream].GetMethod('Write')
$mmfreader = [System.IO.MemoryMappedFiles.MemoryMappedViewStream].GetMethod('Read')
#$mmfreader.Invoke()