~ubuntu-branches/ubuntu/hardy/ndiswrapper/hardy

« back to all changes in this revision

Viewing changes to driver/rtl.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-07 20:42:35 UTC
  • mfrom: (1.2.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20071207204235-s43f889d3h1u6vrl
Tags: 1.50-1ubuntu1
* Merge with Debian; remaining changes:
  - Build for lpia.
  - debian/control:
    + Update description to point out that the kernel source package is
      not required with the standard Ubuntu kernel.
    + Change the Maintainer address.
  - debian/control:
    + Drop ndiswrapper-source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        size_t i;
22
22
        char *x, *y;
23
23
 
24
 
        ENTER1("");
25
 
 
26
24
        x = (char *)a;
27
25
        y = (char *)b;
28
26
        /* MSDN says this should return number of bytes that compare as
445
443
        return __swab32(src);
446
444
}
447
445
 
448
 
wstdcall NTSTATUS WIN_FUNC(NdisUpcaseUnicodeString,2)
449
 
        (struct unicode_string *dst, struct unicode_string *src)
 
446
wstdcall NTSTATUS WIN_FUNC(RtlUpcaseUnicodeString,3)
 
447
        (struct unicode_string *dst, struct unicode_string *src, BOOLEAN alloc)
450
448
{
451
449
        USHORT i, n;
452
450
 
453
 
        n = min(src->length, src->max_length);
454
 
        n = min(n, dst->length);
455
 
        n = min(n, dst->max_length);
456
 
        n /= sizeof(dst->buf[0]);
457
 
        for (i = 0; i < n; i++) {
458
 
                char *c = (char *)&dst->buf[i];
459
 
                *c = toupper(src->buf[i]);
 
451
        if (alloc) {
 
452
                dst->buf = ExAllocatePoolWithTag(NonPagedPool, src->length, 0);
 
453
                if (dst->buf) {
 
454
                        dst->max_length = src->length;
 
455
                } else
 
456
                        EXIT2(return STATUS_NO_MEMORY);
 
457
        } else {
 
458
                if (dst->max_length < src->length)
 
459
                        EXIT2(return STATUS_BUFFER_OVERFLOW);
460
460
        }
 
461
 
 
462
        n = src->length / sizeof(src->buf[0]);
 
463
        for (i = 0; i < n; i++)
 
464
                dst->buf[i] = toupper(src->buf[i]);
 
465
 
 
466
        dst->length = src->length;
461
467
        EXIT3(return STATUS_SUCCESS);
462
468
}
463
469