DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 612Fqad13224009 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 612Fqad13224009 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=tXYxtDh/ X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63BE44BA9035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1770047555; bh=62IlMfc7w6dsp+A8fbGvm5UDFFM89AG72aPU00hKgVA=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tXYxtDh/JXgGTBhK7kU5Gltb4DX6dY1q6fViVPwZPwUaxc5qmTnPj4/He5zj2udRo iA9fWI5CD4W2E/r9g+KBBNK6q0FeuuzkyTRZD/ae9jB0LfGoBRE6On/C2z24GfXjsh 1b6QmzqgwcsmfKOej/cIbJ/ctvzfqDbxkcosy4wI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FAA14BB58B1 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FAA14BB58B1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770047304; cv=none; b=bSR7DDDNvDB5NYwoFnaF6bvAkG70SSJtMilNm0ze4ifUd4+NL8zPt6oEtG1qsT2tv4Gx9PCJ3/6h7VQtEqe28nIz+NY2wv95/RK+klkcXZsGMfuJF9mPJHQiZj5G+hV6fMXaeDIP3RRZV4golSIp6dMW2Iu1RV/5mvJsuYkaQwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770047304; c=relaxed/simple; bh=XHcyvpgdr+fUwN9QREJje7Una36aylPTVN8J9wAMvuA=; h=DKIM-Signature:Subject:To:From:Message-ID:Date:MIME-Version; b=f8U0GzSWJHjlywLce/AYAHKoMwaqgkZbFaAtHsuE2D7/uJ/R5aLyfhlU+MDCR4jBT27ItWdScw0cArfBDmNvLEsZe4ZA8DP/uEM5El6RxMrp6Q6SFTYgs7qkOT0d6J237GK6MKjCI5TRPcS30XlQCD4Lt9A6hGr7V0H93cUREdM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FAA14BB58B1 Subject: Re: git fsck complains about error: refs/tags/.cyg000000000559e25517156b51cf219f51/libgcj-2.95.0: badRefName: invalid refname format?! To: cygwin AT cygwin DOT com References: Organization: WiseMo A/S Message-ID: Date: Mon, 2 Feb 2026 16:48:22 +0100 X-Mailer: Epyrus/2.1.3 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jakob Bohm via Cygwin Reply-To: Jakob Bohm Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 612Fqad13224009 On 02/02/2026 14:40, Corinna Vinschen via Cygwin wrote: > On Feb 2 13:24, Dan Shelton via Cygwin wrote: >> I'm not sure whether the Cygwin code is correct. I did a peek with a >> kernel debugger, and I see that FILE_RENAME_INFORMATION.RootDirectory >> is always NULL if a file gets renamed to .cyg000000000xxxx. But if I >> try that with NTFS or SMB, the NtSetInformationFile() to set >> FileRenameInformation always fails. > Your testcase is incorrect, unfortunately. > >> fri->FileNameLength = (wcslen(dstfile)+1)*sizeof(wchar_t); > For NT file paths, never count the trailing \0 to the length: > > fri->FileNameLength = wcslen(dstfile) * sizeof (WCHAR); > > With that, your testcase works fine for me. I am not sure what data structure this supposed "Friday" variable points to, but in NT low level APIs, such as the NTXxxx syscalls exported by ntdll.dll, a common structure is the UNICODE_STRING, which has 3 fields:    Pointer to string buffer,    Size of string buffer in bytes (often (length+1) * sizeof(WCHAR)) and    Size of actual string in bytes (not counting the optional term 0 or other unused buffer space) Both byte counts are 16 bits, so structure can only hold strings up to 32767 WCHARs. There are very similar structures using plain char and these structures can also be marshalled into byte streams by replacing the pointer with a 32 bit byte offset. Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple