flat assembler
Message board for the users of flat assembler.

Index > Windows > GUID gone from EQUATES/KERNEL32.INC?

Author
Thread Post new topic Reply to topic
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Last time I really used them was with FASM 1.52, and a GUID struct was defined in EQUATES/KERNEL32.INC as part of standard include files.

I notice that GUID struct is no longer defined in that file, in FASM 1.67.26.

Just wondering why it was removed.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 09 Jul 2008, 06:44
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
I notice the USECOM example uses this:
Code:
struc GUID def
 {
   match d1-d2-d3-d4-d5, def
    \{
      .Data1 dd 0x\#d1
      .Data2 dw 0x\#d2
      .Data3 dw 0x\#d3
      .Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh
      .Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh
    \}
 }    


Why isn't this part of standard includes? Just wondering too...
Post 09 Jul 2008, 06:45
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
comrade wrote:
Why isn't this [GUID] part of standard includes? Just wondering too...
Maybe because there is no error checking done. If the match fails then you get nothing assembled and no warning is given. Better to not include it to avoid potential ugly bugs.
Post 09 Jul 2008, 06:51
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Right, I was going to ask about that too. But I knew someone would get to it.

Can you come up with a single version that assembles an uninitialized GUID if nothing is given, and something if something is given? Or is that impossible?
Post 09 Jul 2008, 16:53
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
Try this:
Code:
struc GUID def
 {
   local pending
   match d1-d2-d3-d4-d5, def 
    \{
      label . byte
      .Data1 dd 0x\#d1 
      .Data2 dw 0x\#d2 
      .Data3 dw 0x\#d3 
      .Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh 
      .Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh
      pending equ
    \}
  match =pending,pending
   \{
      . db 16 dup (?)
      if ~ def eq
       display 'Warning: incorrect GUID ',`.,' value, uninitialized value used instead.'
      end if
   \}
 }    
Post 09 Jul 2008, 17:00
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
comrade wrote:
Can you come up with a single version that assembles an uninitialized GUID if nothing is given, and something if something is given? Or is that impossible?
Yes, it is quite easy to do. You can assign a label to track if the match succeeded. You can see this happening in the pushd macro.

[edit]Bugger, Tomasz gave the game away. I was going to let comrade think about it for a day or so before posting.[/edit]
Post 09 Jul 2008, 17:02
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7725
Location: Kraków, Poland
Tomasz Grysztar
You forgot how it used to be here when I was active, didn't you? Wink
Post 09 Jul 2008, 17:13
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
Tomasz Grysztar wrote:
You forgot how it used to be here when I was active, didn't you? Wink
Yes, I did. I must have a short memory.

Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for life.


So can you help me with my OS? I've got as far as the for line "format binary", but from there I am stuck. Feel free to post the entire code with working examples and documentation. Thanks
Post 10 Jul 2008, 00:37
View user's profile Send private message Visit poster's website Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
This is all very confusing.
Post 10 Jul 2008, 06:36
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Can you please explain this line:
Quote:
if ~ def eq


If something is not defined but equal to something? What????
Post 10 Jul 2008, 06:37
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
That line checks for the macro being called with a non-blank parameter "def". It means: if "def" not-equal-to null.
Post 10 Jul 2008, 07:04
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.