Author Topic: knownfolders.h  (Read 212 times)

LiaoMi

  • Member
  • ****
  • Posts: 872
knownfolders.h
« on: April 04, 2021, 06:35:40 AM »
Hi TouEnMasm,

are you sure that knownfolders.h file is translated correctly? The problem is not the name, your version looks like

Code: [Select]
;
;    Copyright (C) Microsoft.  All rights reserved.
;
;ECHO   once
Include winapifamily.inc
;ECHO   region Desktop Family
IF  WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
IFDEF DEFINE_KNOWN_FOLDER
ENDIF
IF DEFINED(INITGUID) OR DEFINED(INITKNOWNFOLDERS)
ELSE
DEFINE_KNOWN_FOLDER equ < name_, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8>
ENDIF ; INITGUID || INITKNOWNFOLDERS
; legacy CSIDL value: CSIDL_NETWORK
; display name: "Network"
; legacy display name: "My Network Places"
; default path:
; {D20BEEC4-5CA8-4905-AE3B-BF251EA09B53}
DEFINE_KNOWN_FOLDER PROTO :FOLDERID_NetworkFolder ,:0xD20BEEC4 ,:0x5CA8 ,:0x4905 ,:0xAE ,:0x3B ,:0xBF ,:0x25 ,:0x1E ,:0xA0 ,:0x9B ,:0x53
; {0AC0837C-BBF8-452A-850D-79D08E667CA7}
DEFINE_KNOWN_FOLDER PROTO :FOLDERID_ComputerFolder ,:0x0AC0837C ,:0xBBF8 ,:0x452A ,:0x85 ,:0x0D ,:0x79 ,:0xD0 ,:0x8E ,:0x66 ,:0x7C ,:0xA7
; {4D9F7874-4E0C-4904-967B-40B0D20C3E4B}

I get an error with any name
Code: [Select]
Assembling: security.asm
Translated Windows SDK 10.0 32 bits
C:\masm64\sdkrc100\um\knownfolders.inc(19) : error A2008: syntax error : name_
 C:\masm64\sdkrc100\um\knownfolders.inc(19): Included by
  C:\masm64\sdkrc100\um\shlguid.inc(503): Included by
   C:\masm64\sdkrc100\um\ShlObj.inc(85): Included by
    security.asm(20): Main line code

This is how it looks from the package ObjAsm or ASMC..

ObjAsm
Code: [Select]
;Include file created by h2incX, Version B.01.01, 10/09/2018 22:03
;(C) 2018-today by Biterider, 2005-2009 by Japheth
;Source file: '\ObjAsm\Projects\h2IncX\header\knownfolders.h', last modified: 19/04/2018 10:46
;Creation parameters:

include winapifamily.inc
if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  ifdef DEFINE_KNOWN_FOLDER
  endif
  if Defined(INITGUID) or Defined(INITKNOWNFOLDERS)
    DEFINE_KNOWN_FOLDER macro name_, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8
      externdef name_:GUID
      name_ GUID { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
    endm
  else
    DEFINE_KNOWN_FOLDER macro name_, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8
      ;Creare a symbol with a GUID formatet conten => 00000000-0000-0000-0000-000000000000
      externdef name_:GUID
      @CatStr(<s>,name_,< textequ !<>,sGUIDf(l,8),<->,sGUIDf(w1,4),<->,sGUIDf(w2,4),<->,sGUIDf(b1,2),sGUIDf(b2,2),<->,sGUIDf(b3,2),sGUIDf(b4,2),sGUIDf(b5,2),sGUIDf(b6,2),sGUIDf(b7,2),sGUIDf(b8,2),<!>>)
    endm
  endif
  DEFINE_KNOWN_FOLDER FOLDERID_NetworkFolder, 0D20BEEC4h, 5CA8h, 4905h, 0AEh, 3Bh, 0BFh, 25h, 1Eh, 0A0h, 9Bh, 53h
  DEFINE_KNOWN_FOLDER FOLDERID_ComputerFolder, 0AC0837Ch, 0BBF8h, 452Ah, 85h, 0Dh, 79h, 0D0h, 8Eh, 66h, 7Ch, 0A7h
  DEFINE_KNOWN_FOLDER FOLDERID_InternetFolder, 4D9F7874h, 4E0Ch, 4904h, 96h, 7Bh, 40h, 0B0h, 0D2h, 0Ch, 3Eh, 4Bh

ASMC
Code: [Select]
DEFINE_KNOWN_FOLDER macro name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8
ifdef __PE__
_&name& equ <{l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}>
elseifdef INITGUID
echo name GUID {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
else
externdef name:GUID
endif
    exitm<>
    endm

DEFINE_KNOWN_FOLDER(FOLDERID_NetworkFolder, 0xD20BEEC4, 0x5CA8, 0x4905, 0xAE, 0x3B, 0xBF, 0x25, 0x1E, 0xA0, 0x9B, 0x53)
DEFINE_KNOWN_FOLDER(FOLDERID_ComputerFolder,   0x0AC0837C, 0xBBF8, 0x452A, 0x85, 0x0D, 0x79, 0xD0, 0x8E, 0x66, 0x7C, 0xA7)

Only the version from @Biterider works with your SDK ... I use ASMC for final release.