summaryrefslogtreecommitdiff
path: root/plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-12-24 21:30:41 +0000
committerRobert Pösel <robyer@seznam.cz>2012-12-24 21:30:41 +0000
commit367d9f6f71420e4c7ed5f273e04d280655bb3d7a (patch)
treed4bb82414145d3be020ab2b579bcd1947d8b6fa2 /plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h
parent0851c3965879663c41cfe435d1b320ba68cf873a (diff)
SMS plugin adopted (32bit version only)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2831 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h')
-rw-r--r--plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h b/plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h
new file mode 100644
index 0000000000..d2bb7a6671
--- /dev/null
+++ b/plugins/SMS/src/AdditionalFunctions/BuffToLowerCase.h
@@ -0,0 +1,56 @@
+#if !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_)
+#define AFX_BUFFTOLOWERCASE__H__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+
+__inline DWORD BuffToLowerCase(LPCVOID lpcOutBuff,LPCVOID lpcBuff,SIZE_T dwLen)
+{
+ DWORD dwRetErrorCode=NO_ERROR;
+
+ __asm
+ {
+ mov ecx,dwLen
+ test ecx,ecx
+ jz short end_func
+
+ push ebx // сохраняем регистр
+ push edi // сохраняем регистр
+ push esi // сохраняем регистр
+ mov esi,lpcBuff
+ mov edi,lpcOutBuff
+ mov bl,'A'
+ mov bh,'Z'
+ mov ah,32
+ cld
+
+ lowcaseloop:
+ lodsb
+ cmp al,bl
+ jl short savebyte
+ cmp al,bh
+ jg short savebyte
+ or al,ah
+
+ savebyte:
+ stosb
+
+ dec ecx
+ jnz short lowcaseloop
+
+ pop esi // восстанавливаем содержимое регистра
+ pop edi // восстанавливаем содержимое регистра
+ pop ebx // восстанавливаем содержимое регистра
+ end_func:
+ }
+
+return(dwRetErrorCode);
+}
+
+
+
+
+#endif // !defined(AFX_BUFFTOLOWERCASE__H__INCLUDED_) \ No newline at end of file