Re: git fsck complains about error: refs/tags/.cyg000000000559e25517156b51cf219f51/libgcj-2.95.0: badRefName: invalid refname format?!

Jakob Bohm via Cygwin <[email protected]>
Newsgroups gmane.os.cygwin
Organization WiseMo A/S
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.