News:

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

string safe functions

Started by abitlater, January 07, 2008, 09:50:29 PM

Previous topic - Next topic

abitlater

is there an include file and library for safe string functions, like strsafe.lib, somewhere?  I don't see this in my MASM32 library

Thanks
aBitLater

Vortex

strsafe.h and strsafe.lib are the components of PSDK. I guess this is why the Masm32 package does not include them. ( More precisely, strsafe.lib is a MS static library.)

GregL

abitlater,

Here is an include file I started. I never got to the 'Character Count' functions.


; 'Safe String' Functions
;
; 'strsafe.h' and 'strsafe.lib' are in the Platform SDK
;
; All functions are STDCALL except
; StringCbPrintfA due to :VARARG
;
; Greg Lyon - March 2005
;
;
; 'Byte Count' Functions
;
; Tested and working
;
StringCbCatA        PROTO :PTR BYTE, :DWORD, :PTR BYTE
StringCbCat         EQU <StringCbCatA>

StringCbCopyA       PROTO :PTR BYTE, :DWORD, :PTR BYTE
StringCbCopy        EQU <StringCbCopyA>

StringCbLengthA     PROTO :PTR BYTE, :DWORD, :DWORD
StringCbLength      EQU <StringCbLengthA>

StringCbPrintfA     PROTO C :PTR BYTE, :DWORD, :PTR BYTE, :VARARG
StringCbPrintf      EQU <StringCbPrintfA>


; Not tested
;
;StringCbCatNA       PROTO :PTR BYTE, :DWORD, :PTR BYTE, :DWORD
;StringCbCatN        EQU <StringCbCatNA>
;
;StringCopyNA        PROTO :PTR BYTE, :DWORD, :PTR BYTE, :DWORD
;StringCbCopyN       EQU <StringCopyNA>
;
;StringCbVPrintfA    PROTO :PTR BYTE, :DWORD, :PTR BYTE, :PTR BYTE
;StringCbVPrintf     EQU <StringCbVPrintfA>



ToutEnMasm



askm

Cannot compile a strsafe example with function such as StringCbCopyA:

______snip_________
.586
.model flat, stdcall
option casemap:none

include \masm32\include\windows.inc

include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\msvcrt.inc
include \masm32\strsafe\strsafe.inc from forementioned
include \masm32\include\masm32.inc
include \masm32\macros\macros.asm

includelib \masm32\lib\user32.lib
includelib \masm32\strsafe\strsafe.lib from sdk
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\msvcrt.lib
includelib \masm32\lib\masm32.lib
______snip_________

...

Are these the proper prereqs more or less ?

Vortex

Hi askm,

What's the error message you are receiving?