summaryrefslogtreecommitdiff
path: root/plugins/SMS/AdditionalFunctions/BuffToLowerCase.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-07-12 12:09:32 +0000
committerRobert Pösel <robyer@seznam.cz>2012-07-12 12:09:32 +0000
commit9c62ad6bb204781819184f772992fec768cb4418 (patch)
treeb0cee1e1eaf09a79817eb138b396001acaa8d73e /plugins/SMS/AdditionalFunctions/BuffToLowerCase.h
parent0b26ecf091dcde8e2e153c331b0015697966a4cc (diff)
Added SMS (not adopted yet)
git-svn-id: http://svn.miranda-ng.org/main/trunk@919 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SMS/AdditionalFunctions/BuffToLowerCase.h')
-rw-r--r--plugins/SMS/AdditionalFunctions/BuffToLowerCase.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/SMS/AdditionalFunctions/BuffToLowerCase.h b/plugins/SMS/AdditionalFunctions/BuffToLowerCase.h
new file mode 100644
index 0000000000..d2bb7a6671
--- /dev/null
+++ b/plugins/SMS/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