Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.os.ms-windows.programmer.nt.kernel-mode > #25

Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi?

From xmllmx <xmllmx@gmail.com>
Newsgroups comp.os.ms-windows.programmer.nt.kernel-mode
Subject Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi?
Date 2012-05-26 13:04 -0700
Organization http://groups.google.com
Message-ID <44201cc4-e49a-49fe-9335-5f642e911afd@googlegroups.com> (permalink)

Show all headers | View raw


Code Sample 1:

#include <ntifs.h>

NTSTATUS DriverEntry(PDRIVER_OBJECT param1, PUNICODE_STRING param2)
{
	char s1[] = "Hello";
	char s2[] = "World";

	int n = memcmp(s1, s2, 5);

	return 0;
}

WDK compiler reports: error LNK2019: unsolved extern symbol _memcmp referenced in function _DriverEntry@8

However, if I modify a bit the code as follows, then the compiler will accept it.

Code Sample 2:

#include <ntifs.h>

NTSTATUS DriverEntry(PDRIVER_OBJECT param1, PUNICODE_STRING param2)
{
	char s1[] = "Hello";
	char s2[] = "World";

	memcmp(s1, s2, 5);

	return 0;
}

Why?

Thanks in advance!

Back to comp.os.ms-windows.programmer.nt.kernel-mode | Previous | NextNext in thread | Find similar


Thread

Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi? xmllmx <xmllmx@gmail.com> - 2012-05-26 13:04 -0700
  Re: Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi? "Don Burn" <burn@windrvr.com> - 2012-05-26 20:19 +0000
    Re: Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi? xmllmx <xmllmx@gmail.com> - 2012-05-26 13:37 -0700
      Re: Is memcmp an unsolved symbol in NT kernel driver even if compiled with /Oi? Tim Roberts <timr@probo.com> - 2012-05-27 18:52 -0700

csiph-web