1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
/*字符串的比较 by exchen 2009-10-02 */ #include <ntddk.h> VOID DriverUnload( IN PDRIVER_OBJECT DriverObject ) { DbgPrint("驱动已经被停止了\n"); } NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath ) { UNICODE_STRING usDes; UNICODE_STRING usScr; int comp = 0; RtlInitUnicodeString(&usScr,L"My source string"); RtlInitUnicodeString(&usDes,L"My Compare string"); comp = RtlCompareUnicodeString(&usScr,&usDes,TRUE); if(comp == 0) { DbgPrint("字符串相同\n"); } if(comp > 0) { DbgPrint("第一个字符串大于第二个\n"); } if(comp < 0) { DbgPrint("第一个字符串小于第二个\n"); } DriverObject->DriverUnload = DriverUnload; return STATUS_SUCCESS; } |
转载请注明:exchen's blog » 字符串的比较