Assembles fine but wants to send MS an error report when I run it.


; Section I'm trying to add to win.ini
             
            weights=45                   

; wri_prof.asm Add a section in win.ini
.486                     
    .model flat, stdcall      ; 32 bit memory model
    option casemap :none      ; case sensitive


    include \masm32\include\windows.inc
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\Comctl32.inc
    include \masm32\include\comdlg32.inc
    include \masm32\include\shell32.inc
    include \masm32\include\oleaut32.inc
    include \masm32\macros\macros.asm

    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\Comctl32.lib
    includelib \masm32\lib\comdlg32.lib
    includelib \masm32\lib\shell32.lib
    includelib \masm32\lib\oleaut32.lib


.data
                                        ; Section I'm trying to put in win.ini
      name    BYTE    "data", 0            ;
      key    BYTE    "weights",0          ; weights=45                       
      value  BYTE    "45",0                                     
   
.code

start:

main proc   
                          ; section name - pointer to key name- pointer to string
invoke WriteProfileString, "name", offset key, offset value


    invoke ExitProcess,0

main endp

end start[\code]
Posted on 2006-03-06 19:15:36 by skywalker
  .data?
szProfileName dd MAX_PATH dup (?)

  .code
local @szBuffer[512]:byte

invoke  WritePrivateProfileString,addr szSec,addr szKey,addr @szBuffer,addr szProfileName

========================
try to use WritePrivateProfileString
Posted on 2006-03-07 01:08:39 by Eric4ever
invoke WriteProfileString, offset name, offset key, offset value

Posted on 2006-03-07 04:05:41 by Shoo