@@ -83,15 +83,15 @@ type CvtResFile() =
83
83
pAdditional.DataSize <- cbData
84
84
pAdditional.pstringType <- CvtResFile.ReadStringOrID reader
85
85
pAdditional.pstringName <- CvtResFile.ReadStringOrID reader
86
- stream.Position <- stream.Position + 3 L &&& ~~~ 3 L
86
+ stream.Position <- stream.Position + 3 L &&& ~~~ 3 L
87
87
pAdditional.DataVersion <- reader.ReadUInt32()
88
88
pAdditional.MemoryFlags <- reader.ReadUInt16()
89
89
pAdditional.LanguageId <- reader.ReadUInt16()
90
90
pAdditional.Version <- reader.ReadUInt32()
91
91
pAdditional.Characteristics <- reader.ReadUInt32()
92
92
pAdditional.data <- Array.zeroCreate ( int pAdditional.DataSize)
93
93
reader.Read( pAdditional.data, 0 , pAdditional.data.Length) |> ignore< int>
94
- stream.Position <- stream.Position + 3 L &&& ~~~ 3 L
94
+ stream.Position <- stream.Position + 3 L &&& ~~~ 3 L
95
95
96
96
if
97
97
pAdditional.pstringType.theString = Unchecked.defaultof<_>
@@ -174,6 +174,7 @@ type SectionCharacteristics =
174
174
type ResourceSection () =
175
175
new ( sectionBytes: byte[], relocations: uint32[]) as this =
176
176
( ResourceSection())
177
+
177
178
then
178
179
Debug.Assert( sectionBytes :> obj <> Unchecked.defaultof<_>)
179
180
Debug.Assert( relocations :> obj <> Unchecked.defaultof<_>)
@@ -374,13 +375,8 @@ type VersionHelper() =
374
375
///
375
376
/// <returns>True when parsing succeeds completely (i.e. every character in the string was consumed), false otherwise.</returns>
376
377
static member private TryParse
377
- (
378
- s : string ,
379
- allowWildcard : bool ,
380
- maxValue : uint16 ,
381
- allowPartialParse : bool ,
382
- [<Out>] version : byref < Version >
383
- ) =
378
+ ( s : string , allowWildcard : bool , maxValue : uint16 , allowPartialParse : bool , [<Out>] version : byref < Version >)
379
+ =
384
380
Debug.Assert( not allowWildcard || maxValue < UInt16.MaxValue)
385
381
386
382
if String.IsNullOrWhiteSpace s then
@@ -520,20 +516,24 @@ type VersionResourceSerializer() =
520
516
521
517
member val private _isDll = Unchecked.defaultof< bool> with get, set
522
518
523
- new ( isDll: bool,
524
- comments: string,
525
- companyName: string,
526
- fileDescription: string,
527
- fileVersion: string,
528
- internalName: string,
529
- legalCopyright: string,
530
- legalTrademark: string,
531
- originalFileName: string,
532
- productName: string,
533
- productVersion: string,
534
- assemblyVersion: Version) as this =
519
+ new
520
+ (
521
+ isDll: bool,
522
+ comments: string,
523
+ companyName: string,
524
+ fileDescription: string,
525
+ fileVersion: string,
526
+ internalName: string,
527
+ legalCopyright: string,
528
+ legalTrademark: string,
529
+ originalFileName: string,
530
+ productName: string,
531
+ productVersion: string,
532
+ assemblyVersion: Version
533
+ ) as this =
535
534
536
535
VersionResourceSerializer()
536
+
537
537
then
538
538
this._ isDll <- isDll
539
539
this._ commentsContents <- comments
@@ -620,7 +620,7 @@ type VersionResourceSerializer() =
620
620
static member private PadKeyLen ( cb : int ) =
621
621
VersionResourceSerializer.PadToDword( cb + 3 * sizeof< WORD>) - 3 * sizeof< WORD>
622
622
623
- static member private PadToDword ( cb : int ) = cb + 3 &&& ~~~ 3
623
+ static member private PadToDword ( cb : int ) = cb + 3 &&& ~~~ 3
624
624
625
625
static member val private HDRSIZE = ( int ( 3 * sizeof< uint16>)) with get, set
626
626
@@ -667,7 +667,7 @@ type VersionResourceSerializer() =
667
667
let mutable ( sum : int ) = 0
668
668
669
669
for verString in this.GetVerStrings() do
670
- sum <- sum + 3 &&& ~~~ 3
670
+ sum <- sum + 3 &&& ~~~ 3
671
671
sum <- sum + VersionResourceSerializer.SizeofVerString( verString.Key, verString.Value)
672
672
673
673
sum
@@ -801,7 +801,7 @@ type VersionResourceSerializer() =
801
801
802
802
for entry in this.GetVerStrings() do
803
803
let mutable writerPos = writer.BaseStream.Position
804
- writer.Write( Array.zeroCreate ( int (( writerPos + 3 L) &&& ~~~ 3 L - writerPos)): byte[])
804
+ writer.Write( Array.zeroCreate ( int (( writerPos + 3 L) &&& ~~~ 3 L - writerPos)): byte[])
805
805
Debug.Assert( entry.Value <> Unchecked.defaultof<_>)
806
806
VersionResourceSerializer.WriteVersionString( entry, writer)
807
807
@@ -861,7 +861,7 @@ type Win32ResourceConversions() =
861
861
let mutable ( i : uint16 ) = 0 us
862
862
863
863
while ( i < count) do
864
- resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
864
+ resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
865
865
resWriter.Write iconDirEntries[( int i)]. dwBytesInRes
866
866
resWriter.Write 0x00000020 u
867
867
resWriter.Write 0xFFFF us
@@ -878,7 +878,7 @@ type Win32ResourceConversions() =
878
878
i <- i + 1 us
879
879
880
880
let mutable ( RT_GROUP_ICON : WORD ) = ( RT_ ICON + 11 us)
881
- resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
881
+ resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
882
882
resWriter.Write( uint32 ( 3 * sizeof< WORD> + int count * 14 ))
883
883
resWriter.Write 0x00000020 u
884
884
resWriter.Write 0xFFFF us
@@ -933,7 +933,7 @@ type Win32ResourceConversions() =
933
933
let comments = ( defaultArg comments) Unchecked.defaultof<_>
934
934
let companyName = ( defaultArg companyName) Unchecked.defaultof<_>
935
935
let mutable resWriter = new BinaryWriter( resStream, Encoding.Unicode)
936
- resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
936
+ resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L
937
937
let mutable ( RT_VERSION : DWORD ) = 16 u
938
938
939
939
let mutable ver =
@@ -970,7 +970,7 @@ type Win32ResourceConversions() =
970
970
Debug.Assert( resStream.Position - startPos = int64 dataSize + int64 headerSize)
971
971
972
972
static member AppendManifestToResourceStream ( resStream : Stream , manifestStream : Stream , isDll : bool ) =
973
- resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L (* ERROR UnknownPrefixOperator "~" *)
973
+ resStream.Position <- resStream.Position + 3 L &&& ~~~ 3 L (* ERROR UnknownPrefixOperator "~" *)
974
974
let mutable ( RT_MANIFEST : WORD ) = 24 us
975
975
let mutable resWriter = new BinaryWriter( resStream)
976
976
resWriter.Write( uint32 manifestStream.Length)
0 commit comments