Re: ImportC GUID compilation problem with some Windows headers

2024-03-21 Thread Dave P. via Digitalmars-d-learn
On Thursday, 21 March 2024 at 18:19:58 UTC, Carl Sturtivant wrote: On Thursday, 21 March 2024 at 00:06:56 UTC, Carl Sturtivant wrote: ```C EXTERN_GUID(IID_IBlahBlahBlah, 0xabcdef12, 0x11d2, 0xab3a, 0xc0, 0x4f, [...] ); ``` Has anyone successfully compiled an EXTERN_GUID declaration like thi

Re: Running LDC on a recent MacOS

2023-06-16 Thread Dave P. via Digitalmars-d-learn
On Friday, 16 June 2023 at 16:25:35 UTC, Dmitry Olshansky wrote: On Friday, 16 June 2023 at 16:14:19 UTC, Steven Schveighoffer wrote: On 6/16/23 11:56 AM, Dmitry Olshansky wrote: Any advice from MacOS users? Yep. Go into settings, then privacy and security. Make sure "App store and identif

Re: ImportC std support

2021-12-12 Thread Dave P. via Digitalmars-d-learn
On Sunday, 12 December 2021 at 07:40:10 UTC, ManKey wrote: On Saturday, 11 December 2021 at 22:28:16 UTC, forkit wrote: On Saturday, 11 December 2021 at 21:42:49 UTC, ManKey wrote: umm... the site has search function you know ;-) Dude, you see, it doesn't say anything about it. It says a litt

Re: How to check for overflow when adding/multiplying numbers?

2021-12-06 Thread Dave P. via Digitalmars-d-learn
On Monday, 6 December 2021 at 18:38:37 UTC, Ola Fosheim Grøstad wrote: On Monday, 6 December 2021 at 17:46:35 UTC, Dave P. wrote: I’m porting some C code which uses the gcc intrinsics to do a multiply/add with overflow checking. See [here](https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow

How to check for overflow when adding/multiplying numbers?

2021-12-06 Thread Dave P. via Digitalmars-d-learn
I’m porting some C code which uses the gcc intrinsics to do a multiply/add with overflow checking. See [here](https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html) for reference. Is there a D equivalent?

Re: Can we use "ImportC" used yet?

2021-10-22 Thread Dave P. via Digitalmars-d-learn
On Friday, 22 October 2021 at 06:11:35 UTC, data pulverizer wrote: On Thursday, 21 October 2021 at 23:06:18 UTC, jfondren wrote: [...] I've double-checked and the types names are fine in translated C file. [...] I think you ran into this [issue](https://issues.dlang.org/show_bug.cgi?id=2

Casting between structs of the same size is treated as a bit cast?

2021-10-19 Thread Dave P. via Digitalmars-d-learn
I am confused on how casting structs works. According to point 9 of https://dlang.org/spec/expression.html#CastExpression: Casting a value v to a struct S, when value is not a struct of the same type, is equivalent to: ```d S(v) ``` However, the following program compiles and the resulting

Re: How to Install D on my new MacBook with M1 ARM computer

2020-12-30 Thread Dave Chapman via Digitalmars-d-learn
to be distributing any consumer software. Dave Chapman

How to Install D on my new MacBook with M1 ARM computer

2020-12-29 Thread Dave Chapman via Digitalmars-d-learn
r any guidance you can provide, Dave Chapman

Re: Can I output strings using core.stdc.stdio?

2020-12-22 Thread Dave P. via Digitalmars-d-learn
On Tuesday, 22 December 2020 at 21:37:23 UTC, Godnyx wrote: On Tuesday, 22 December 2020 at 21:28:10 UTC, Dave P. wrote: On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote: [...] Lol. Actually I just don't want to use Phobos and trying to stay on core. Unfortunately, my var

Re: Can I output strings using core.stdc.stdio?

2020-12-22 Thread Dave P. via Digitalmars-d-learn
On Tuesday, 22 December 2020 at 21:10:59 UTC, Godnyx wrote: Is there a way? If not then how std.stdio does it? I assume you’re asking this because you don’t have access to std.stdio (such as using betterC). The way to do it is to use the %.*s specifier in printf. For example: void print_st

Re: Floating point values in structs.

2020-12-22 Thread Dave P. via Digitalmars-d-learn
On Tuesday, 22 December 2020 at 18:10:22 UTC, Dukc wrote: On Friday, 18 December 2020 at 16:18:12 UTC, Dave P. wrote: [...] Honestly, I just want all bits zero. I don’t work with any platforms where null is not 0 and all-zero-bits aggregates can be efficiently represented in static storage

Re: Floating point values in structs.

2020-12-18 Thread Dave P. via Digitalmars-d-learn
On Friday, 18 December 2020 at 16:23:20 UTC, Adam D. Ruppe wrote: On Friday, 18 December 2020 at 16:18:12 UTC, Dave P. wrote: Is the proper solution to change the struct definition to: yeah that's the best option right now A bit of a pain when porting, but alright. I find the se

Floating point values in structs.

2020-12-18 Thread Dave P. via Digitalmars-d-learn
I got burned by behavior of struct initialization I didn’t anticipate last night. Consider a struct: struct Foo { float x, y, z; int a, b, c; } My source C code was initializing it by doing something like: Foo f = {.y = 3} Which uses the C behavior that all the other fields will be s

Re: Getting the source text of an expression

2020-12-17 Thread Dave P. via Digitalmars-d-learn
On Thursday, 17 December 2020 at 21:24:40 UTC, FreeSlave wrote: On Thursday, 17 December 2020 at 19:45:38 UTC, Dave P. wrote: [...] Something like that? import std.stdio; void print_int(alias n)() { writeln(n.stringof~"=", n); } void main() { int x = 42; pr

Getting the source text of an expression

2020-12-17 Thread Dave P. via Digitalmars-d-learn
In C, you can use a macro to get the source text of an expression as a string. For example #include #define PRINT_INT(x) printf(#x " = %d\n", x) int main(){ // prints "3 = 3" PRINT_INT(3); int x = 4; // prints "x = 4" PRINT_INT(x); #define FOO 5 // prints "FOO = 5"

Re: extern(C) and name mangling

2020-12-16 Thread Dave P. via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 06:46:42 UTC, Jacob Carlborg wrote: On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: However, the D calling convention is defined to be identical to the C calling convention on the host system for everything except Windows x86. That's what

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 03:50:07 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: [...] Based on you requirement to use

Re: extern(C) and name mangling

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: On Tuesday, 15 December 2020 at 22:04:12 UTC, Dave P. wrote: [...] Mangling does not play any role in passing and calling function pointers between D and C. It only plays a role in linking and loading. You can declare

extern(C) and name mangling

2020-12-15 Thread Dave P. via Digitalmars-d-learn
I can’t find this in the spec, but from experimentation it seems like extern(C) only affects name mangling of functions at the top level scope. Thus extern(C) function templates would be mangled differently, but still use the C calling convention. Is this right? I want to pass some templated f

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 19:45:50 UTC, Q. Schroll wrote: On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: Do I have to write both and have one forward

Re: UFCS functions with both pointers and refs

2020-12-13 Thread Dave P. via Digitalmars-d-learn
On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: Do I have to write both and have one forward to the other for more complicated functions? For free functions, yes. Is there any way to write the function as a

UFCS functions with both pointers and refs

2020-12-13 Thread Dave P. via Digitalmars-d-learn
If I define a method on a type, then I can call it both through a pointer and through a reference and the compiler does the right thing. Eg: struct Foo { int x; void fooey(){ x++; } void report(){ printf("%d\n", x); } } int main(){ Foo f; f.fooey;

Re: Static on free functions

2020-12-07 Thread Dave P. via Digitalmars-d-learn
On Monday, 7 December 2020 at 17:07:20 UTC, Adam D. Ruppe wrote: On Monday, 7 December 2020 at 17:01:45 UTC, Dave P. wrote: Does `static` on a free function definition do anything? Nope, D allows a lot of useless attributes so it doesn't complain if you do certain things out of habit (

Static on free functions

2020-12-07 Thread Dave P. via Digitalmars-d-learn
Does `static` on a free function definition do anything? I know the meaning of it in C, but I can’t find an equivalent definition (or any definition of it at all) when applied to free functions in the spec. Are the two below any different or is it just for ease of porting from C? static i

Re: How Different Are Templates from Generics

2019-10-11 Thread Just Dave via Digitalmars-d-learn
Thanks for the thorough explanation. Most of that is how I was thinking it worked. However, that leaves me perplexed. If templates just generate code then how come: Wouldnt.. class SomeClass(T) : ISomeInterface!T and.. class SomeOtherClass(T) : ISomeInterface!T ...generate two diffe

How Different Are Templates from Generics

2019-10-11 Thread Just Dave via Digitalmars-d-learn
I come from both a C++ and C# background. Those have been the primary languages I have used. In C# you can do something like this: public interface ISomeInterface { T Value { get; } } public class SomeClass : ISomeInterface { T Value { get; set; } }

Re: Difference between template and mixin template

2019-10-10 Thread Just Dave via Digitalmars-d-learn
On Thursday, 10 October 2019 at 15:56:36 UTC, Just Dave wrote: I'm trying to get my head around mixing templates. I'm using it as kind of a replacement for class inheritance as it seems to fit better composition over inheritance. So I do something like: mixin template Numb

Re: C#'s 'is' equivalent in D

2019-10-10 Thread Just Dave via Digitalmars-d-learn
On Thursday, 10 October 2019 at 15:53:20 UTC, Adam D. Ruppe wrote: On Thursday, 10 October 2019 at 15:47:58 UTC, Just Dave wrote: if (obj is Person person) Looks the same as D's if(auto person = cast(Person) obj) { // use person in here } else { // it was some other

Difference between template and mixin template

2019-10-10 Thread Just Dave via Digitalmars-d-learn
I'm trying to get my head around mixing templates. I'm using it as kind of a replacement for class inheritance as it seems to fit better composition over inheritance. So I do something like: mixin template NumberTemplate() { private: int number = 0; public: int g

Re: C#'s 'is' equivalent in D

2019-10-10 Thread Just Dave via Digitalmars-d-learn
Even though static solutions would be more performance minded, I'd actually prefer to see the runtime equivalent so I don't have to rethink how I think as performance isn't really my major concern right now.

C#'s 'is' equivalent in D

2019-10-10 Thread Just Dave via Digitalmars-d-learn
In C# you can do something like: if (obj is Person) { var person = obj as Person; // do stuff with person... } where you can check the type of an object prior to casting. Does D have a similar mechanism? It's so widely useful in the C# realm that they even added sy

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread Just Dave via Digitalmars-d-learn
Thanks for the advice. I used a quick and dirty range solution as was suggested. It allowed me to move on as I really wasn't looking to fully implement a queue or stack. Just get something that semantically behaved as such. I'll return later and optimize it with the later suggestions if it's a

Re: Dynamic Arrays as Stack and/or Queue

2019-10-07 Thread Just Dave via Digitalmars-d-learn
On Monday, 7 October 2019 at 17:24:19 UTC, Ferhat Kurtulmuş wrote: On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote: I need a stack and a queue and I noticed that the standard library doesn't appear to have one. Which is ok. I just need something that can logically behave as a

Re: Dynamic Arrays as Stack and/or Queue

2019-10-07 Thread Just Dave via Digitalmars-d-learn
On Monday, 7 October 2019 at 17:18:03 UTC, bachmeier wrote: On Monday, 7 October 2019 at 17:11:08 UTC, Just Dave wrote: I need a stack and a queue and I noticed that the standard library doesn't appear to have one. Which is ok. I just need something that can logically behave as a stac

Dynamic Arrays as Stack and/or Queue

2019-10-07 Thread Just Dave via Digitalmars-d-learn
I need a stack and a queue and I noticed that the standard library doesn't appear to have one. Which is ok. I just need something that can logically behave as a stack and queue, which I think the dynamic array should be able to do (if I understand correctly this is effectively the equivalent of

Re: Does Visual D actually work?

2019-10-07 Thread Just Dave via Digitalmars-d-learn
A machine reboot seems to have fixed the problem...

Does Visual D actually work?

2019-10-07 Thread Just Dave via Digitalmars-d-learn
I downloaded it after experiencing debugging issues with CodeBlocks (it wouldn't attach the provided debugger). I downloaded Visual D and after some fiddling with Visual Studio 2019 not supporting third party templates in my version (had to update it), I haven't been able to get Visual D to com

C++ base constructor call vs. D's

2019-10-02 Thread Just Dave via Digitalmars-d-learn
I was reading the C++ to D page, and came across this little bit about when to call the base class constructor: "It's superior to C++ in that the base constructor call can be flexibly placed anywhere in the derived constructor." Isn't there some inherent danger of not calling the base constr

Re: Using D for Raspberry Pi expirements

2019-10-02 Thread Dave Chapman via Digitalmars-d-learn
On Sunday, 29 September 2019 at 11:26:41 UTC, aberba wrote: On Thursday, 26 September 2019 at 17:26:25 UTC, Dave Chapman wrote: [...] your code... can you push it to GitHub so I can check it out? I haven't used GitHub or git. Is there some other way?

Re: Using D for Raspberry Pi expirements

2019-09-26 Thread Dave Chapman via Digitalmars-d-learn
On Thursday, 26 September 2019 at 00:10:40 UTC, aberba wrote: On Wednesday, 25 September 2019 at 23:56:45 UTC, aberba wrote: I'm looking for resources on using D for basic Raspberry Pi programming...stuff like turning on and off an LED light. I believe it requires being able to call the Raspber

Specifying executable names in DUB

2019-06-17 Thread Dave via Digitalmars-d-learn
Greetings, This might be totally obvious, but I can't seem to figure out how to specify an executable's name&path to be different for each build types in my DUB package. For example, if my project is named "dlang_test", I might want something like so: dub build --build=debug yields either

Re: What is the point of nothrow?

2018-06-11 Thread Dave Jones via Digitalmars-d-learn
On Monday, 11 June 2018 at 00:47:27 UTC, Jonathan M Davis wrote: On Sunday, June 10, 2018 23:59:17 Bauss via Digitalmars-d-learn wrote: What is the point of nothrow if it can only detect when Exception is thrown and not when Error is thrown? It seems like the attribute is useless because you c

Re: Confusion/trying to understand CTFE keywords

2018-06-03 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 3 June 2018 at 21:32:06 UTC, gdelazzari wrote: Note that this is not an attack to the language or anything (I actually really love it), I'm just trying to understand the reasoning behind this choice. Because they have a thing about not adding new keywords, apparently it's more im

Re: inline asm return values

2018-03-25 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 25 March 2018 at 12:23:03 UTC, kinke wrote: On Sunday, 25 March 2018 at 10:58:37 UTC, Dave Jones wrote: Is this stuff documented somewhere? See https://dlang.org/spec/abi.html#function_calling_conventions. It defines the D calling convention for Win32 (int return value in EAX

inline asm return values

2018-03-25 Thread Dave Jones via Digitalmars-d-learn
Given this... int mulDiv64(int a, int b, int c) { asm { movEAX,a; imul b; idiv c; } } which computes a*b/c, with the intermediate value in 64 bit. It returns value that is left in EAX. Is this stuff documented somewhere? I mean I found the page on

Re: float.max + 1.0 does not overflow

2017-12-28 Thread Dave Jones via Digitalmars-d-learn
On Wednesday, 27 December 2017 at 14:14:42 UTC, Benjamin Thaut wrote: On Wednesday, 27 December 2017 at 13:40:28 UTC, rumbu wrote: Is that normal? It computes the difference between float.max and the next smaller reprensentable number in floating point. The difference printed by the program is

Re: inout after function

2017-11-26 Thread Dave Jones via Digitalmars-d-learn
On Sunday, 26 November 2017 at 04:51:08 UTC, Adam D. Ruppe wrote: On Sunday, 26 November 2017 at 01:35:01 UTC, Dave Jones wrote: So it makes it a const/immutable/mutable method depending on whether the instance it is called on is const/immutable/mutable? On the outside, yes. So

Re: inout after function

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
On Saturday, 25 November 2017 at 21:59:54 UTC, Ali Çehreli wrote: On 11/25/2017 01:51 PM, Dave Jones wrote: > What does the "inout" after front() do here... > > > @property ref inout(T) front() inout > { > assert(_data.refCountedStore.isInitialized); &g

inout after function

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
What does the "inout" after front() do here... @property ref inout(T) front() inout { assert(_data.refCountedStore.isInitialized); return _data._payload[0]; } Cant seem to find an explanation in the docs or forums :(

Re: Floating point types default to NaN?

2017-11-25 Thread Dave Jones via Digitalmars-d-learn
On Friday, 24 November 2017 at 22:38:49 UTC, Jonathan M Davis wrote: On Friday, November 24, 2017 20:43:14 A Guy With a Question via Digitalmars- d-learn wrote: On Friday, 24 November 2017 at 14:43:24 UTC, Adam D. Ruppe That requires data flow analysis, which the compiler doesn't do a lot of, b

Re: std.system reports win32 when running OS X

2017-02-02 Thread Dave Chapman via Digitalmars-d-learn
On Wednesday, 1 February 2017 at 21:43:09 UTC, Ali Çehreli wrote: On 02/01/2017 01:34 PM, Dave Chapman wrote: I am running an iMac with OS X 10.11.5 (El Capitan) and dmd version 2.072.2 The following program prints out OS = win32. Is this the intended behavior? #!/usr/local/bin/rdmd import

std.system reports win32 when running OS X

2017-02-01 Thread Dave Chapman via Digitalmars-d-learn
I am running an iMac with OS X 10.11.5 (El Capitan) and dmd version 2.072.2 The following program prints out OS = win32. Is this the intended behavior? #!/usr/local/bin/rdmd import std.stdio; import std.system; void main (string[] args) { immutable OS os; writefln("OS = %s",os); }

Re: Convert duration to years?

2017-01-14 Thread Dave Chapman via Digitalmars-d-learn
On Sunday, 15 January 2017 at 03:43:32 UTC, Nestor wrote: Hi, I would simply like to get someone's age, but I am a little lost with time and date functions. I can already get the duration, but after reading the documentation it's unclear to me how to convert that into years. See following cod

Re: Converting from DirIterator to string[] without a loop

2017-01-14 Thread Dave Chapman via Digitalmars-d-learn
On Saturday, 14 January 2017 at 01:02:38 UTC, Ali Çehreli wrote: On 01/13/2017 04:29 PM, Dave Chapman wrote: > When I use auto and print out the type of b it is something like > args.main.FilterResult!(__lambda2, DirIterator).FilterResult and for the > "if"

Converting from DirIterator to string[] without a loop

2017-01-13 Thread Dave Chapman via Digitalmars-d-learn
I would like to do something like the code shown below but I can't figure out how to do it without loops inside the if statement. When I use auto and print out the type of b it is something like args.main.FilterResult!(__lambda2, DirIterator).FilterResult and for the "if" version of b and args.

Re: string mixup problem with stdin.byLine

2016-08-07 Thread Dave Akers via Digitalmars-d-learn
t is... string cleanLine = strip( to!string(line) ); which should make a copy of the mutable buffer. I still a beginner at D but I think that will fix your problem. -Dave

Nested classes question?

2015-09-15 Thread Dave Akers via Digitalmars-d-learn
When a program exits and D's memory management is cleaning up calling all of the ~this's is there a reason it calls the outer class's ~this before the inner class's ~this? I was recently exploring the possibility of using https://github.com/bheads/d-leveldb and the example in the readme seg f

Re: Multiple implicit type converters

2015-09-11 Thread Dave Akers via Digitalmars-d-learn
On Friday, 11 September 2015 at 19:34:46 UTC, Bahman Movaqar wrote: On Friday, 11 September 2015 at 16:33:52 UTC, Meta wrote: The only ways to get implicit conversion between two types in D are through `alias this`, inheritance, or implementing an interface. That's enough for me, I suppose. I

Re: chaining splitters

2015-03-11 Thread Dave S via Digitalmars-d-learn
On Wednesday, 11 March 2015 at 00:00:39 UTC, dnoob wrote: Hello, I am parsing some text and I have the following; string text = "some very long text"; foreach(line; splitter(text, [13, 10])) { foreach(record; splitter(line, '*')) { foreach(field; splitter(record

Re: Using D static library from C

2014-06-05 Thread Dave Wilson via Digitalmars-d-learn
You can create a static library from one or more .o files using ar, if that helps (unless I've failed to understand the question). "ar r libtest.a test.o" should do the job.

Exceptions from WinMain

2013-02-19 Thread Dave Brown
d something obvious :) /Dave

Re: Static constructors?

2010-07-23 Thread Dave
On 7/23/2010 5:14 AM, Steven Schveighoffer wrote: On Fri, 23 Jul 2010 05:56:18 -0400, Dave wrote: On 7/22/2010 7:40 AM, Steven Schveighoffer wrote: On Wed, 21 Jul 2010 22:27:10 -0400, awishformore wrote: On 22/07/2010 03:36, Sean Kelly wrote: Make the ctors "shared static

Re: Static constructors?

2010-07-23 Thread Dave
On 7/22/2010 7:40 AM, Steven Schveighoffer wrote: On Wed, 21 Jul 2010 22:27:10 -0400, awishformore wrote: On 22/07/2010 03:36, Sean Kelly wrote: Make the ctors "shared static this()" -- those are only constructed once when the process starts up. The non-shared static ctors are thread-local.

Re: Static constructors?

2010-07-21 Thread Dave
On 7/21/2010 7:27 PM, awishformore wrote: On 22/07/2010 03:36, Sean Kelly wrote: Make the ctors "shared static this()" -- those are only constructed once when the process starts up. The non-shared static ctors are thread-local. That concept is really weird, though. So this applies to anything

Re: lifetime of dynamically allocated memory

2010-05-31 Thread dave
== Quote from torhu (n...@spam.invalid)'s article > On 31.05.2010 22:27, dave wrote: > > I'm trying to figure out if a dynamically allocated memory in D is getting > > collected with this simple test (using tango): > > > > class Foo { > >

lifetime of dynamically allocated memory

2010-05-31 Thread dave
I'm trying to figure out if a dynamically allocated memory in D is getting collected with this simple test (using tango): class Foo { ~this() { // destructor } } struct Item { Foo a; } Item[] items; items.length = 1; items[0] = Item(); items[0].a = new Foo(); items = null;

Re: dynamic type casting in D

2010-05-30 Thread dave
Awesome! I just tried it out, the cast expression is exactly what I was looking for. I'm currently using Tango and tried out its runtime traits api, this works as expected: if(implements(typeof(something).classinfo, A.classinfo)) Thanks for the info!

dynamic type casting in D

2010-05-30 Thread dave
Hi, sort of new to D programming, coming from C++. Basically the question is if there is some sort of a way to dynamically cast a variable in D much like you do in C++? ex: interface A {...} class B {...} class C : B {...} class D : B, A {...} function(B something) { A a = dynamic_cast(some

abount thread

2009-05-07 Thread dave sun
How to force one thread running on a single cpu in multi-cpu system but without switching,just like the thread in windows iocp model.