1

Topic: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

I write function - a wrapper for RtlCompressBuffer which allows to simplify as much as possible the code and to accelerate a spelling. Here in RtlCompressBuffer very much it is not pleasant that you select the size of the output buffer itself from any , type "with a store". Simply to make its equal to the input buffer - not a variant - the day off it can appear more input in an unsuccessful case (if input all some byte or at all 0 byte). Or cannot? How to be? If it is stupid to increase the size input several times (hammering on saving of resources), in how many? To make how it becomes normally (beforehand to cause function with the zero buffer, to return result) it is impossible, apparently.

2

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> Here in RtlCompressBuffer very much it is not pleasant that you select the size of the output buffer itself from any , type "with a store". S> Simply to make its equal to the input buffer - not a variant - the day off can appear more input in an unsuccessful case (if input all some byte or at all 0 byte). Or cannot? Function exists for file system to compress FILE_ATTRIBUTE_COMPRESSED-file pieces on the fly. The file breaks into pieces of the equal size, everyone is compressed, if any was not compressed, it registers not compressed; what of pieces are compressed, what are not present - is processed at file system level. Accordingly, the most simple method to cause function correctly - to create FILE_ATTRIBUTE_COMPRESSED a file

3

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Alexander G, you wrote: AG> Hello, sergey77666, you wrote: S>> Here in RtlCompressBuffer very much it is not pleasant that you select the size of the output buffer itself from any , type "with a store". S>> Simply to make its equal to the input buffer - not a variant - the day off can appear more input in an unsuccessful case (if input all some byte or at all 0 byte). Or cannot? AG> function exists for file system to compress FILE_ATTRIBUTE_COMPRESSED-file pieces on the fly. AG> the file breaks into pieces of the equal size, everyone is compressed, if any was not compressed, it registers not compressed; what of pieces are compressed, what are not present - is processed at file system level. AG> accordingly, the most simple method to cause function correctly - to create FILE_ATTRIBUTE_COMPRESSED a file does not go. Though, here already it would be desirable to take and most to implement LZ77. On the one hand, costs, it is more favourable for the account . On the other hand, instead of whether better then what another to implement, more compatible to compressors \dekompressorami?) free time, strictly speaking, 0 seconds and so will be always.

4

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> Though, here already it would be desirable to take and most to implement LZ77. On the one hand, costs, it is more favourable for the account . On the other hand, instead of whether better then what another to implement, more compatible to compressors \dekompressorami?) free time, strictly speaking, 0 seconds and so will be always. Perhaps to take zlib? It works in such broad range of surroundings, I do not think that does not earn in the Windows-driver. Judging by source codes, there even  it is necessary nothing, to collect with Z_SOLO, and it does not depend even on malloc/free (uses transferred from the outside)

5

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> Simply to make its equal to the input buffer - not a variant - the day off can appear more input in an unsuccessful case (if input all some byte or at all 0 byte). Or cannot? It seems to me, what if it is is specific at this piece yielded result of a compression it appeared more than the input data this piece can was specific and it is not necessary ?

6

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Pzz, you wrote: Pzz> Hello, sergey77666, you wrote: S>> Simply to make its equal to the input buffer - not a variant - the day off can appear more input in an unsuccessful case (if input all some byte or at all 0 byte). Or cannot? Pzz> it seems to me, what if it is is specific at this piece yielded result of a compression it appeared more than the input data this piece can was specific and it is not necessary ? I against such "ghosts" in architecture. The word can be defined "ghost" as an unobvious, rarely shown singularity of a format. It is clear that on idea simply enough to describe it in the documentation, but in practice always there is a chance that to it not , make empirically, transits one hundred tests, and then falls in ocean.

7

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Alexander G, you wrote: AG> Hello, sergey77666, you wrote: S>> Though, here already it would be desirable to take and most to implement LZ77. On the one hand, costs, it is more favourable for the account . On the other hand, instead of whether better then what another to implement, more compatible to compressors \dekompressorami?) free time, strictly speaking, 0 seconds and so will be always. AG> Perhaps to take zlib? It works in such broad range of surroundings, I do not think that does not earn in the Windows-driver. AG> judging by source codes, there even  it is necessary nothing, to collect with Z_SOLO, and it does not depend even on malloc/free (the same history with the buffer uses transferred from the outside) By the way, at zlib, but in docks is written how to consider the size.

8

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: Pzz>> it seems To me, what if it is is specific at this piece yielded result of a compression it appeared more than the input data this piece can was specific and it is not necessary ? S> I against such "ghosts" in architecture. S> the word can be defined "ghost" as an unobvious, rarely shown singularity of a format. Here so for the sake of architectural purity the people are ready to make undoubted impairment. Some data in essence does not give in to a compression (for example, the ciphered data, generally, any pseudorandom sequence). Forcedly "" them is only to inflate volume of output data, and to increase time . Here it is necessary to add simply to each unit an explicit sign,  it or not. As all the same it is necessary to write something it is difficult to present to itself to this sign that there write down a constant, without looking. Actually, the wrapper to the compressor can it and do. Then to it always enough the output buffer which on byte more input - this byte also will be a sign. S> it is clear that on idea simply enough to describe it in the documentation, but in practice always there is a chance that to it not , make empirically, transits one hundred tests, and then falls in ocean. If to rely only on tests, and a head not to include, always and will be.

9

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Pzz, you wrote: Pzz> Actually, the wrapper to the compressor can it and do. Then to it always enough the output buffer which on byte more input - this byte also will be a sign. But then it it is necessary to name Algorithm c Sergey-77666 TM. Because if it to name LZNT1 it will be incorrect -  LZNT1 cannot work with its output because of this byte.

10

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: Pzz>> Actually, the wrapper to the compressor can it and do. Then to it always enough the output buffer which on byte more input - this byte also will be a sign. S> but then it it is necessary to name Algorithm c Sergey-77666 TM. S> Because if it to name LZNT1 it will be incorrect -  LZNT1 cannot work with its output because of this byte. If we speak about a compression of files in the driver of the virtual file system, all the same it is necessary somehow seek to provide. In itself LZNT1, I suppose, it does not do (it is impossible to read a piece from the middle, it is possible to read only from beginning to end). Therefore optional data (and their self-made format) all the same be required. And if so, there there will be also a place for a sign.

11

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Pzz, you wrote: Pzz> If we speak about a compression of files in the driver of the virtual file system interesting why you speak about it? I speak about the simple driver.

12

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> Here in RtlCompressBuffer very much it is not pleasant that you select the size of the output buffer itself from any , type "with a store". TO prompts that it is an algorithm singularity. S> simply to make its equal to the input buffer - not a variant - the day off can appear more input in an unsuccessful case Just a variant. If the oblate data appeared more not compressed - there is sense no them to compress generally.

13

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, wildwind, you wrote: W> TO prompts that it is an algorithm singularity. And practice refutes it, after all same "singularity" is and in mentioned zlib. But only there in docks it is written how to consider the size of this buffer, and here is not present. W> Just a variant. If the oblate data appeared more not compressed - there is sense no them to compress generally. It is a terrible brothel when function-wrapper that returns the oblate data not compressed and you it it is necessary to process somehow it already at application-oriented level when writing of drivers and so takes away a lot of time.

14

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: W>> TO prompts that it is an algorithm singularity. S> and practice refutes it, after all same "singularity" is and in mentioned zlib. And I about the same, this singularity will be present at any implementation. S> but only there in docks it is written how to consider the size of this buffer, and here is not present. Claims to docks it is other question. Implementation MS , can change, therefore write "consider and be not mistaken" it is impossible. S> It is a terrible brothel when function-wrapper that returns the oblate data not compressed and you it it is necessary to process somehow it already at application-oriented level when writing of drivers and so takes away a lot of time. You want to tell, what time of a spelling of the driver for you on the first place, and efficiency of its operation on the second? By the way, what for it to process at application-oriented level, the driver itself with it does not consult?

15

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, wildwind, you wrote: W> Claims to docks it is other question. Well so it is necessary to do something. W> you want to tell, what time of a spelling of the driver for you on the first place, and efficiency of its operation on the second? Certainly. To argue about  necessities of optimization of each KB on a disk (at all in the RAM!) Is better I advise to go in MS, Google etc. There a log, and here a mote. If the product is really necessary, all the same the first profit will be, and here from it already and to optimize. The customer not a stiver does not pay in addition to me for these spared KB, and here spared time from several minutes to some hours (runs during attending of this code since superfluous  will load your brain each time as you will work with this section so much) is not and a little. W> By the way, what for it to process at application-oriented level, the driver itself with it does not consult? You not so understood (generally difficult to inscribe architecture of any modern system in any hierarchy - for example, in a client - server over ostensibly application-oriented HTTP protocol it can appear from 5 protocols, and what - they?) Meant - it is necessary to process somehow not in the wrapper, and at level of its driver using (a wrapper - a part ), i.e. at record of such oblate data in a file it is necessary to add additional byte which will specify the data compressed there or not. And still compression can be used as "pseudo-enciphering": from "" it gives easy protection, especially LZNT1 is atypical enough, - and if the data flies not compressed we lose it.

16

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> the Customer not a stiver does not pay in addition to me for these spared KB You start to contradict to itself. If it so what for you generally cling to this compression? Refuse it, all becomes sharply simpler also time will spare.

17

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, wildwind, you wrote: W> Hello, sergey77666, you wrote: S>> the Customer not a stiver does not pay in addition to me for these spared KB W> You start to contradict to itself. If it so what for you generally cling to this compression? Refuse it, all becomes sharply simpler also time will spare. No, compression is necessary, it was in  and favor of it as a whole in the majority a case more. And here the requirement not to compress if badly it turns out is already a rarity and specificity, the same wrapper can have an additional option for this purpose, but it is optional.

18

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> By the way, at zlib the same history with the buffer, but in docks it is written how to consider the size. Generally there is still such reception: to cause in a cycle, increasing the buffer several times, for example in ones and a half. It is terribly ineffective on a hypothetical pathological case, in a reality hardly compression gives magnification more than in one and a half time so no cycle will exist.

19

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, Alexander G, you wrote: AG> Hello, sergey77666, you wrote: S>> By the way, at zlib the same history with the buffer, but in docks it is written how to consider the size. AG> generally there is still such reception: to cause in a cycle, increasing the buffer several times, for example in ones and a half. AG> it is terribly ineffective on a hypothetical pathological case, in a reality hardly compression gives magnification more than in one and a half time so no cycle will exist. Rigidly as. Would not guess such perversion) And still say that I of races...  and any  also does not smell.

20

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

Hello, sergey77666, you wrote: S> it is rigid as. Would not guess such perversion) S> And still say that I of races...  and any  also does not smell. For some cases a variant with a cycle - . And even if there is a method it is necessary to foreknow how many. It when results not is mandatory repeat. For example, we receive a line from the register. It is possible to ask at first the size of a line, then to select the buffer. But if someone that's it now edits the register, and lengthening will be between calls? Here, truth, it is not necessary to increase from , the previous attempt returns, how many now it is necessary, but all the same, without a cycle of the perfect decision is not present.

21

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

S> It is a terrible brothel when function-wrapper that returns the oblate data not compressed and you it it is necessary to process somehow it already at application-oriented level when writing of drivers and so takes away a lot of time. Function-wrapper can produce result with the title in which it is possible to add a conciseness flag. Accordingly all handling will be allocated in these functions of compression/unpacking and not to stick out outside.

22

Re: RtlCompressBuffer and LZNT1 - How to pick up the size . Buffers

S>> It is a terrible brothel when function-wrapper that returns the oblate data not compressed and you it it is necessary to process somehow it already at application-oriented level when writing of drivers and so takes away a lot of time. SD> Function-wrapper can produce result with the title in which it is possible to add a conciseness flag. Accordingly all handling will be allocated in these functions of compression/unpacking and not to stick out outside. Most likely in  storage in an any way it will be necessary to lay down the initial size  the data. Accordingly all flag of conciseness consists that the initial size == to the oblate size.