News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

QE 4.0f update

Started by hutch--, July 15, 2010, 03:46:42 AM

Previous topic - Next topic

hutch--

With thanks to one of our members, a very obscure bug turned up in QE, if the text for an F1 selected word was over a certain length, it crashed the editor. Tracked it down and it was the stack size settings were too small for thre local buffer sizes in the appropriate proc which restricted the effective buffer size for other data. Solved that problem only to find that WINHELP did not like massively long lines passed to it anyway so I restricted the text length passed to it to 256 characters and all seems to be well.

Just plonk it in the masm32 directory overwriting the current version and it will work as normal.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

i bet that was a fun one to find   :P

a similar bug exists in some versions of XP fc.exe   :eek
as it turns out, if a tab or space appears in character number 121 to 127 on a line, fc chokes - lol
there is a hotfix for it - KB953930

btw - i ain't plonkin' nuthin - lol

oex

:bg Hutch has it easy.... If there is a bug it's a bit of a rep hit but it's going to be found and described in stunning detail.... I used to work for a 'computers for dummies' style website and when there was a bug you would get such random feedback on it it was impossible to know what the bug was to fix it.... Usually the bug was the customer.... Queries like 'I download the application, where do I find it?' were common :lol.... Major issues tended to be dragging and dropping, double clicking, go to file etc etc :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

i know exactly what you mean
i have helped a number of spades players with problems
using messenger, i have to give them a brief lesson in Windows Explorer before we can get down to business - lol
it amazes me how many computer users don't even know what it is

as for Hutch having it easy - i don't envy him
version tracking for masm32, alone, has got to be a headache
not to mention actually updating it   :P

on a related note, i see that ms has gone to 7-digit KB numbers
they jumped from KB98xxxx to KB2229593
great - now i will have no idea which came first - lol
not to mention what it is going to do to the columns in my document
why couldn't they go.....
KC000000                  - DOH !!!!

oex

:lol this was 'back in the day'.... These guys didnt have Instant Messaging it was all email :(.... Email after email repeating and rephrasing the simplest issues ::)

It is true, I jest, the Masm32 package is rather large and as with all software it's like an iceburg.... 9/10ths of it you dont see when it's done professionally

@KB: It's so you think they're actually doing something.... :lol
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

 :lol

yah - whatever happened to KB0000000 to KB2229592 ?
that's a lot of KB numbers in there
if they were smart - they would have used the 7-digit numbers for windows 7  - duh
(seems like a moronic kindergartner could have came up with that one)

btw - i see it has messed up their own website
try googling "XP KB2264107" - then go to the ms d/l page - lol

well - we have made a mess out of Hutch's thread, now - let's leave him alone for a while - lol

frktons

It looks different, with a new blue style, cool  :8)
Mind is like a parachute. You know what to do in order to use it :-)

cork

If the clipboard contains non-text, for instance if you press your PrtScn button....
Then if you select Edit/Clipboard from the main menu, the QEditor crashes.
If there is text in the clipboard, then it works fine of course.


hutch--

cork,

Thanks, I know that one, if the clipboard does not contain any text then the clipboard function returns the wrong value. I have to set up a method of testing it so I can design a work around.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

cork

This is how I test the clipboard to see if it contains any text data.

I just call my clip_contains_text procedure, below, and then if EAX equals 0, the clipboard does not contain text.

It's mostly just a matter of having the time to open the code and put the change in place, which I realize in and of itself ain't so easy when you have a big project to maintain and lots of stuff to do.

;
;  This procedure tests whether the clipboard contains any text data.
;  Return value: EAX contains 0 if no text in clipboard.
;
clip_contains_text PROC NEAR
    local dwHandle:DWORD
    invoke OpenClipboard, 0        ; 0=NULL
    invoke GetClipboardData, 13   ; CF_TEXT=1, CF_UNICODETEXT=13
    mov dwHandle, EAX
    invoke CloseClipboard
    mov EAX, dwHandle
    ret
clip_contains_text ENDP

hutch--

cork,

You may like this one, it only occurs directly after a boot when the clipboard contains no content. You can write to the clipboard and clear it and there is no problem but if the machine has been booted and the clipboard has not been used the return value from OpenClipboard() appears not to be valid.

This is the algo used.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

GetClipboardText proc

    push ebx
    push esi
    push edi

    ; --------------------------------------------------------
    ; if the return value is not zero, deallocate the returned
    ; memory handle with GlobalFree() or the macro "free" when
    ; the data is no longer required.
    ; --------------------------------------------------------
    invoke OpenClipboard,NULL                   ; open clipboard
    .if rv(IsClipboardFormatAvailable,CF_TEXT) != 0 ; if text available
      invoke GetClipboardData,CF_TEXT           ; get pointer to text
      mov ebx, eax
      invoke StrLen,eax                         ; get text length
      mov esi, eax
      mov edi, alloc(esi)                       ; allocate that much memory
      cst edi, ebx
      invoke CloseClipboard                     ; close the clipboard
      mov eax, edi                              ; return memory handle
      jmp bye
    .else                                       ; else
      xor eax, eax                              ; set return to zero
      invoke CloseClipboard                     ; close the clipboard
      jmp bye
    .endif

  bye:
    pop edi
    pop esi
    pop ebx

    ret

GetClipboardText endp

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««


What I will have to do is set up a test piece to test what the return value is when the clipboard has not been used yet.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

i'd like to know how you fix that, Hutch   :P

hutch--

When I get time to fix it I will tell you.  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Yuri

Btw, IsClipboardFormatAvailable seems to work without opening the clipboard.

dedndave

    invoke OpenClipboard,NULL                   ; open clipboard
    .if rv(IsClipboardFormatAvailable,CF_TEXT) != 0 ; if text available


no test is made to insure OpenClipboard was successful

    .else                                       ; else
      xor eax, eax                              ; set return to zero
      invoke CloseClipboard                     ; close the clipboard
      jmp bye


EAX will only be zero if CloseClipboard fails

    .else                                       ; else
      invoke CloseClipboard                     ; close the clipboard
      xor eax, eax                              ; set return to zero
      jmp bye