Search found 10 matches

by Zero Ray
Thu Jun 27, 2024 12:27 pm
Forum: Windows
Topic: Check whether a computer uses BIOS or UEFI
Replies: 10
Views: 6281

Re: Check whether a computer uses BIOS or UEFI

Little John wrote: Thu Jun 27, 2024 11:47 am See also this forum contribution.
The GetFirmwareType function is only available in version NT6.2 and higher
by Zero Ray
Thu Jun 27, 2024 10:20 am
Forum: Windows
Topic: Check whether a computer uses BIOS or UEFI
Replies: 10
Views: 6281

Re: Check whether a computer uses BIOS or UEFI


Not working.

my PC: Win10 Pro 64-bit, run on a MBR System Disk (this is Legacy Windows Environment).

(my MainBoard have support EFI Booting in BIOS Setup).

But, this code return #True.

Please fix code.


Try it

#SystemBootEnvironmentInformation = $5A

Structure _SYSTEM_BOOT_ENVIRONMENT ...
by Zero Ray
Sun Feb 04, 2024 2:42 am
Forum: Coding Questions
Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
Replies: 7
Views: 874

Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?


The value of the "Count" variable seems to be the number of entries, not the memory size.
And some variable types are incorrect.

Run it as an administrator.
EnableExplicit

Structure BootOrder
BootOrderList.l[128]
EndStructure

Prototype.l ProtoNtQueryBootEntryOrder(*Ids, *Count)

Global ...
by Zero Ray
Sat Feb 03, 2024 2:45 pm
Forum: Coding Questions
Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
Replies: 7
Views: 874

Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?

mk-soft wrote: Sat Feb 03, 2024 2:09 pm Here both result a same.

What OS and PB Version.
Windows 8.1 x64 And PureBasic 6.04 LTS x64
by Zero Ray
Sat Feb 03, 2024 1:50 pm
Forum: Coding Questions
Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
Replies: 7
Views: 874

Re: Why are the execution results in the procedure inconsistent with the results in the non-procedure ?

mk-soft wrote: Sat Feb 03, 2024 1:45 pm A Boolean ist not a Byte -> tmp.b -> tmp.i
After correcting it to tmp.i, the result is still the same
by Zero Ray
Sat Feb 03, 2024 1:03 pm
Forum: Coding Questions
Topic: [solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?
Replies: 7
Views: 874

[solved]Why are the execution results in the procedure inconsistent with the results in the non-procedure ?

EnableExplicit

Structure BootOrder
BootOrderList.l[128]
EndStructure

Prototype.l ProtoNtQueryBootEntryOrder(Ids.l, Count.l)

Global NtQueryBootEntryOrder.ProtoNtQueryBootEntryOrder

If OpenLibrary(0, "ntdll.dll")
NtQueryBootEntryOrder = GetFunction(0, "NtQueryBootEntryOrder")
EndIf

Procedure ...
by Zero Ray
Sat Jan 06, 2024 1:06 pm
Forum: Coding Questions
Topic: [solved] How to get a string from an element of data type unicode in a structure
Replies: 9
Views: 1495

Re: How to get a string from an element of data type unicode in a structure


Is used as a normal string.
But don't know what the API call looks like. Please provide a description


Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.s{128}
EndStructure

Define api_dummy.BootOrder

api_dummy\BootOrderList = "xyz"

r1.s = api_dummy\BootOrderList
Debug r1 ...
by Zero Ray
Sat Jan 06, 2024 12:17 pm
Forum: Coding Questions
Topic: [solved] How to get a string from an element of data type unicode in a structure
Replies: 9
Views: 1495

Re: How to get a string from an element of data type unicode in a structure

Fred wrote: Sat Jan 06, 2024 11:34 am For this case, you can also use fixed strings to use it directly:

Code: Select all

Structure BootOrder Align #PB_Structure_AlignC
  BootOrderList.s{128}
EndStructure
Can you give a full example? Thanks,
by Zero Ray
Sat Jan 06, 2024 11:14 am
Forum: Coding Questions
Topic: [solved] How to get a string from an element of data type unicode in a structure
Replies: 9
Views: 1495

Re: How to get a string from an element of data type unicode in a structure

infratec wrote: Sat Jan 06, 2024 10:32 am I would use:

Code: Select all

PeekS(@EFILoadOption\Description[0])
Solved! Thanks for your help!
by Zero Ray
Sat Jan 06, 2024 7:05 am
Forum: Coding Questions
Topic: [solved] How to get a string from an element of data type unicode in a structure
Replies: 9
Views: 1495

[solved] How to get a string from an element of data type unicode in a structure

Hello everyone!
I've tried enumerating the UEFI startup entries with the following code:
EnableExplicit

Structure BootOrder Align #PB_Structure_AlignC
BootOrderList.w[128]
EndStructure

Structure _EFI_LOAD_OPTION Align #PB_Structure_AlignC
Attributes.l
FilePathListLength.w
Description.u[256 ...