From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1T0PiF-0002xv-9E for mharc-grub-devel@gnu.org; Sun, 12 Aug 2012 00:23:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0PiB-0002v7-3y for grub-devel@gnu.org; Sun, 12 Aug 2012 00:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0Pi9-0001iT-Pd for grub-devel@gnu.org; Sun, 12 Aug 2012 00:23:35 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:55693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0Pi9-0001iM-KZ for grub-devel@gnu.org; Sun, 12 Aug 2012 00:23:33 -0400 Received: by qcsd16 with SMTP id d16so1803639qcs.0 for ; Sat, 11 Aug 2012 21:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=yqo82fMYWb7EPiz0JltO0DCVtwlptax4m+DzD8+hbqY=; b=nuazMQAOvDa0agGBJWG5K/8TEIV+BfbojmfLRvcu9lDRIVfwk0Dfwn+PXUZFXgvhcw ONjqaDArWvaXL/zsPzr/65G5S/Y9NBVE4qwZMxzaNX2RO8aMIRijjBTQGkmwb6qZuTLr Pe2zGgJYI0eKQKM6IwtSwIijWaaviSOF9PVpjTy0suNq3bjz6JjeswdP7bTvNfVtAPsQ CCpPsRKjLPr1aA4CPWDq7PJR/726YjLj1r8UzK095cQy+m648pseqlinrhxK6AlbLatc ARyeM7mS+9ZaYvDheOGkThtj/laZlS9y15NhYlKjIZCjPm0oEkLwkmml/8P/O9i5/btj Nx1w== Received: by 10.224.185.148 with SMTP id co20mr17011070qab.4.1344745412466; Sat, 11 Aug 2012 21:23:32 -0700 (PDT) Received: from [127.0.0.1] (pool-96-237-28-224.bstnma.east.verizon.net. [96.237.28.224]) by mx.google.com with ESMTPS id a2sm4222419qaf.9.2012.08.11.21.23.30 (version=SSLv3 cipher=OTHER); Sat, 11 Aug 2012 21:23:31 -0700 (PDT) Message-ID: <50272FD3.70404@gmail.com> Date: Sun, 12 Aug 2012 00:23:47 -0400 From: Peter Lustig User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: New command to check NT's hibernation state References: <4EF40444.5060303@gmail.com> In-Reply-To: <4EF40444.5060303@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.169 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Aug 2012 04:23:37 -0000 On 12/22/2011 11:32 PM, Peter Lustig wrote: > On 12/22/2011 13:10, Vladimir 'phcoder' Serbinenko wrote: >> On 18.12.2011 04:16, Peter Lustig wrote: >>> > /* Return SUCCESS if magic indicates file is active; else >>> return FAILURE */ >>> > if (!grub_strncasecmp ("hibr", hibr_file_magic, magic_size)) >> What's the reason to use strncasecmp? Does the case changes? Usually >> memcmp is the right way to check the signature. This also avoids the >> need of memset and trailing zero byte. > It can be either {'h', 'i', 'b', 'r'} (for Windows XP) or {'H', 'I', > 'B', 'R'} (for Windows Vista/7). Technically I should only be > checking for these two values, but it is unlikely that the magic would > have mixed case. The only other values I know (from > ) that it can > assume are {'w', 'a', 'k', 'e'}, {'l', 'i', 'n', 'k'}, and {'\0', > '\0', '\0', '\0'}. Using strncasecmp() seemed like a simple way to > approach the problem. Sorry to bump this thread. Do you know if there are any plans to include the 'nthibr' module in a future release of GRUB. I looked and didn't see any references to it in the Bazaar trunk.